![]() |
Value changed of combo box |
Post Reply ![]() |
Author | |
torbenjc ![]() Newbie ![]() ![]() Joined: 01 April 2008 Location: Denmark Status: Offline Points: 4 |
![]() ![]() ![]() ![]() ![]() Posted: 01 April 2008 at 8:42am |
Hi,
how to catch that the value has been changed of a combo box in commandbar?
If it is the ControlNotify which codes to look for?
Because of problems with timer ActiveX we have set the update period to 24 hours, so that event won't work!
Regards,
Torben
|
|
![]() |
|
Aaron ![]() Senior Member ![]() Joined: 29 January 2008 Status: Offline Points: 2192 |
![]() ![]() ![]() ![]() ![]() |
Hi,
You can use the CommandBars UpdateEvent.
Private Sub CommandBars_Update(ByVal Control As XtremeCommandBars.ICommandBarControl)
Select Case Control.Id Case ....
Do something...
End Select
End Sub
This event fires when something is clicked, expanded, collapsed (you name it) with CommandBars.
If you want no automatic updates set: Commandbars.Options.UpdatePeriod = 0
|
|
![]() |
|
torbenjc ![]() Newbie ![]() ![]() Joined: 01 April 2008 Location: Denmark Status: Offline Points: 4 |
![]() ![]() ![]() ![]() ![]() |
Hi,
the update don't work for me! Only fires when the control is added, not when its value is changed.
Have added messags to ControlNotify and found the following for Code:
Toglebox close/leave: 8
Text leave: 512
But now I'm having problem setting combobox control values from within this code using Listindex.
|
|
![]() |
|
Aaron ![]() Senior Member ![]() Joined: 29 January 2008 Status: Offline Points: 2192 |
![]() ![]() ![]() ![]() ![]() |
Hi,
And again you can use the Update event.
Private Sub CommandBars_Update(ByVal Control As XtremeCommandBars.ICommandBarControl)
Select Case Control.Id
Case <Your ID for the combobox comes here>
msgbox Control.ListIndex
End Select
End Sub
|
|
![]() |
|
torbenjc ![]() Newbie ![]() ![]() Joined: 01 April 2008 Location: Denmark Status: Offline Points: 4 |
![]() ![]() ![]() ![]() ![]() |
Hi, /* Create of controls */ chQFilterItem = chQFilterBar:Controls:Add({&xtpControlComboBox}, add-id("QOPER":U, "TOOL":U), "Filter operator":T40). chQFilterItem = chQFilterBar:Controls:Add({&xtpControlEdit}, add-id("QMATCH":U, "TOOL":U), "Filter match information":T40). /* Notify of value changes in controls */ PROCEDURE GetSetQuickFilter PRIVATE: FOR FIRST bmopt WHERE bmopt.cAction = "QMATCH":U AND bmopt.main-type = "QFILTER":U NO-LOCK: |
|
![]() |
|
Aaron ![]() Senior Member ![]() Joined: 29 January 2008 Status: Offline Points: 2192 |
![]() ![]() ![]() ![]() ![]() |
Hi,
I do not understand how your code works (and I thought I have seen them all
![]() PROCEDURE CbfFrame.commandbarsframe.Update:
DEFINE INPUT PARAMETER chSelf AS COM-HANDLE NO-UNDO. DEFINE INPUT PARAMETER iCode AS INTEGER NO-UNDO. DEFINE INPUT PARAMETER h1 AS HANDLE NO-UNDO. DEFINE OUTPUT PARAMETER lHandled AS LOGICAL NO-UNDO. CASE get-id(chSelf:ID): WHEN chSelf == "QFIELD":U THEN ????? compare the ID with the control given ID
chSelf.listindex (this will be the index of selected item)
chSelf.text (this will be the value of selected item)
END CASE.
END PROCEDURE. If this doesn't work (or if isn't possible) you better ask someone who is more experienced in your language.
|
|
![]() |
|
torbenjc ![]() Newbie ![]() ![]() Joined: 01 April 2008 Location: Denmark Status: Offline Points: 4 |
![]() ![]() ![]() ![]() ![]() |
Thank you
![]() |
|
![]() |
|
Aaron ![]() Senior Member ![]() Joined: 29 January 2008 Status: Offline Points: 2192 |
![]() ![]() ![]() ![]() ![]() |
Hi, Good for you. Now I can say I helped someone with OpenEdge
![]() |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |