Re: [Gambas-user] Gambas-user Digest, Vol 102, Issue 40
Brought to you by:
gambas
|
From: Sam D. <sam...@ya...> - 2014-11-19 17:43:21
|
ComboBox UserContol, with pictures Hi Fabien, Exactly. After looking at the code from Christof Thalhofer's "Gambas Combobox for Lists and Databases" https://github.com/Deganius/DegComBox I saw exactly that. A simple Window object to parent the ListView into and then position the Window to the ScreenX and ScreenY of the ComboBox container. This lines up exactly. I added true for the skip taskbar and it looks nice. The ability to create custom controls in Gambas is really powerful. Sometimes I use a dummy form with panels of stock objects then reparent the panels into the real form or container and sometimes custom controls. Both allow the bulk of event handling logic to be keep separate from the specific event handling code. I have to get a little better with defining property getter and setters the way Gambas does, I'm use to defining getProperty and setProperty from the Java syntax. But then again, I still use Hungarian notation too, even in PL/SQL. Old habits are hard to break, but there are good reasons for this madness. Thanks. On Wednesday, November 19, 2014 9:24 AM, "gam...@li..." <gam...@li...> wrote: Send Gambas-user mailing list submissions to gam...@li... To subscribe or unsubscribe via the World Wide Web, visit https://lists.sourceforge.net/lists/listinfo/gambas-user or, via email, send a message with subject or body 'help' to gam...@li... You can reach the person managing the list at gam...@li... When replying, please edit your Subject line so it is more specific than "Re: Contents of Gambas-user digest..." Today's Topics: 1. Re: How do I pass a user parameter from a dialog form? (Rolf-Werner Eilert) 2. Re: How do I pass a user parameter from a dialog form? (Fabien Bodard) 3. Re: ComboBox UserContol, with pictures. (Fabien Bodard) 4. Issue 580 in gambas: Menu bar background color seems wrong. (ga...@go...) 5. Issue 581 in gambas: Progressbar and mouse events are gone (ga...@go...) 6. Issue 582 in gambas: ProgressBars are ugly (ga...@go...) ---------------------------------------------------------------------- Message: 1 Date: Wed, 19 Nov 2014 09:13:36 +0100 From: Rolf-Werner Eilert <eil...@t-...> Subject: Re: [Gambas-user] How do I pass a user parameter from a dialog form? To: gam...@li... Message-ID: <546...@t-...> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Am 18.11.2014 21:58, schrieb Tobias Boege: > On Tue, 18 Nov 2014, Martin McGlensey wrote: >> Hello, >> >> >> >> I have created a dialog form. As created by Gambas, it has an OK and Cancel >> button. I want to return three properties or an array from the form. One >> each for the three textboxes on the form. >> >> I added a textbox to the form to test it. Call it Textbox1. Used the code >> below to add a property called "Login" to the Dialog: >> >> >> >> Property Login As String >> >> Private strLogin AS String >> >> >> >> Private Function Login_Read() >> >> Return txtTextbox1.Text >> >> Return >> >> >> >> Private Sub Login_Write(Value as String) as String >> >> strLogin = Value >> >> End >> >> >> >> I call the Dialog from the main form by frmDialog.ShowModal. When I load the >> frmDialog, enter the text in the textbox and click OK. The Dialog closes but >> no value is returned to the main form. >> >> If I explicitly set Login_Read to Return "XYZ" it works properly. It >> returns "XYZ" to the main form. If I try to get the contents of >> Textbox1.Text it returns an empty string. There has got to be a way of >> returning the value of a textbox as a property of a dialog form. I'd rather >> not use public variables on the main form as there are too many variables >> already. >> >> Would you guys please point me in the right direction. >> > > This is a standard task and therefore a "template solution" evolved in the > Gambas sources. Attached is a project which shows how to do it cleanly, no > public variables and no auxiliary classes needed. > > If you have a problem with the project and comments being German, I will > translate it for you... > > Regards, > Tobi > > Thanks for that example. Never realised there would be this way to do it. It does indeed save a lot of trouble with values from dialogs. On the other hand, it means changing the form calls I'm used to from a simple "formxyz.ShowModal" to "DIM hForm As New formxyz" "aCollection = hForm(...)". Let me ask two things I stumbled over when studying the code: Where would I find this "call" thing in the documentation? F2 doesn't react to event calls, and I cannot find it under the event descriptions (like Event Management etc.). Why is a SUB used with a Return value? Wouldn't it be more up to standards to use a FUNCTION instead? (As far as I understand, a SUB is a function without a return value, one that would be of type "void" under C.) Regards Rolf ------------------------------ Message: 2 Date: Wed, 19 Nov 2014 09:24:45 +0100 From: Fabien Bodard <gam...@gm...> Subject: Re: [Gambas-user] How do I pass a user parameter from a dialog form? To: eil...@t-..., gam...@li... Message-ID: <CAF...@ma...> Content-Type: text/plain; charset=UTF-8 Function sub and procedure are the same . It's just a use Le 19 nov. 2014 09:14, "Rolf-Werner Eilert" <eil...@t-...> a ?crit : > > > Am 18.11.2014 21:58, schrieb Tobias Boege: > > On Tue, 18 Nov 2014, Martin McGlensey wrote: > >> Hello, > >> > >> > >> > >> I have created a dialog form. As created by Gambas, it has an OK and > Cancel > >> button. I want to return three properties or an array from the form. One > >> each for the three textboxes on the form. > >> > >> I added a textbox to the form to test it. Call it Textbox1. Used the > code > >> below to add a property called "Login" to the Dialog: > >> > >> > >> > >> Property Login As String > >> > >> Private strLogin AS String > >> > >> > >> > >> Private Function Login_Read() > >> > >> Return txtTextbox1.Text > >> > >> Return > >> > >> > >> > >> Private Sub Login_Write(Value as String) as String > >> > >> strLogin = Value > >> > >> End > >> > >> > >> > >> I call the Dialog from the main form by frmDialog.ShowModal. When I > load the > >> frmDialog, enter the text in the textbox and click OK. The Dialog > closes but > >> no value is returned to the main form. > >> > >> If I explicitly set Login_Read to Return "XYZ" it works properly. It > >> returns "XYZ" to the main form. If I try to get the contents of > >> Textbox1.Text it returns an empty string. There has got to be a way of > >> returning the value of a textbox as a property of a dialog form. I'd > rather > >> not use public variables on the main form as there are too many > variables > >> already. > >> > >> Would you guys please point me in the right direction. > >> > > > > This is a standard task and therefore a "template solution" evolved in > the > > Gambas sources. Attached is a project which shows how to do it cleanly, > no > > public variables and no auxiliary classes needed. > > > > If you have a problem with the project and comments being German, I will > > translate it for you... > > > > Regards, > > Tobi > > > > > > > Thanks for that example. Never realised there would be this way to do > it. It does indeed save a lot of trouble with values from dialogs. On > the other hand, it means changing the form calls I'm used to from a > simple "formxyz.ShowModal" to "DIM hForm As New formxyz" "aCollection = > hForm(...)". > > Let me ask two things I stumbled over when studying the code: > > Where would I find this "call" thing in the documentation? F2 doesn't > react to event calls, and I cannot find it under the event descriptions > (like Event Management etc.). > > Why is a SUB used with a Return value? Wouldn't it be more up to > standards to use a FUNCTION instead? (As far as I understand, a SUB is a > function without a return value, one that would be of type "void" under C.) > > > > > Regards > Rolf > > > ------------------------------------------------------------------------------ > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server > from Actuate! Instantly Supercharge Your Business Reports and Dashboards > with Interactivity, Sharing, Native Excel Exports, App Integration & more > Get technology previously reserved for billion-dollar corporations, FREE > > http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk > _______________________________________________ > Gambas-user mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gambas-user > ------------------------------ Message: 3 Date: Wed, 19 Nov 2014 11:01:11 +0100 From: Fabien Bodard <gam...@gm...> Subject: Re: [Gambas-user] ComboBox UserContol, with pictures. To: mailing list for gambas users <gam...@li...> Message-ID: <CAF...@ma...> Content-Type: text/plain; charset=UTF-8 And why reparent... The listview must be in a popup type window.. and then just move it at textbox screenx and .screeny Le 17 nov. 2014 22:31, "J?rn Erik M?rne" <ep...@jo...> a ?crit : > > Den 17. nov. 2014 21:36, skrev Charlie Reinl: > > Am Sonntag, den 16.11.2014, 17:57 +0000 schrieb Sam Dadds: > >> Hi All, > >> > >> Need help with a custom ComboBox. > >> > >> I've created a UserControl (extends UserControl) with the normal > stuff > >> (TextBox for selection, picture for selected item and picture for > dropdown button). > >> > >> The actual drop down list is a ListView instead of a ListBox for > item pictures. > >> This all works well. > >> > >> Problem is with positioning the drop down list. The ListView > actually gets re-parented > >> to the underlying form so it will display normally even when the > ComboBox is inside a > >> toolbar or other container. > >> > >> Finding the correct X and Y is a problem. Depending on how many > containers the actual > >> ComboBox is inside the X and Y become difficult to calculate. > >> > >> It seems the borders or margin padding of the additional containers > are not taken into consideration when reporting the X and Y of the ComboBox > container. > >> > >> Currently I've tried iterating up the containers via the parent of > the ComboBox and > >> add up the left or X properties until the actual parent form is found. > This is close > >> but not 100% accurate. By adding in the Desktop.Scale it gets a bit > closer but still > >> off. > >> > >> I've looked at the source for the db version of a ComboBox but the > internal ListBox > >> is actually used. > >> > >> Does anyone have an example of this or a better idea of how to use a > ListView as the > >> List container of the ComboBox? > >> > >> It's not critical but it would be nice to have item pictures in a > ListBox or ComboBox. > >> > >> Thanks. > > Salut Sam, > > > > have a look at Christof Thalhofer's "Gambas Combobox for Lists and > > Databases", https://github.com/Deganius/DegComboBox , may be you find > > some ideas. > > > Perhaps I haven't understood your issue, but why not set the > ListView.Ignore = True and the parent to the current form? > > > ------------------------------------------------------------------------------ > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server > from Actuate! Instantly Supercharge Your Business Reports and Dashboards > with Interactivity, Sharing, Native Excel Exports, App Integration & more > Get technology previously reserved for billion-dollar corporations, FREE > > http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk > _______________________________________________ > Gambas-user mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gambas-user > ------------------------------ Message: 4 Date: Wed, 19 Nov 2014 14:11:02 +0000 From: ga...@go... Subject: [Gambas-user] Issue 580 in gambas: Menu bar background color seems wrong. To: gam...@li... Message-ID: <0-6...@go...> Content-Type: text/plain; charset=UTF-8; format=flowed; delsp=yes Status: New Owner: ---- Labels: Version Type-Bug Priority-Medium OpSys-Any Dist-Any Arch-Any Desktop-Any GUI-Any New issue 580 by Kok...@gm...: Menu bar background color seems wrong. https://code.google.com/p/gambas/issues/detail?id=580 As you can see in the screenshots, the menubar doesn't follow the main form background. In my case, the standard oxygen style is used, which is drawn with a gradient. Menu bar doesn't use the gradient anymore, while in the past (before 3.6.x) it worked. My system: [System] Gambas=3.6.1 OperatingSystem=Linux Kernel=3.17.3-1-ARCH Architecture=x86_64 Distribution=Arch Linux Desktop=KDE4 Theme=Oxygen Language=it_IT.utf8 Memory=3957M [Libraries] Cairo=libcairo.so.2.11400.0 Curl=libcurl.so.4.3.0 DBus=libdbus-1.so.3.8.7 GStreamer=libgstreamer-0.10.so.0.30.0 GStreamer=libgstreamer-1.0.so.0.404.0 GTK+3=libgtk-3.so.0.1400.5 GTK+=libgtk-x11-2.0.so.0.2400.25 OpenGL=libGL.so.1.2.0 Poppler=libpoppler.so.47.0.0 Qt4=libQtCore.so.4.8.6 SDL=libSDL-1.2.so.0.11.4 Attachments: 16.png 14.5 KB -- You received this message because this project is configured to send all issue notifications to this address. You may adjust your notification preferences at: https://code.google.com/hosting/settings ------------------------------ Message: 5 Date: Wed, 19 Nov 2014 14:16:56 +0000 From: ga...@go... Subject: [Gambas-user] Issue 581 in gambas: Progressbar and mouse events are gone To: gam...@li... Message-ID: <0-6...@go...> Content-Type: text/plain; charset=UTF-8; format=flowed; delsp=yes Status: New Owner: ---- Labels: Version Type-Bug Priority-Medium OpSys-Any Dist-Any Arch-Any Desktop-Any GUI-Any New issue 581 by Kok...@gm...: Progressbar and mouse events are gone https://code.google.com/p/gambas/issues/detail?id=581 Progressbar doesn't raise mouse events anymore. It worked before gambas 3.6.x My system: [System] Gambas=3.6.1 OperatingSystem=Linux Kernel=3.17.3-1-ARCH Architecture=x86_64 Distribution=Arch Linux Desktop=KDE4 Theme=Oxygen Language=it_IT.utf8 Memory=3957M [Libraries] Cairo=libcairo.so.2.11400.0 Curl=libcurl.so.4.3.0 DBus=libdbus-1.so.3.8.7 GStreamer=libgstreamer-0.10.so.0.30.0 GStreamer=libgstreamer-1.0.so.0.404.0 GTK+3=libgtk-3.so.0.1400.5 GTK+=libgtk-x11-2.0.so.0.2400.25 OpenGL=libGL.so.1.2.0 Poppler=libpoppler.so.47.0.0 Qt4=libQtCore.so.4.8.6 SDL=libSDL-1.2.so.0.11.4 Test code: Public Sub ProgressBar1_MouseDown() Debug End Public Sub ProgressBar1_MouseDrag() Debug End -- You received this message because this project is configured to send all issue notifications to this address. You may adjust your notification preferences at: https://code.google.com/hosting/settings ------------------------------ Message: 6 Date: Wed, 19 Nov 2014 14:23:37 +0000 From: ga...@go... Subject: [Gambas-user] Issue 582 in gambas: ProgressBars are ugly To: gam...@li... Message-ID: <0-6...@go...> Content-Type: text/plain; charset=UTF-8; format=flowed; delsp=yes Status: New Owner: ---- Labels: Version-3.6.0 Type-Enhancement Priority-Medium OpSys-Any Dist-Any Arch-Any Desktop-Any GUI-Any New issue 582 by Kok...@gm...: ProgressBars are ugly https://code.google.com/p/gambas/issues/detail?id=582 Since gambas 3.6.x, the progressbars dont follow the widget style anymore. May i ask for a way to get them back by choice, please. -- You received this message because this project is configured to send all issue notifications to this address. You may adjust your notification preferences at: https://code.google.com/hosting/settings ------------------------------ ------------------------------------------------------------------------------ Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk ------------------------------ _______________________________________________ Gambas-user mailing list Gam...@li... https://lists.sourceforge.net/lists/listinfo/gambas-user End of Gambas-user Digest, Vol 102, Issue 40 ******************************************** |