December 05, 2019, 03:09:50 pm

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Dialog Window and Statusbar

Started by Brian, July 09, 2019, 12:34:12 pm

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Brian

Help! I have a Dialog window, and I am trying to place a Statusbar control. I "think" it is there, but it is not showing. Is there any particular way to code a Statusbar for a Dialog Window?

Brian

billhsln

July 09, 2019, 02:59:10 pm #1 Last Edit: July 10, 2019, 03:20:18 pm by billhsln
I got it to work in a Dialog under a Window.

Code Select
'About dialog
CREATEDIALOG dAbout,0,0,320,200,0x80C00080,0,"About Order Entry",&Handler_dAbout
 CONTROL dAbout,@STATIC,"Order Entry",0,5,320,20,@CTEDITCENTER,as1
 CONTROL dAbout,@STATIC,"Designed and written by B. K. Haesslein",0,30,320,14,@CTEDITCENTER,as2
 CONTROL dAbout,@STATIC,"and B. D. Pugh (West Yorkshire, England)",0,42,320,14,@CTEDITCENTER,as3
 CONTROL dAbout,@STATIC,"Version 1.0.0-May 2018",0,64,320,14,@CTEDITCENTER,as4
 CONTROL dAbout,@STATIC,"Written and compiled in IWBasic 3.05",0,85,320,14,@CTEDITCENTER,as5
 CONTROL dAbout,@STATIC,"© Copyright 2009, 2010 IonicWind Software",0,107,320,14,@CTEDITCENTER,as6
 CONTROL dAbout,@STATIC,"billhsln@airmail.net",105,132,110,14,@CTEDITCENTER,as7
 CONTROL dAbout,@SYSBUTTON,"OK",130,160,60,20,0x50010001,ab1
 CONTROL dAbout,@STATUS,"",0,0,0,0,0,abar

Code Select
SUB Handler_dAbout(),INT
SELECT @CLASS
 CASE @IDINITDIALOG
 CENTERWINDOW dAbout
 SETCONTROLCOLOR dAbout,as1,wMYRED,GetSysColor(15)
 SETFONT dAbout,oefont,12,700,0,as1
 SETCONTROLCOLOR dAbout,as2,wBLUE,GetSysColor(15)
 SETCONTROLCOLOR dAbout,as3,wBLUE,GetSysColor(15)
 SETCONTROLCOLOR dAbout,as7,wWHITE,wBLACK
 GETCLIENTSIZE dAbout,left,top,width,height
 panes=width-60,60,-1
 LoadBar(dAbout,abar,"CSB","About")
 CASE @IDCONTROL
 SELECT @CONTROLID
 CASE ab1
 IF @NOTIFYCODE=0
 CLOSEDIALOG dAbout,@IDOK
 ENDIF
 ENDSELECT
ENDSELECT
RETURN 0
ENDSUB

Code Select
SUB LoadBar(w:WINDOW,b:INT,t1:STRING,t2:STRING)
CONTROLCMD w,b,@SWSETPANES,3,panes
SENDMESSAGE w,SB_SETTEXTA,0,t1,b
SENDMESSAGE w,SB_SETICON,0,LOADIMAGE(105,@IMGICON),b
SENDMESSAGE w,SB_SETTEXTA,1,APPEND$("User: ",strUser," on ",strName),b
SENDMESSAGE w,SB_SETICON,1,LOADIMAGE(106,@IMGICON),b
SENDMESSAGE w,SB_SETTEXTA,2,t2,b
SENDMESSAGE w,SB_SETICON,2,LOADIMAGE(107,@IMGICON),b
RETURN
ENDSUB

Hope that helps.

Bill
When all else fails, get a bigger hammer.

Brian

Thanks, Bill - yes it did help. For some reason, having a menu item in the wrong place pushed down the window, covering the statusbar

Will either do without a menu, or rearrange the controls somewhat

Brian

billhsln

If it would not have been for you showing me the bar trick, I would have never known about it.  I think it is a neat trick.

Still don't understand how it has 0,0,0 for the origin, but ends up at the bottom of the window/dialog, but it is cool.  Also don't understand the panes work, had the dialog defined as 0,0,320,200, but the panes look better as panes=120,360,-1, which to me is bigger then the size of the box.

Bill
When all else fails, get a bigger hammer.

LarryMc

from the help file
---------------------------------------
CONTROLCMD window | dialog, ID, @SWRESIZE

Use this statement to inform the status window that the parent has been resized. A status window automatically sizes itself to the parent windows client area at the bottom of the window. The typical place to use this is in response to the @IDSIZE message in the parent window.

==================================================================================================

CONTROLCMD window | dialog, ID, @SWSETPANES, count, sizes[]

Sets the number of panes and the right edges of the panes.

count is the number of panes to create. sizes[] is an integer array, each element containing the pixel position of the right edge of the pane. If an element of the array is -1 then the corresponding pane extends to right edge of the client area.

=====================================================================================================

CONTROLCMD window | dialog, ID, @SWSETPANETEXT, pane, text$

Use this statement to change the pane text. If there is only one pane then SETCONTROLTEXT can also be used.

pane is the zero-based index of the pane to set.

LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library