When StatusBar and Bottom ToolBar

Moderator: Rathinagiri

Post Reply
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

When StatusBar and Bottom ToolBar

Post by Pablo César »

When is necessary to make two ToolBars (manually, because via IDE is not possible) one Top another Bottom and you increase a StatusBar: all ToolButtons (Bottom ones) are not displayed in the right size. In order words, the ToolBar Bottom is not calculating to be displayed upper than StatusBar. So, seems Statusbar is taking place part of ToolButtons (bottom) and can not be completly displayed.

This is a fmg file example:

Code: Select all

DEFINE WINDOW TEMPLATE AT 132 , 235 WIDTH 560 HEIGHT 400 VIRTUAL WIDTH Nil VIRTUAL HEIGHT Nil TITLE "Hello ToolBar!!!" ICON NIL MAIN CURSOR NIL ON INIT Nil ON RELEASE Nil ON INTERACTIVECLOSE Nil ON MOUSECLICK Nil ON MOUSEDRAG Nil ON MOUSEMOVE Nil ON SIZE Nil ON MAXIMIZE Nil ON MINIMIZE Nil ON PAINT Nil BACKCOLOR NIL NOTIFYICON NIL NOTIFYTOOLTIP NIL ON NOTIFYCLICK Nil ON GOTFOCUS Nil ON LOSTFOCUS Nil ON SCROLLUP Nil ON SCROLLDOWN Nil ON SCROLLLEFT Nil ON SCROLLRIGHT Nil ON HSCROLLBOX Nil ON VSCROLLBOX Nil

    DEFINE TOOLBAR ToolBar_1 BUTTONSIZE 85,85 FONT "Arial" SIZE 9 FLAT BORDER
        BUTTON button1 CAPTION "Button 1" PICTURE "button1.bmp" ACTION MsgInfo("1") TOOLTIP "ToolTip 1" GROUP
        BUTTON button2 CAPTION "Button 2" PICTURE "button2.bmp" ACTION MsgInfo("2") TOOLTIP "ToolTip 2"
        BUTTON button3 CAPTION "Button 3" PICTURE "button3.bmp" ACTION MsgInfo("3") TOOLTIP "ToolTip 3"
    END TOOLBAR
	
    DEFINE TOOLBAR ToolBar_2 BUTTONSIZE 160,80 FONT "Arial" SIZE 9 BOTTOM RIGHTTEXT BORDER
        BUTTON button4 CAPTION "Button 4" PICTURE "button1.bmp" ACTION MsgInfo("1") TOOLTIP "ToolTip 1" GROUP
        BUTTON button5 CAPTION "Button 5" PICTURE "button2.bmp" ACTION MsgInfo("2") TOOLTIP "ToolTip 2"
        BUTTON button6 CAPTION "Button 6" PICTURE "button3.bmp" ACTION MsgInfo("3") TOOLTIP "ToolTip 3"
    END TOOLBAR
	
	DEFINE STATUSBAR FONT "Arial" SIZE 9
        STATUSITEM "Item 1" ACTION MsgInfo("Item 1")
        STATUSITEM "Item 2" WIDTH 50
        CLOCK
        STATUSITEM "Item 3" WIDTH 100
    END STATUSBAR
   
    DEFINE FRAME Frame_1
        ROW    110
        COL    130
        WIDTH  250
        HEIGHT 110
        FONTNAME "Arial"
        FONTSIZE 9
        FONTBOLD .F.
        FONTITALIC .F.
        FONTUNDERLINE .F.
        FONTSTRIKEOUT .F.
        CAPTION "Note:"
        BACKCOLOR NIL
        FONTCOLOR NIL
        OPAQUE .T.
    END FRAME

    DEFINE LABEL Label_1
        ROW    160
        COL    170
        WIDTH  160
        HEIGHT 20
        VALUE "This Window Has a ToolBar!"
        FONTNAME "Arial"
        FONTSIZE 9
        TOOLTIP ""
        FONTBOLD .F.
        FONTITALIC .F.
        FONTUNDERLINE .F.
        FONTSTRIKEOUT .F.
        HELPID Nil
        VISIBLE .T.
        TRANSPARENT .F.
        ACTION Nil
        AUTOSIZE .F.
        BACKCOLOR NIL
        FONTCOLOR NIL
    END LABEL

