Page 2 of 2

Re: Partial clear screen

Posted: Fri Apr 06, 2018 11:08 am
by asharpham
Thanks Rathinagiri. Before sending the entire code I'll show you where this is called from. If you can't work it out from here, I'm happy to zip up the entire code and files.

The code calling the procedure is:
DEFINE TOOLBAR ToolBar_2 BUTTONSIZE 150,35 FLAT BORDER BOTTOM

BUTTON SEARCH ;
CAPTION '&Search' ;
PICTURE 'IconSearch.bmp' ;
ACTION { SeekText() , Library_1.Seek1.SetFocus , Refresh() }


This is followed by:
PROCEDURE SeekText

IF IsControlDefined ( 'LABEL_Search' , 'Library_1' )
DoMethod ( 'Library_1' , 'LABEL_Search' , 'Release' )
ENDIF

IF IsControlDefined ( 'Seek1' , 'Library_1' )
DoMethod ( 'Library_1' , 'Seek1' , 'Release' )
ENDIF

IF IsControlDefined ( 'SeekButton' , 'Library_1' )
DoMethod ( 'Library_1' , 'SeekButton' , 'Release' )
ENDIF

IF IsControlDefined ( 'Quit' , 'Library_1' )
DoMethod ( 'Library_1' , 'Quit' , 'Release' )
ENDIF

DEFINE BUTTON SeekButton
PARENT Library_1
ROW 400
COL 200
WIDTH 100
HEIGHT 50
PICTURE 'IconSearch.bmp'
ONCLICK { Library_1.Seek1.SetFocus , SeekRecord() }
END BUTTON

DEFINE BUTTON QuitSearch
PARENT Library_1
ROW 400
COL 300
WIDTH 100
HEIGHT 50
PICTURE 'IconExit.bmp'
ONCLICK { 'HideButtons()' , 'RETURN' }
END BUTTON

DEFINE LABEL LABEL_Search
PARENT Library_1
ROW 350
COL 130
VALUE 'Track Title:'
FONTBOLD .T.
END LABEL

@ 350,250 Textbox Seek1 ;
PARENT Library_1 ;
WIDTH 200

RETURN


And then:
PROCEDURE HideButtons

Library_1.SeekButton.Visible := .F.
Library_1.QuitSearch.Visible := .F.
Library_1.Seek1.Release

RETURN


While you're looking at this code, perhaps I can ask you a question I've posted elsewhere becaue it relates to this code as well. Is it possible to centre the text under the image in the Toolbar button? At present the text is lower and right of the icon.

Regards,
Alan

Re: Partial clear screen

Posted: Fri Apr 06, 2018 1:59 pm
by Rathinagiri

Code: Select all


ONCLICK { 'HideButtons()' , 'RETURN' }

By this code, you are passing only an array and not procedure.

You have to enter like this.

Code: Select all

onclick HideButtons()
'Return' is not required.

Re: Partial clear screen

Posted: Fri Apr 06, 2018 2:53 pm
by Rathinagiri
I request you to go through this topic also.

viewtopic.php?f=6&t=3905

Re: Partial clear screen

Posted: Sat Apr 07, 2018 4:47 am
by asharpham
This has been very informative, Rathingiri. Thank you again.

Re: Partial clear screen

Posted: Sat Jan 19, 2019 11:19 am
by tonton2
Bonjour tout le monde ,
je ne sais pas pourquoi la fonction "VISIBLE" ne fonctionne pas dans cet exemple ,alors que la fonction "ENABLED" fonctionne normallement.
merci beaucoup pour votre aide
traduction google
Hello everyone ,
I do not know why the "VISIBLE" function does not work in this example, while the "ENABLED" function works normally.
thank's all