FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour oButton:hide() & oButton:show()
Posts: 445
Joined: Thu Feb 21, 2008 11:58 AM
oButton:hide() & oButton:show()
Posted: Wed Nov 12, 2008 06:24 PM
Antonio and friends,

Why the methods :hide() & :show() not works?
I had to use the following way:
oDlg:bPainted := {|| showWindow( oButton:hWnd, 0 ) }


Why?
Peace and lighting!

Júlio César M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
oButton:hide() & oButton:show()
Posted: Wed Nov 12, 2008 07:03 PM
Hello JC,

You have to use the Button-object
oBtn:Show(), oBtn:Hide()
A sample to Hide a Button inside a buttonbar to get a space
between buttons.

DEFINE WINDOW oWnd TITLE "Test"  MDI MENU TMenu():New() 

DEFINE BUTTONBAR oBar OF oWnd SIZE 80, 80 2007 RIGHT 

oBar:bClrGrad :=  { | lInvert | If( ! lInvert, ;
{ { 0.90,11892819,16777215 },{ 0.90,16777215,11892819 } },;
{ { 0.50,128,16777215 }, { 0.50,16777215,128 } } ) }

oBar:nClrText := 0

DEFINE BUTTON oBtn50 OF oBar ACTION Test1() ;
RESOURCE "magic" PROMPT "Project" + CRLF + "Selection" TOOLTIP "Bar-Select"

DEFINE BUTTON oBtn51 OF oBar ACTION Test2() ;
RESOURCE "open" PROMPT "Open" + CRLF + "Project" TOOLTIP "Open Project"

DEFINE BUTTON oBtn52 OF oBar ACTION Test3() ;
RESOURCE "floppy" PROMPT "Save" + CRLF + "Project" TOOLTIP "Save Project"

DEFINE BUTTON oBtn53 OF oBar ACTION Test4() ;
RESOURCE "magic" PROMPT "Create" + CRLF + "EXE-File" TOOLTIP "New EXE-File"

DEFINE BUTTON oBtn54 OF oBar ACTION Test5() ;
RESOURCE "info2" PROMPT "Change" + CRLF + "FWH-Version" TOOLTIP "Change FWH-Version"

// This button is HIDE for a space between last button and exit !!!
// ------------------------------------------------------------------------
DEFINE BUTTON oBtn55 OF oBar ACTION NIL;
RESOURCE "calendar" 

oBtn55:Hide()

DEFINE BUTTON oBtn56 OF oBar ACTION oWnd:End() ;
RESOURCE "quit" PROMPT "Exit" TOOLTIP "Close Bar-Gradient"

SET MESSAGE OF oWnd TO "Testing the ButtonBar 2007 Office look" ;
CENTERED CLOCK KEYBOARD 2007

ACTIVATE WINDOW oWnd MAXIMIZED ;
ON PAINT gradpaint0( hDC, oWnd ) ;
VALID MsgYesNo( "Do you want to end?" )

RETURN NIL


Regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.

Continue the discussion