How to freeze button on DCSTATUSBAR

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

How to freeze button on DCSTATUSBAR

#1 Post by jdsoft »

Hello

There is an vertical status bar.

Code: Select all

DCSTATUSBAR oStat WIDTH 200 ALIGN DCGUI_ALIGN_LEFT ;
      TYPE XBPSTATIC_TYPE_TEXT;  
      EVAL {|o|o:setColorBG(GRA_CLR_WHITE} PARENT oDlg ;
Now I want a button that is anchord (position {5,5}) to the left-bottom of the statusbar.
It should remain always visible also when main dialog (and statusbar) are resized.

How can I do this ?

Regards,
Jack Duijf

User avatar
jdsoft
Posts: 113
Joined: Thu Jan 28, 2010 1:13 pm
Location: Overberg
Contact:

Re: How to freeze button on DCSTATUSBAR

#2 Post by jdsoft »

Already found out.

Using the SUBCLASS directive

Code: Select all

DCSTATUSBAR oStat WIDTH TB_BAR_WIDTH ALIGN DCGUI_ALIGN_LEFT ;
      TYPE XBPSTATIC_TYPE_TEXT;
      PARENT oDlg ;
      SUBCLASS "SN_STATUSBAR()"
Then add a button and store the Dc_XbpPushbutton object is a getset function FullScreenButton()

Code: Select all

@ nPos,  10 DCPUSHBUTTON CAPTION ICON_FULLSCREEN SIZE 30,30 PIXEL ACTION {||Toggle_FullScreen()} PARENT oStat EVAL {|o|FullScreenButton(o)} WHEN {||TRUE} FANCY
Whenever the dialog and toolbar is resized, the button fixed to the bottom of the toolbar.

Code: Select all

CLASS SN_STATUSBAR FROM  DC_XbpStatusBar
EXPORTED
METHOD      Create
METHOD      ShowButton
ENDCLASS

METHOD SN_STATUSBAR:Create( oParent, oOwner, aPos, aSize, aPres, lVisible )
LOCAL bResize        := nil
::DC_XbpStatusBar:Create( oParent, oOwner, aPos, aSize, aPres, lVisible )
bResize              := ::Resize
If ValType(::Resize) = "B"
   ::Resize          := {||Eval(bResize),::ShowButton()}
Else
   ::Resize          := {||::Showbutton()}
Endif
Return SELF

METHOD  SN_STATUSBAR:ShowButton()
LOCAL oButton        := FullScreenButton()
If ValType(oButton) = "O"
   oButton:SetPos({5,5})
Endif
Return
Regards,
Jack Duijf

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

Re: How to freeze button on DCSTATUSBAR

#3 Post by rdonnay »

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

Post Reply