END WINDOW
Please note captured screen:
Screen.PNG
Screen.PNG (18.64 KiB) Viewed 4525 times
This problem was related from a brazilian PCToledo forum
Attachments
Demo2.rar
Executable file
(851.32 KiB) Downloaded 279 times
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México

Re: When StatusBar and Bottom ToolBar

Post by Javier Tovar »

Si Pablo César,

Aquí pasa lo mismo!

Saludos
User avatar
Rathinagiri
Posts: 5480
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: When StatusBar and Bottom ToolBar

Post by Rathinagiri »

I will see how to solve this. I think Claudio can easily solve this.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

When StatusBar and Bottom ToolBar

Post by Pablo César »

Rathinagiri wrote:I will see how to solve this. I think Claudio can easily solve this.
I believe a new parameter with StatusBar height will be requested prior to call INITTOOLBAR at C function.

Thanks guys for your attention received.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
srvet_claudio
Posts: 2220
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: When StatusBar and Bottom ToolBar

Post by srvet_claudio »

Pablo César wrote:
Rathinagiri wrote:I will see how to solve this. I think Claudio can easily solve this.
I believe a new parameter with StatusBar height will be requested prior to call INITTOOLBAR at C function.

Thanks guys for your attention received.
I will check.
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
srvet_claudio
Posts: 2220
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: When StatusBar and Bottom ToolBar

Post by srvet_claudio »

srvet_claudio wrote:
Pablo César wrote:
Rathinagiri wrote:I will see how to solve this. I think Claudio can easily solve this.
I believe a new parameter with StatusBar height will be requested prior to call INITTOOLBAR at C function.

Thanks guys for your attention received.
I will check.
I fixed!
This problem is not a HMG bug, is a Windows system bug.
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

When StatusBar and Bottom ToolBar

Post by Pablo César »

Thank you Dr. Soto !
srvet_claudio wrote:This problem is not a HMG bug, is a Windows system bug
:shock:
You mean is an API bug ?
So, you must have offset this failure reading the height of the statusbar as I said, is not it ?

I just read this:
The toolbar default sizing and positioning behaviors can be turned off by setting the CCS_NORESIZE and CCS_NOPARENTALIGN common control styles. Toolbar controls that are hosted by rebar controls must set these styles because the rebar control sizes and positions the toolbar.
At http://msdn.microsoft.com/en-us/library ... s.85).aspx
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
srvet_claudio
Posts: 2220
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: When StatusBar and Bottom ToolBar

Post by srvet_claudio »

Pablo César wrote:Thank you Dr. Soto !
srvet_claudio wrote:This problem is not a HMG bug, is a Windows system bug
:shock:
You mean is an API bug ?
So, you must have offset this failure reading the height of the statusbar as I said, is not it ?

I just read this:
The toolbar default sizing and positioning behaviors can be turned off by setting the CCS_NORESIZE and CCS_NOPARENTALIGN common control styles. Toolbar controls that are hosted by rebar controls must set these styles because the rebar control sizes and positions the toolbar.
At http://msdn.microsoft.com/en-us/library ... s.85).aspx
Windows always overlaps the StatusBar and the Bottom ToolBar.
The trick is: when Windows begin to draw the Bottom ToolBar first I move it to up.
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

When StatusBar and Bottom ToolBar

Post by Pablo César »

srvet_claudio wrote:Windows always overlaps the StatusBar and the Bottom ToolBar.
The trick is: when Windows begin to draw the Bottom ToolBar first I move it to up.
Yeap
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

When StatusBar and Bottom ToolBar

Post by Pablo César »

Thank you Claudio, now is working perfectly, even if you amke StatusBar after sequence of ToolButtons.
Screen.PNG
Screen.PNG (15.46 KiB) Viewed 4291 times
PERFECTO !
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Post Reply