Flying panel/toolbar/form (like Office toolbar) lazarus / 39-Graphics ---------------------------------------------------------------------- x2nie · 2013-09-10 06:48 Halo guys ...! I am really need your help. I have a question and any sample code. Is there any way to show panel/form that has behavior like a popup menu ? We know every TPopupMenu would be: Showing without change the form.activecan track (detect) any mouse- movement Additionally, I need to display TWincontrol that has above abilities plus : Accept some TControl/TWinControl as it's childrenMultiple menuitem per horizontal bar (like Google Chrome zoom menu item)Cross-platform. It may has similar interaction when run on Windows, Linux or Mac OS.Allow focus-control (like TEdit, TSpinEdit) is an advance, but not the highest priority for now Simply, it is like what Office's toolbar could do. (OpenOffice toolbars, Microsoft Office toolbars). ------------------------------------------------- Okay, for Delphi there is a famous VCL named Toolbar97 and it's sister: TB2K by Jordan Russel, and futher of it is :TBX by Alex Denisov or SpTBXLib by SilverPoint. But their softwares are hard to port to Lazarus, due they are depending to specific Windows functions (for message loop when popuping). ExtToolbar was a port of Toolbar97 to Lazarus, but it did not yet able to show flying window such what Toolbar97 could do. (I have ported both Toolbar97 and TB2K ver 2.2.2 by myself, but then these crash my Lazarus by showing long error message in the end when I clicked. I stoped developing them) Maybe, toolbar library (such TB97/TB2K) was too complex to make compatible for Lazarus~CrossPlatfor? I also port the small one: TColorPickerButton by Mike Lischke. (I put link in bottom) But, again, it depends for specific Windows that I cant replace the for to run nicely in Lazarus. So, I feel it would be better if we create a new library from scratch. Then, here I am begging to you The Lazarus Community. Perhaps, by show me (or someone like me) of  how to popup/show a form without activating the mainform? It would be great enough for the first step forward building our new library for Lazarus. I am a bit new in Lazarus world. So I think any ideas / suggestion are very welcome. -------------------------- Possible similar topic: http://forum.lazarus.freepascal.org/index.php/topic,21970.msg129088.ht ml http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-Popup-window- td4028178.html http://www.mail- archive.com/lazarus@lists.lazarus.freepascal.org/msg34890.html ExtToolbar for lazarus: http://forum.lazarus.freepascal.org/index.php/topic,10956.msg54705.htm l#msg54705 TColorPickerButton by Mike Lischke: http://www.lischke-online.de/index.php/controls/color-picker-control ---------------------------------------------------------------------- zamtmn · 2013-09-10 18:55 It would be nice to have such control. I need it to implement a similar combobox component. But I think it's very difficult to do cross platform, my small knowledge let me just dream about it ---------------------------------------------------------------------- taazz · 2013-09-10 19:40 there is no cross platform way that will allow you to create a popup form that will not still activation from the popup parent. As far as I know (and I would love to be proved wrong) win32 is the only api that distinguish between focus and activation and even that requires a lot of low level work to make it work. most of the solutions that I have seen they fake it by adding the popup form to the message loop of the popup parent (some like a child control but not quit) forwarding mouse and keyboard messages. I am aware that this have been enhanced in the latest .net framework and now it can be done easily there but on win32/64 it needs a lot of work. ---------------------------------------------------------------------- vrull · 2013-09-10 23:09 Maybe I don't understand something in your requirements for the flying stuff, but I think I've made something similar without any specific tricks. In my project XML Tree Editor you can find a search form, which communicates with the main form or a notification, which does nothing, but still reacts on user clicks or clicks outside it. There are some user messages involved, but this seems to work in both Windows and Linux, and I believe on other platforms. The source can be found http://sourceforge.net/projects/xmltreeeditor/files/?source=navbar ---------------------------------------------------------------------- x2nie · 2013-09-11 03:48 Quote from: zamtmn on September 10, 2013, 08:55:44 pmIt would be nice to have such control. I need it to implement a similar combobox component. But I think it's very difficult to do cross platform, my small knowledge let me just dream about it Hi zamtmn! I believe we could step that dream to the reality. I have seen that GTK and QT allow that. Quote from: taazz on September 10, 2013, 09:40:23 pmthere is no cross platform way that will allow you to create a popup form that will not still activation from the popup parent. As far as I know (and I would love to be proved wrong) win32 is the only api that distinguish between focus and activation and even that requires a lot of low level work to make it work. most of the solutions that I have seen they fake it by adding the popup form to the message loop of the popup parent (some like a child control but not quit) forwarding mouse and keyboard messages. I am aware that this have been enhanced in the latest .net framework and now it can be done easily there but on win32/64 it needs a lot of work. Thanks you tazz. Yes, you right that: there is nothing yet to do that by calling a single function nor any class within Lazarus for cross platform currently. But I found an opportunity (by using Lazarus), since Lazarus support several widgetset, wich are some widgetset suppports in cross-platform already. And there are some example of software implemented it. I can make a prove about it: Gimp show some panel like a popup-list / combobox-list; I think using GTK would also ableCalligra Word show panel as like as Gimp: without deactivating the main form. Proving QT could do too (see attachments.) Okay, I sew that proven within my Windows Machine, and I am not sure how they are looked at Linux / Mac or other. But, by assuming wether GTK or QT each one has identical capabilty in major OS, let we remember the jargon : "Lazarus, write once compile anywhere" So, my idea is: Perhaps, can we create a class or LCL library, that indeep implements specific trics/functions which are polymorphic based on widgetset used ? I think it is not a difficult, and (sadly) not also easy for me to do that alone. Quote from: vrull on September 11, 2013, 01:09:17 amI've made something similar without any specific tricks. In my project XML Tree Editor you can find a search form, which communicates with the main form or a notification, which does nothing, but still reacts on user clicks or clicks outside it. There are some user messages involved, but this seems to work in both Windows and Linux, and I believe on other platforms. Thanks vrull ! I am glad you give the code. I must try your software first, and learn your code. It may take some hours or days. -------------------------------------- Anyhow, Do you same with me when thinking about : if widgetset supported by Lazarus supports the flying window, why Lazarus didnt support it yet? I dont know the exact reason... But, I felt that because the planning / scope of implementing it was too far. In other hand, if we could implementing flying panel, it may attracts us to implement the next feature: docking-capability of that same panel. (Actually it was my problem when trying to port the TB97 & TB2K to Lazarus: how it will be docked?) So now, let we make this task easy to achieve: Focus on how flying panel available by Lazarus for cross platform, first. Dont care about docking aspectMake it simple but useful.  For example: let display a TPanel with some TButton as it chidren, flying! (some demos would be great for testing in many platform / widgetset) Make it stable and portable (major widgetset supported by lazarus has no problem)Think about dockable / dragable later Oh, why? Because, I think : not every need of flying panel is also the need of dockable aspect. Yeah, that above is my brain content. Do you have any better ideas ? Okay, Thanks you everybody. Your contribution to this task will be valuable for me and the community. ---------------------------------------------------------------------- taazz · 2013-09-11 05:00 floating toolbar type of form is easy and can be done now using the PopupParent and PopupMode properties of a form (although the last time checked it did not work on QT 4) but the moment the popup form is selected it gets the focus from the parent form and the caption is painted in deactivated mode. Although I have a couple of controls that mimic a combo box with a custom drop down form I haven't so far found any way to allow the main form to retain the activated colors when the drop down form has the focus in a cross platform way. In windows you can take over the parent window loop (I think it is called subclassing) and fake the activation and all but I do not knowIf any thing similar is supported in other widgetsets. see attached a working example of a custom combo in my task list. ---------------------------------------------------------------------- x2nie · 2013-09-11 18:07 Quote from: taazz on September 11, 2013, 07:00:25 amfloating toolbar type of form is easy and can be done now using the PopupParent and PopupMode properties of a form... Okay taazz. it works... But I didnt see any advantage between of setting those properties or not. Would you like give use any link useful talking about those properties topic? Bytheway, last minutes ago I successful to display a TWinControl as popup without changing it's form.active state. It was based on TColorPickerButton by Mike Lisckhe. It is small enough to learn the code (only 3 classes = 1 LCL registred class). I keep it compatible with Delphi for respect to the original author and his community. I wish, In future, I can extract it's portion codes into another class as a base for totally new flying TForm/TWinControl. If somebody want to play / try / learn with it, I attached the codes below. Note: currently only work in Lazarus Windows widgetset and depends to Windows (doh! ) --------------------- Quote from: taazz on September 11, 2013, 07:00:25 amIn windows you can take over the parent window loop (I think it is called subclassing) and fake the activation and all but I do not knowIf any thing similar is supported in other widgetsets. Yes! The TMessage(s)' loop is amazing. I noticed that by using it, we could make TToolbar more responsive as like as TMainMenu's popups class. But how? Would you like to give us a sample code or a mini demo project ? any articles/url will also be nice to visit. For me, I saw that on TB2k source codes which is too complex to be extracted, unstable running in Lazarus. If you or somebody need the ported code of TB97 for lazarus, I will upload that here. Yeah, I didnt yet put here due I think it is irrelevant (begging help vs announcement of third-party LCL). For the early progress, depends on single widgetset is fine, isn't it? If it was stable, I wish somebody would translate it into another widgetset. (I dream it  ha ha ha...) Again, any correction , suggestion although comments    or any imagination ideas are very welcome !! ---------------------------------------------------------------------- taazz · 2013-09-13 09:16 Let me try to explain the popupParent and PopupMode properties. Popupmode has 3 values pmNone is the default and means none popup logic at all, pmExplicit means that the popup parent is defined by the popupParent property, pmAuto means that the form will always be in popup mode and the popupParent will be automatically chosen in which case most of the times is the application main form. What PopupParent and popupMode do is nothing more than a way to define a z order on your forms that will be always respected. For example when a form a popupParent equal the main form of the application then when the main form gets the focus then the popup form will always float above the main form other forms might float above main form and the pop up form or be below the main form but the popup form can never be below the main or what ever the popupParent is pointing to. thats all there is to those two properties and it is a big help when used for toolbars that suppose to always float above a specific form eg there is no use to toolbar that the moment you select the editing form it goes behind it and there is no way to click the tool button other than restoring the editor form from maximized state move it around and select the toolbar floating window to come on top so you can click the tool button you need. As for the TWinControl descendant as a floating window is a good solution for compound components that mimic a combo box like the color picker you are talking about but it would be a pain to create such a component every time you need a combo layout that is not supported like the combo box screen shot I posted in my last post. There should be a way to build a popup form using existing controls with out the need to write and install components that will be used on a single application only. That is why I'm searching a solution based on forms and not on TWinControl although I love the TWinControl idea and I'll probably use it in my ported color library to create a color combo and other types of combo box. ---------------------------------------------------------------------- x2nie · 2013-09-18 05:05 Quote from: vrull on September 11, 2013, 01:09:17 amMaybe I don't understand something in your requirements for the flying stuff, but I think I've made something similar without any specific tricks. In my project XML Tree Editor you can find a search form, which communicates with the main form or a notification, which does nothing, but still reacts on user clicks or clicks outside it. ... Hi vrull, I've learn your code. Thanks you for show us your codes. I need something like that, but without deactivate the main form. I may use the message mechanism for future when I am ready to the next step. ---------------------------------------------- Dear Tazz.. Oh, I am not notice before about the z order. Yes, those 2 property make my "popup" form always on top of it's PopupParent (the mainform). Okay, now... So far, we found 2 candidate solution: *  Your CustomCombobox (TForm)  and *  "My" Popup (TWincontrol). It's not exactly mine, I am not the original author, but I bring it here.      so just to distinct it with your suggested solution I call it "my". I repeat again: I have to make a choice between 2 solution as a solution of flying container question: 1 -> Using TForm (or TCustomForm) as flying container +PopupMode + PopupParent 2 -> Using TWinControl with hack ( +CreateParams +CreateWnd +event.Show(). ) Pro & Con : * First solution,    (+) Already Lazarus cross platform.    (+) it also give us a chance to arrange controls such buttons, labels, TEdit visually.    ( - ) But it always change the mainform activation (shown by color of mainform's titlebar). * Second solution,    ( - ) currently Lazarus in Windows only.    (+) It never activated (mean: mainform's title bar color seem as the active control).    ( - ) Sadly, it doesn't give us ability to arrange controls visually (via form designer in design-time). --------------------- So, I think it maybe better if we could marriage both solution, := make a new hybrid solution (rather than choosing only one of them) : A. --> Transfer the content in runtime.           Suppose we put & arrange some controls (buttons, labels, TEdits) in a form (like your combobox form)          And, when it needed to be shown (in runtime), we create a new TWincontrol and transfer the          form's children into that new TWincontrol created. B. --> Make it designable visually in :          The "flying TWincontrol" it self is inherited from a TWincontrol which is already available in lazarus           (visible in design time).          We can create a new TWincontrol (+hack for flying capability) based on TPanel, for example.          By this, your expectation to able to put and move any buttons, labels, combobox will be achieved. Solution A: not only from TForm, it might also transfered it's children from TPanel. Solution B: no need to transfer, it self able to fly when needed. The goal of both solutions is to bring a flying window (TWinControl) in runtime, plus ability to arrange/move controls in design time, PLUS: without changing the current active form (mainform must be remain active control). The difference between them is : implementing Solution B need registering of that new LCL by installing a new component package (*.lpk), therefor we must put that hacked panel into our form from component palette (as similar as putting a TPanel from Lazarus's Component Palette). --------------------------- I mean, PopupMode and PopupParent of TForm are OK, except I just dislike that using TForm will always grab it's parent-form's Active property. While I expect the PopupParent will always the active. In other hand, if we success to work with TWinControl as popup form, I am not sure if we can make it cross platform (run well in WIndows, Linux, MacOS) What is your oppinion ? ------------------- Thanks you! ---------------------------------------------------------------------- x2nie · 2013-09-18 05:24 Quote from: x2nie on September 18, 2013, 07:05:21 am..., I am not sure if we can make it cross platform (run well in WIndows, Linux, MacOS) I correct my own statement. It must be: "I am not sure if I can make it crossplatform by myself." Meaning: I am begging to the Lazarus community to make it cross platform, next time. As you can see in my previous posts in this topic, I attached several screenshoot about GTK & QT able to do it (flying window without deactivate it's parent from) So, I believe we could make it crossplatform (using QT, GTK+, Windows), next time / some day. I just dont know "how" to make it happens by using Lazarus, in nowdays. ---------------------------------------------------------------------- taazz · 2013-09-18 05:47 Try to search for mustangpeek dropdownform for delphi (I think I have a copy somewhere on my disk that I can share if you like). TDropDownForm is nothing more than a hack based on TForm that keeps the parent form activated all the time, it meets all the requirements listed here so far except it is windows specific, if you are going down the road of windows specific then that is the ideal solution for that problem. Although I have worked with both QT and GTK2 on a windows machine my experience with those widget sets starts and stops on what ever the lcl supports or what ever I can read on the internet. I have no C/C++ experience that I can rely on to draw my own conclusions from the source so I can only rely on the community to help tackle the problem on those widget sets. So far in this forums the interest is very low it comes up once or twice a year as a problem but no one has managed to provide any solution not even widget set specific (including me). ---------------------------------------------------------------------- x2nie · 2013-09-18 17:29 Hi, taazz... I am unlucky to find that (mustapeak dropdownform). Would you like to attach them here or share with me? I found the download link (http://www.downloadatoz.com/software- development_directory/drop-down-form/download.html) but nothing found to be downloaded. mustangpeak.net is curently idle. ---------- Anyway, about hooking the mainloop (while the popup shown) for cross platform implementation, I think I see the "tiger's tail" ! I mean, perhaps its not an exactly the solution we find, but its possible around there. http://wiki.freepascal.org/Main_Loop_Hooks http://forum.lazarus.freepascal.org/index.php?topic=9930.0 Unfortunatelly I didnt see the complete demo to run/to learn about how work with main loop hook . ---------------------------------------------------------------------- taazz · 2013-09-18 17:47 from a quick look around the wiki article it is not the same thing as subclassing in windows. In windows using subclassing you replace the main loop with your own procedure and if the need arises then you call the old one, what main loop hook is describing is a way to add something along the lines of an extra event handler with no control on when the old code is to be executed. It is a half baked solution to address a wide range of uses but it fails to address a number of problems including the one we discuss. ---------------------------------------------------------------------- JuhaManninen · 2013-09-18 20:05 Quote from: taazz on September 13, 2013, 11:16:43 amLet me try to explain the popupParent and PopupMode properties. Popupmode has 3 values pmNone is the default and means none popup logic at all, pmExplicit means that the popup parent is defined by the popupParent property, pmAuto means that the form will always be in popup mode and the popupParent will be automatically chosen in which case most of the times is the application main form. This is completely new to me although I develop some other parts of Lazarus. The help info box for PopupMode says:   Defines where popup menus are shown. which is apparently wrong then. There is nothing to select for popupParent in Object Inspector. This feature is kind of competing with FormStyle property. It has been already extended with fsSystemStayOnTop. It could be extended also with fsPopupStayOnTop of similar. I copied a component palette pages popup window from Codetyphon to Lazarus (it has been modified a lot since). Codetyphon guys could not make it close when the popup-button is clicked second time and the window is already open, and neither could I. If someone finds a solution, please send a patch. This popup has another problem: It does not close when focus moves directly to another application. It closes only if a part of IDE is clicked. This can be solved by registering an application event handler. ---------------------------------------------------------------------- taazz · 2013-09-19 05:45 Quote from: JuhaManninen on September 18, 2013, 10:05:38 pm This is completely new to me although I develop some other parts of Lazarus. The help info box for PopupMode says:   Defines where popup menus are shown. which is apparently wrong then. I guess you mean the info box on the object inspector which I have it hidden so if it does then I agree. EDIT Out of curiosity I enabled the info box on the inspector and in my installation the only think that I see when the popupMode or popupParent is selected is one line on top that reads "Package LCLBase" nothing else is provided I'm guessing that you are using a trunc version or something is wrong with my installation. Quote from: JuhaManninen on September 18, 2013, 10:05:38 pmThere is nothing to select for popupParent in Object Inspector. Really? On my 1.0.10 lazarus I can select any form in the project as a popupParent. Quote from: JuhaManninen on September 18, 2013, 10:05:38 pmThis feature is kind of competing with FormStyle property. It has been already extended with fsSystemStayOnTop. It could be extended also with fsPopupStayOnTop of similar. Im guessing this is for delphi compatibility personally I do not mind but it could probably only represent the popupMode property and I think that it is cleaner to leave as it is since the internal z Order of forms does not click for me as a form style value. Quote from: JuhaManninen on September 18, 2013, 10:05:38 pmI copied a component palette pages popup window from Codetyphon to Lazarus (it has been modified a lot since). Codetyphon guys could not make it close when the popup-button is clicked second time and the window is already open, and neither could I. If someone finds a solution, please send a patch. This popup has another problem: It does not close when focus moves directly to another application. It closes only if a part of IDE is clicked. This can be solved by registering an application event handler. The idea of popup property pair is to set the z order it have never supported any close logic this is something the developer of the application should decide upon and code as it should. I see no need to auto close a flying toolbar for example when the application looses focus although I did expect at first that the focused form will get a lost focus event when the application changed I quickly found out and used the Application.AddOnDeactivateHandler for my needs. I do not have any idea on what the "component palette pages popup window" is, although I have used codeTyphoon for a sort period of time when I was starting I can't visualize what you are talking about or where to find it in lazarus 1.0.10. ---------------------------------------------------------------------- JuhaManninen · 2013-09-19 09:56 Quote from: taazz on September 19, 2013, 07:45:53 amOut of curiosity I enabled the info box on the inspector and in my installation the only think that I see when the popupMode or popupParent is selected is one line on top that reads "Package LCLBase" nothing else is provided I'm guessing that you are using a trunc version or something is wrong with my installation. Yes, I forgot to mention I use trunk. I guess somebody documented PopupMode but did not know what it does. Lazarus trunk and the new 1.2 release branch have the OI info box visible by default. The info is more readable because useless headers are removed. A user can see the essential text without scrolling. I recommend for everybody to test the new branch   http://svn.freepascal.org/svn/lazarus/branches/fixes_1_2 or the 1.1.99 Pre Release or the future 1.2RC releases, so we can weed out bugs and final 1.2 will be perfect. (!) QuoteReally? On my 1.0.10 lazarus I can select any form in the project as a popupParent. Ok, another bug. May be because of this change:   http://wiki.lazarus.freepascal.org/Lazarus_1.2.0_release_notes#TComp onentPropertyEditor_behavior_was_changed I made the change so I guess I must fix it, too. QuoteI do not have any idea on what the "component palette pages popup window" is, although I have used codeTyphoon for a sort period of time when I was starting I can't visualize what you are talking about or where to find it in lazarus 1.0.10. CodeTyphon has a big arrow on the right side of component palette. We changed it for a smaller and less striking arrow, and Martin placed it inside the palette itself. It is rather nice now. ---------------------------------------------------------------------- taazz · 2013-09-19 10:56 Quote from: JuhaManninen on September 19, 2013, 11:56:38 amYes, I forgot to mention I use trunk. I guess somebody documented PopupMode but did not know what it does. Lazarus trunk and the new 1.2 release branch have the OI info box visible by default. The info is more readable because useless headers are removed. A user can see the essential text without scrolling. I recommend for everybody to test the new branch   http://svn.freepascal.org/svn/lazarus/branches/fixes_1_2 or the 1.1.99 Pre Release or the future 1.2RC releases, so we can weed out bugs and final 1.2 will be perfect. (!) I'll try to find some time on this if there is an official list of things to be tested I could spend some time reporting problems or irritating things on those as well. Quote from: JuhaManninen on September 19, 2013, 11:56:38 amOk, another bug. May be because of this change:   http://wiki.lazarus.freepascal.org/Lazarus_1.2.0_release_notes#TComp onentPropertyEditor_behavior_was_changed I made the change so I guess I must fix it, too. Well the problem as I see it, is that a working piece of code was changed with out any regard on backward compatibility and with out any knowledge on what it will affect, I would simply add a new property on the existing property editor allowing to distinguish between global or local component list and I wouldn't split it to 2 components in the first place. Breaking working functionality like these it should be considered a taboo and allowed only when there is no other way around the problem.  Quote from: JuhaManninen on September 19, 2013, 11:56:38 amCodeTyphon has a big arrow on the right side of component palette. We changed it for a smaller and less striking arrow, and Martin placed it inside the palette itself. It is rather nice now. Ah yes now I remember I used it on CodeTyphoon and I even wished that lazarus had it when I settled on it but after finding the shift+Ctrl+P combination I never missed it again. I'm going to take a look on the functionality and see if I can spot the problem of "not closing" that you mentioned when I install the 1.1.99 or the RC later on. ---------------------------------------------------------------------- JuhaManninen · 2013-09-19 19:25 Quote from: taazz on September 19, 2013, 12:56:45 pmWell the problem as I see it, is that a working piece of code was changed with out any regard on backward compatibility and with out any knowledge on what it will affect, The bug now was a false alarm. I tested with Lazarus forms that were not part of the project. I get a list of all project forms now. I had "knowledge on what it will affect". I checked all uses of TComponentPropertyEditor and changed the ones that needed changing, while fixing a bug for ActiveControl property. It is true I changed the behavior of an existing editor which was not necessary. Now I changed it back, the other editor is now called TComponentOneFormPropertyEditor. This change will be merged to 1.2 and I removed the note from wiki for 1.2 changes. QuoteI would simply add a new property on the existing property editor allowing to distinguish between global or local component list and I wouldn't split it to 2 components in the first place. Please see ideintf/propedits.pp about how the editors must be made. QuoteBreaking working functionality like these it should be considered a taboo and allowed only when there is no other way around the problem.  I mainly fixed a bug. My assumption was that most use cases need my new editor and thus it will solve even more bugs. Maybe this assumption was wrong, dunno. Juha ---------------------------------------------------------------------- taazz · 2013-09-19 19:56 Erm, don't get me wrong I do not criticize your way of working or anything. Knowing nothing about the actual internal workings of LCL my rants are more like a "note to self" kind of thing that I publicize in order to get feedback rather than a "you shouldn't have done that" kind of attitude. Every point I make is been noted to a list of mine that I usually look at when I'm confused about things than anything else. Feedback from the community help me refine those points to a more complete "solution". I'll take closer look at propedits.pp to see what is going on thank you for the heads up. ---------------------------------------------------------------------- JuhaManninen · 2013-09-20 09:38 No worries. It is good to be critical. One more thing about the info box in Object Inspector: It becomes still more usable when TurboPowerIProDsgn package is installed. You get HTML formatting and links to units and packages etc. I was hoping it could be installed by default for Lazarus 1.2. Unfortunately with GTK2 TurboPowerIProDsgn creates an access violation sometimes when moving mouse over editor hints. That's why it cannot be installed by default. With other widgetsets it behaves OK. See :   http://bugs.freepascal.org/view.php?id=20202 It is a nasty bug. If somebody find a way to fix it, great. ---------------------------------------------------------------------- x2nie · 2013-10-01 15:38 Hi guys...! I have a small good news. I am in a half work of creating a toolbar (different with Lazarus toolbar). Based on Toolbar97 by Jordan RusselMultiple toolbar in one row, also can be Full one rowToolbar position can be moved, drag/dropHas drag area (similar to TCoolbar does, but actually is Toolbar97's feature) In previous trial, I have failed for several times. So, I am happy I could did it.Floating toolbar is currently Windows only. and is buggyShow popup menu as a dropdown menu (similar to what TToobutton can do). It is Toolbar97 feature.Could not show any other flying panel currently. I hope it will be a basic of what TBX by Alex Denisov could did, perhaps in future. I will upload here in next days, if anybody need the source-code. I have problems: How to draw window caption (like any TForm caption&close button area) using Lazarus. I mean, not for Windows only. Is there a cross-platform way to paint header form ?Currently I use directly header form by setting BorderStyle := bsDialog for floating toolbar. But then, the form could not be docked automatically. Only by dragging the flying-toolbar it self (not by draggint the caption of form), it could be docked automatically when moved over a TTBDock. So, we can not use the caption area directly. We must set BorderStyle := bsNone, and Painting the caption area by ourself to simulate the "TDialog" 's  caption area, and user may move the flying toolbar by dragging that caption area which is actually is the toolbar itself.My big problem is how to replace the off-screen drag-zone-box, with the "alpha-blend-blue-zone" that is Lazarus could did when docking/undocking. ? When you docking / drag-undocking a form, Lazarus show us that blue- box-alphablended. Where is the code of this features in Lazarus source code? what unit.pas it is? which line number? ============================= Okay, here is so far my summary of work: * Argue that flying panel is realistic idea : I were showing the screenshoot of GTKx & QT's Flying panel in action. I am sure we could do it! * Create flying panel demo: done, attached in previous post of this topic. * Cross-platform flying form: we could use TForm.PopupParent * Useful / general purpose flying panel : suspended, pending. due my minimum widgetset knowledge * Flying toolbar : in progress, based on TB97 components. I decrease dependency to Windows.pas, not at all yet. * Cross-platform skinned toolbar like TBX / SPTBX: planned, need your help. ---------------------------------------------------------------------- taazz · 2013-10-01 17:00 well the following wiki page explains the window caption bar problem well enough http://wiki.freepascal.org/Docking#Drag_and_Drop. My preference would be to change the underline lcl classes to mimic the windows behavior but I do not know how hard it will be to do so on GTK and QT although in QT I imagine it would be easier. ---------------------------------------------------------------------- x2nie · 2013-10-03 15:24 Okay, Tazz.. I replacing the off-screen-box (paint to screenDC) with a TForm, a semitransparent TForm since I think Lazarus use it while in drag-dock operation. My problem is: That semi-transparent form doesn't moved when I start drag the toolbar. The problem is because I replace the message loop with application.message. Okay, maybe I were wrong. It is better if I could use DRagImageList. I just unluckly could not find any complete sample of using DragImageList, so I create that TForm for simulate the DragImagelist, due I think it is for crossplatform purpose. Now, I need similar functions belows without explicitely uses Windows.pas : GetMessage()PostQuitMessage()TranslateMessage (Msg);DispatchMessage (Msg); Any idea? Here is the code: Code: [Select]{ Stay in message loop until capture is lost. Capture is removed either           by this procedure manually doing it, or by an outside influence (like           a message box or menu popping up) }         while GetCapture = Handle do begin           {$IFDEF FPC}             Application.ProcessMessages;           {$ELSE}           case Integer(GetMessage(Msg, 0, 0, 0)) of             -1: Break; { if GetMessage failed }             0: begin                  { Repost WM_QUIT messages }                  PostQuitMessage (Msg.WParam);                  Break;                end;           end;           case Msg.Message of             WM_KEYDOWN, WM_KEYUP:               { Ignore all keystrokes while dragging. But process Ctrl and Escape }               case Msg.WParam of                 VK_CONTROL:                   if PreventDocking <> (Msg.Message = WM_KEYDOWN) then begin                     PreventDocking := Msg.Message = WM_KEYDOWN;                     MouseMoved;                   end;                 VK_ESCAPE:                   Break;               end;             WM_MOUSEMOVE:               { Note to self: WM_MOUSEMOVE messages should never be dispatched                 here to ensure no hints get shown during the drag process }               MouseMoved;             WM_LBUTTONDOWN, WM_LBUTTONDBLCLK:               { Make sure it doesn't begin another loop }               Break;             WM_LBUTTONUP: begin                 Accept := True;                 Break;               end;             WM_RBUTTONDOWN..WM_MBUTTONDBLCLK:               { Ignore all other mouse up/down messages }               ;           else             TranslateMessage (Msg);             DispatchMessage (Msg);           end;           {$ENDIF}         end; edited: add screeshoot. screenshoot: I am moving the "fuchsia toolbar" far somewhere in screen. But the offscreen form (dragimagelist simulation) is not moving anyewhere. secondary screenshoot: the "fuchsia toolbar" moved, and dragged again (when running under Delphi) ---------------------------------------------------------------------- x2nie · 2013-10-07 15:15 I will back, I need to care about the license first. Quote from: x2nie on October 07, 2013, 04:35:28 pmHalo! For flying ghost, I have solved it. I mean, for simulating the DragImage, now it is also moving when we move the toolbar anywhere. (code is Attached below, when you are logged in). ========= Story continue.... My current problem is when I set the "RowMin" property to higher of 1. (such RowMin := 2) Oh, to re-generate the problem, you might need to several toolbar in one dock-bar, and try to resize the form!  When we can achieve it, at least we can make a (branch of) Lazarus that mimic the Delphi7 appearance: draggable toolbars! I hope you like it. ---------------------------------------------------------------------- Graeme · 2013-10-08 12:27 If you project isn't too far already, maybe you can switch to fpGUI Toolkit [1].  In fpGUI there is a TfpgPopupWindow [2] class which does just want you want and works cross platform. It can popup, but you can also prevent it from stealing focus. In fact, that is how fpGUI implements Hints, Splashscreens, ComboBox dropdown, CalendarCombo dropdown etc. 1. http://fpgui.sourceforge.net/ 2. http://fpgui.sourceforge.net/apidocs/fpg_popupwindow/tfpgpopupwindo w.html ---------------------------------------------------------------------- x2nie · 2013-10-08 13:09 Quote from: Graeme on October 08, 2013, 02:27:24 pmIf you project isn't too far already, maybe you can switch to fpGUI Toolkit [1]. Wow.!  First, I am glad meet you here, because I am learning fpGUI since days ago.. I am surprised by you Graeme. No, it's not too far yet. Currently my toolbar is inherited from TCustomPaintBox32 (Graphics32)  for handling cross-platform surface. So, it should work together with QT,GK,Carbon (and any widgetset supported by GR32). But my toolbar doesn't intensively depends on GR32. Because of the appearance is low priority for me, so I leave it as still using TCanvas (which is provided internally by GR32) operation as also original toolbar97 did. Quote from: Graeme on October 08, 2013, 02:27:24 pmIn fpGUI there is a TfpgPopupWindow [2] class which does just want you want and works cross platform. It can popup, but you can also prevent it from stealing focus. In fact, that is how fpGUI implements Hints, Splashscreens, ComboBox dropdown, CalendarCombo dropdown etc. You might want to say: "..wich does just what you want.." Yeah! that is what I wanted. Okay, I will take this challenge In separated different purpose. For combining of using fpGUI in my toolbar with general purpose, I have question, Graeme: When I have switched my toolbar to support fpGUI Toolkit only, could I attach this toolbar into Lazarus IDE ? If I could not, no problem. I still want to try switch it to fpGUI. I just wonder if I were able.  ========================= For current progress of flying toolbar, in case you want to know, I am thinking (give me time) about the license of the library. I preserve it would released under MPL/LGPLv2 as GR32's license, or as same as LCL license... Since the original toolbar97 doesn't choose any lincense explicitely. TB97 author said it is opensource. ---------------------------------------------------------------------- Graeme · 2013-10-08 15:23 Quote from: x2nie on October 08, 2013, 03:09:26 pmWow.!  First, I am glad meet you here, because I am learning fpGUI since days ago.. I am surprised by you Graeme. Hidden gems are wonderful!  QuoteFor combining of using fpGUI in my toolbar with general purpose, I have question, Graeme: When I have switched my toolbar to support fpGUI Toolkit only, could I attach this toolbar into Lazarus IDE ? You cannot mix LCL and fpGUI components in the same application. ---------------------------------------------------------------------- x2nie · 2014-11-24 12:24 Hi all.. It was long time (1 year ago) vacuum no progress so far since I wanted to implement flying toolbar, ... and It was accidently I lost my laptop with the all source code I have, including the source of that  toolbar. (see http://forum.lazarus.freepascal.org/index.php/topic,23775.msg1424 35.html) I am glad, Today, luckily I found that source-code, not the last, just an early work one. But it run well with Lazarus 1.2.6 I am too happy, so I just upload it here as is, without modifying. Please don't expect too much, for now, I will improve it later. It require GR32 package to compile, I will remove it next day. I just, too happy    (you know what I mean, remember when you lost your stuff and then found it back) -------------------- The license would be LGPL 2.1 With linking exception, /+ / MPL 1.1 Enjoy! =x2nie=