Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.
Change Label properties
Is it possible to Set the properties "Set_Property(OLECtrlEntID, ???[Key],text)" of a label via the commuter module.
Would like to change text displayed on the ribbon after pressing a button.
Any advice would be grateful.
Chris
Would like to change text displayed on the ribbon after pressing a button.
Any advice would be grateful.
Chris
Comments
Set_Property(MyRibbonCtrl, "OLE.LabelText[MY_LABEL]", "Hello World!")
Is the format of the set_property correct? Should it not be:
Set_Property(MyRibbonCtrl, "OLE.LabelText[":@Window:";MY_LABEL":"]", "Hello World!")
I know it looks a little weird but while trying the new function this is the latest XML. Then OI updates the items in the combo box with some descriptions from a file for selection then update the display on the ribbon showing when the next schedule is to occur. This is a 2 stage process to keep the new scheduler processes all together:
OnComboSelChange: ControlKey = Param1 NewValue = Param2 Begin Case Case ControlKey[1,13] _Eqc "MDI2015_SCHED" ; MDI2015_Scheduler_Events(ControlKey) Case 1 If NewValue then * winlist = Kazm_Utility('WINDOWLIST', true$) winlist = Kazm_Utility('WINDOWLIST', False$) Locate NewValue in winlist<3> using @vm setting pos then FormKey = Winlist<1,pos> Void = Set_Property(Formkey,'VISIBLE',1) end end End Case Return
then in the MDI2015_Scheduler_Events routine:
DropDown_Task: Task = Get_Property(Ole_Ribbon$,"OLE.ComboText[":Ctrlentid:']') ShedKey = Field(Task,'|',2) NextDate = Oconv(Xlate('PBC_SCHEDULES',ShedKey,'SCHEDULE_DATE','X'),'D') Void = Set_Property(Ole_Ribbon$, "OLE.LabelText[MDI2015_SCHED*LBL_TEST]", "Hello World!") Void = Set_Property(Ole_Ribbon$, "OLE.LabelText[MDI2015_SCHED*DETAILS]", "Hello World!") debug Return
Will replace "Hello World" with the NextDate text once the ribbon is working.
BTW the routine seems to be going trough the debug twice.
Hope this helps.
Pasting the xml code does not appear in the previous response. Did you want me to send via email?
Chris
So far I can't explain your problem. The code looks correct as does the XML. I created a simple test on my end using your same Key values, and it worked. The only difference I can think of is that you are changing things during a Ribbon event. Perhaps that's a key, but I won't be able to test until later tonight because I am onsite at a client's. Perhaps the registration of the new OCX didn't take, or you accidentally registered an older version. Barring that, I'll need to do more investigation.
In the meantime, if you discover anything else that might help, let me know.