How to update DCTOOLBAR at runtime

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
jdsoft
Posts: 116
Joined: Thu Jan 28, 2010 1:13 pm
Location: Overberg
Contact:

How to update DCTOOLBAR at runtime

#1 Post by jdsoft »

Hello,
My main app window has a tool bar.

Code: Select all

LOCAL nBtnSize := 40
LOCAL nBtwSpace := 1
LOCAL oStatTop := nil
LOCAL oTool := nil
DCSTATUSBAR oStatTop WIDTH nBtnSize HEIGHT nBtnSize ALIGN DCGUI_ALIGN_TOP TYPE XBPSTATIC_TYPE_TEXT EVAL  {|o|o:SetColorBg(GRA_CLR_WHITE),o:SetColorFg(GRA_CLR_WHITE)}
@ 0,0   DCTOOLBAR oTool ALIGN TOOLBAR_TOP PIXEL BUTTONSIZE nBtnSize,nBtnSize SIZE (((nBtnSize + nBtnSpace) * 14)),nBtnSize FANCY EVAL {|o|o:SetColorBg(GRA_CLR_WHITE),o:SetColorFg(GRA_CLR_WHITE)} PARENT oStatTop
DCSETPARENT TO oTool
DCADDBUTTON TYPE    XBPSTATIC_TYPE_TEXT       SIZE nBtnSpace,nBtnSize
DCADDBUTTON CAPTION ICON_ABC_ADM              ACTION {|| _StartBlock({||ReStartAdmin()})}    TOOLTIP  'Een andere administratie openen'
DCADDBUTTON CAPTION ICON_BROWSE               ACTION {|| _StartBlock({||Browse_Data()})}     TOOLTIP  'Bekijken data'
DCADDBUTTON CAPTION ICON_INBOEKEN_ING      ACTION {|| _StartBlock({||Start_Inboeken_Ing()})} TOOLTIP  'Inboeken ING'
DCADDBUTTON CAPTION ICON_INBOEKEN_RABO    ACTION {|| _StartBlock({||Start_Inboeken_Rabo()})} TOOLTIP  'Inboeken Rabo'
etc.
Now, at runtime i would like to rebuild the toolbar buttons, without destroying the getlist on my main window.
- Removing buttons from the toolbar
- Adding buttons to the toolbar
How can i do this?
Regards,
Jack Duijf
Regards,
Jack Duijf

User avatar
rdonnay
Site Admin
Posts: 4772
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: How to update DCTOOLBAR at runtime

#2 Post by rdonnay »

Jack -

Look at the \exp19\samples\shortcuts\shortcuts.prg sample program.

This lets you drop buttons onto a toolbar.

Roger
The eXpress train is coming - and it has more cars.

Post Reply