Guidance
指路人
g.yi.org
software / rapidq / examples / gui / Button / BMP Button / BMPBTTN.RQB

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
'-- A BMP button example
'
' It uses two different .BMPs
' Each containing 3 images
' side-by-side horizontally
'
' Probably not the best example,
' but hey; I'm still learnin'
' TronDoc // Joe B.

     DECLARE SUB Button1Clicked
     DECLARE SUB Button2Clicked
     DECLARE SUB Button3Clicked
     DECLARE SUB Button4Clicked

     CRLF$	= CHR$(13)+CHR$(10)	'Define CarrigeReturnLineFeed
     TRUE	= 1					'Define TRUE
     FALSE	= 0					'Define FALSE

     DIM Form AS QFORM
     Form.CAPTION	= "Tron Doc's Hacks!"
     Form.Width	= 350
     Form.Height	= 60
     Form.Center

     ButtonTop   = 0					'Set up some stuff to
     ButtonWidth = 75				'make using buttons
     ButtonSpace = ButtonWidth + 5	'easier...

     DIM Button1 AS QBUTTON
     Button1.NumBMPs		= 3			'Quantity of side-by-side
								'images in the .BMP
     Button1.BMP 		= "BMPBTTN1.BMP"	'TDH logos
     Button1.PARENT		= Form
     Button1.Left		= 13
     Button1.Top			= ButtonTop
     Button1.Width		= ButtonWidth
     Button1.CAPTION		= "BMPB&1"
     Button1.ShowHint	= True
     Button1.Hint		= "Buttons #3 & #4"+CRLF$+"are disabled!"
'Do something if button clicked...
     Button1.OnClick	= Button1Clicked


     DIM Button2 AS QBUTTON
     Button2.NumBMPs		= 3
     Button2.BMP 		= "BMPBTTN2.BMP"	'Smileys
     Button2.PARENT		= Form
     Button2.Left		= Button1.Left + ButtonSpace
     Button2.Top			= ButtonTop
     Button2.Width		= ButtonWidth
     Button2.CAPTION		= "BMPB&2"
     Button2.ShowHint	= True
     Button2.Hint		= ":)"
'Do something if button clicked...
     Button2.OnClick	= Button2Clicked


     DIM Button3 AS QBUTTON
     Button3.NumBMPs		= 3
     Button3.BMP 		= "BMPBTTN1.BMP"	'TDH logos
     Button3.PARENT		= Form
     Button3.Left		= Button2.Left + ButtonSpace
     Button3.Top			= ButtonTop
     Button3.Width		= ButtonWidth
     Button3.Enabled		= False				'Here is where the
										'button is disabled!
     Button3.CAPTION		= "BMPB&3"
     Button3.ShowHint	= True
     Button3.Hint		= "Button #3"+CRLF$+"is disabled!"
'Do something if button clicked...
     Button3.OnClick	= Button3Clicked

     DIM Button4 AS QBUTTON
     Button4.NumBMPs		= 3
     Button4.BMP 		= "BMPBTTN2.BMP"	'Smileys
     Button4.PARENT		= Form
     Button4.Left		= Button3.Left + ButtonSpace
     Button4.Top			= ButtonTop
     Button4.Width		= ButtonWidth
     Button4.Enabled		= False				'Here is where the
										'button is disabled!
     Button4.CAPTION		= "BMPB&4"
     Button4.ShowHint	= True
     Button4.Hint		= "Button #4"+CRLF$+"is disabled!"
'Do something if button clicked...
     Button4.OnClick	= Button4Clicked

     SUB Button1Clicked
      SHOWMESSAGE "You Clicked"+CRLF$+"Button #1"
     END SUB

     SUB Button2Clicked
      SHOWMESSAGE "You Clicked"+CRLF$+"Button #2"
     END SUB

     SUB Button3Clicked
      SHOWMESSAGE "You Clicked"+CRLF$+"Button #3"
     END SUB

     SUB Button4Clicked
      SHOWMESSAGE "You Clicked"+CRLF$+"Button #4"
     END SUB

     Form.SHOWMODAL




掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Sun 2024-4-28  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2013-06-19 07:54:22