[Gambas-user] Gambas-user Digest, Vol 102, Issue 40
Sam Dadds
sammy_dadds at ...43...
Wed Nov 19 18:42:08 CET 2014
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, "gambas-user-request at ...1117...urceforge.net" <gambas-user-request at lists.sourceforge.net> wrote:
Send Gambas-user mailing list submissions to
gambas-user at lists.sourceforge.net
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
gambas-user-request at lists.sourceforge.net
You can reach the person managing the list at
gambas-user-owner at lists.sourceforge.net
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.
(gambas at ...2524...)
5. Issue 581 in gambas: Progressbar and mouse events are gone
(gambas at ...2524...)
6. Issue 582 in gambas: ProgressBars are ugly (gambas at ...2524...)
----------------------------------------------------------------------
Message: 1
Date: Wed, 19 Nov 2014 09:13:36 +0100
From: Rolf-Werner Eilert <eilert-sprachen at ...221...>
Subject: Re: [Gambas-user] How do I pass a user parameter from a
dialog form?
To: gambas-user at lists.sourceforge.net
Message-ID: <546C5130.5000607 at ...221...>
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 <gambas.fr at ...626...>
Subject: Re: [Gambas-user] How do I pass a user parameter from a
dialog form?
To: eilert-sprachen at ...221..., gambas-user at lists.sourceforge.net
Message-ID:
<CAFkCsL4XcqONPFv-Aq4XmkRdM9w=HxUxTu5n5PPWi4Az=B9YEQ at ...627...>
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" <eilert-sprachen at ...221...> 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
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
------------------------------
Message: 3
Date: Wed, 19 Nov 2014 11:01:11 +0100
From: Fabien Bodard <gambas.fr at ...626...>
Subject: Re: [Gambas-user] ComboBox UserContol, with pictures.
To: mailing list for gambas users <gambas-user at lists.sourceforge.net>
Message-ID:
<CAFkCsL6G6tzNqOFCAC176+0LzHFMpntdTraCzTLhuxo-AEwKEA at ...1107...627...>
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" <epost at ...3323...> 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
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
------------------------------
Message: 4
Date: Wed, 19 Nov 2014 14:11:02 +0000
From: gambas at ...2524...
Subject: [Gambas-user] Issue 580 in gambas: Menu bar background color
seems wrong.
To: gambas-user at lists.sourceforge.net
Message-ID:
<0-6813199134517018827-7815319398573939980-gambas=googlecode.com at ...2524...>
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 Kokok... at ...626...: 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: gambas at ...2524...
Subject: [Gambas-user] Issue 581 in gambas: Progressbar and mouse
events are gone
To: gambas-user at lists.sourceforge.net
Message-ID:
<0-6813199134517018827-14683283210564340637-gambas=googlecode.com at ...2524...>
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 Kokok... at ...626...: 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: gambas at ...2524...
Subject: [Gambas-user] Issue 582 in gambas: ProgressBars are ugly
To: gambas-user at lists.sourceforge.net
Message-ID:
<0-6813199134517018827-429741752051832921-gambas=googlecode.com at ...2524...>
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 Kokok... at ...626...: 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
Gambas-user at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user
End of Gambas-user Digest, Vol 102, Issue 40
********************************************
More information about the User
mailing list