hmg-svncommit Mailing List for HMG
Brought to you by:
roblez
You can subscribe to this list here.
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(44) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2012 |
Jan
(7) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Dicosmo G. <dic...@be...> - 2016-02-24 22:56:59
|
Greetings, I created a sales program using, CA Clipper version 5.2 back in 1994. I need to make it work on Windows 7. I was sighted then and blind today. I use Windows 7 and a screen reader. Best Regards. |
From: Dicosmo G. <dic...@be...> - 2016-02-16 22:38:32
|
Hello, I’m a new member. I have software project that was created in DOS using CA Clipper version 5.2 I will need your help to get this software running on a Windows 7 computer. Thank you. |
From: <ri...@us...> - 2012-01-10 09:34:23
|
Revision: 890 http://hmg.svn.sourceforge.net/hmg/?rev=890&view=rev Author: ricciz Date: 2012-01-10 09:34:11 +0000 (Tue, 10 Jan 2012) Log Message: ----------- Modified Paths: -------------- Changelog samples/numgetc/demo_1.prg source/dateget.prg source/numgetc.prg Modified: Changelog =================================================================== --- Changelog 2012-01-10 07:59:30 UTC (rev 889) +++ Changelog 2012-01-10 09:34:11 UTC (rev 890) @@ -17,6 +17,16 @@ */ 2012-01-10 09:00 UTC+0100 Ricci Zepmeusel ( ricci at conzoft.de ) + * source/numgetc.prg + ! READONLY now use Qt :setReadOnly instead of :disabled, + because NUMGETC is based on LABEL text can\xB4t be copied, + in readonly mode the background is transparent as in HMG3 + * source/dateget.prg + ! READONLY now use Qt :setReadOnly instead of :disabled, + the text can be marked and copied as in HMG3, + in readonly mode the background is transparent as in HMG3 + +2012-01-10 09:00 UTC+0100 Ricci Zepmeusel ( ricci at conzoft.de ) * source/textbox.prg * source/editbox.prg ! READONLY now use Qt :setReadOnly instead of :disabled, Modified: samples/numgetc/demo_1.prg =================================================================== --- samples/numgetc/demo_1.prg 2012-01-10 07:59:30 UTC (rev 889) +++ samples/numgetc/demo_1.prg 2012-01-10 09:34:11 UTC (rev 890) @@ -20,7 +20,7 @@ HEIGHT 400 FONT "ARIAL"; SIZE 09 TITLE "Calculator NUMGET control" - ONINIT { || ( oWindow:Center() ) } + ONINIT { || oWindow:Center() } DEFINE LABEL oLabel1; ROW 20; COL 10; WIDTH 400; HEIGHT 20; VALUE "US format, 2 decimals, no thousands delimiter"; TABSTOP .F.; END LABEL @@ -72,6 +72,21 @@ ONENTER { || MsgInfo( hb_ValToExp( oWindow:oNumGet4:Value ) ) } END NUMGETC + DEFINE LABEL oLabel5; ROW 180; COL 10; WIDTH 400; HEIGHT 20; VALUE "Readonly"; TABSTOP .F.; END LABEL + + DEFINE NUMGETC oNumGet5 + ROW 180 + COL 420 + WIDTH 160 + HEIGHT 20 + FORMAT "," + THOUSANDS .T. + DECIMALS 2 + READONLY .T. + VALUE 12345.67 + + END NUMGETC + END WINDOW oWindow:Activate() Modified: source/dateget.prg =================================================================== --- source/dateget.prg 2012-01-10 07:59:30 UTC (rev 889) +++ source/dateget.prg 2012-01-10 09:34:11 UTC (rev 890) @@ -61,6 +61,7 @@ DATA cClass INIT "DATEGET" // data: please preserve alphabetic order. + DATA oColor INIT NIL PROTECTED DATA cLastValue INIT "" PROTECTED // Methods: please preserve alphabetic order. Methods "New" and "Create" must be the first if present @@ -72,6 +73,7 @@ METHOD Alignment SETGET METHOD CaretPos SETGET METHOD OnEnter SETGET + METHOD ReadOnly SETGET METHOD PassWord SETGET METHOD Value SETGET @@ -116,6 +118,8 @@ ..............................................................................*/ METHOD Create() CLASS DATEGET + LOCAL oPalette + ::lCreated := .T. ::CreatePendingChildControls() // Create inner controls @@ -128,6 +132,9 @@ ::oQtObject:show() ENDIF + oPalette := ::oQtObject:palette() + ::oColor := oPalette:Color( QPalette_Base ) + RETURN Self /*.............................................................................. @@ -135,7 +142,7 @@ ..............................................................................*/ METHOD InputMask( ) CLASS DATEGET - LOCAL cDateFormat := set( _SET_DATEFORMAT ) + LOCAL cDateFormat := LOWER( set( _SET_DATEFORMAT ) ) cDateFormat := STRTRAN( cDateFormat, "dd", "09" ) cDateFormat := STRTRAN( cDateFormat, "mm", "09" ) @@ -208,6 +215,22 @@ RETURN ::oQTObject:echoMode /*.............................................................................. + ReadOnly +..............................................................................*/ +METHOD ReadOnly( lValue ) CLASS DATEGET + + LOCAL oPalette := ::oQTObject:palette() + + IF PCOUNT() == 1 .AND. hb_IsLogical( lValue ) + ::oQTObject:setReadOnly ( lValue ) + + oPalette:setColor( QPalette_Base, IF( lValue, QColor( 0, 0, 0, 0 ), ::oColor ) ) + ::oQTObject:setPalette( oPalette ) + ENDIF + +RETURN ::oQTObject:isReadOnly() + +/*.............................................................................. Value ..............................................................................*/ METHOD Value( dValue ) CLASS DATEGET @@ -277,16 +300,13 @@ ..............................................................................*/ METHOD __HmgOnGotFocusExec( oQtEvent ) CLASS DATEGET - LOCAL oQtReason := oQtEvent:reason() + HB_SYMBOL_UNUSED( oQtEvent ) - HB_SYMBOL_UNUSED( oQtReason ) - IF hb_IsObject( ::oParent ) HMGAPP():ThisWin( ::FindValidParent(1) ) // try to update current window if found it ::s_oCurWidget := ::oParent:ChildGet( ::cName ) ENDIF -// ::CaretPos( 0 ) ::cLastValue := ::Value() IF hb_isBlock( ::bOnGotFocus ) Modified: source/numgetc.prg =================================================================== --- source/numgetc.prg 2012-01-10 07:59:30 UTC (rev 889) +++ source/numgetc.prg 2012-01-10 09:34:11 UTC (rev 890) @@ -51,10 +51,12 @@ DATA cClass INIT "NUMGETC" // data: please preserve alphabetic order. + DATA oColor INIT NIL PROTECTED DATA nDecimals INIT 2 PROTECTED DATA cDecimalPoint INIT "A" PROTECTED DATA lIsNegativ INIT .F. PROTECTED DATA oImage INIT NIL PROTECTED // Label which display the arrow + DATA lReadonly INIT .F. PROTECTED DATA lThousands INIT .F. PROTECTED DATA cValue INIT "" PROTECTED DATA nValue INIT 0 PROTECTED @@ -73,6 +75,7 @@ METHOD Decimals SETGET METHOD Format SETGET METHOD OnEnter SETGET + METHOD ReadOnly SETGET METHOD Thousands SETGET METHOD Value SETGET METHOD Visible SETGET @@ -101,7 +104,7 @@ ::oQtObject:setFocusPolicy( Qt_StrongFocus ) ::oQtObject:setAutoFillBackground( .T. ) - // create button for calendar + // create button for active state ::oImage := QLabel( ::oParent:QtParent ) @@ -129,8 +132,11 @@ oPalette:SetColor( QPalette_Window, oPalette2:Color( 0, QPalette_Base ) ) oPalette:SetColor( QPalette_WindowText, oPalette2:Color( 0, QPalette_WindowText ) ) oPalette:SetColor( QPalette_Text, oPalette2:Color( 0, QPalette_Text ) ) + + ::oColor := oPalette:Color( QPalette_Window ) // for readonly state + oPalette:SetColor( QPalette_Window, IF( ::lReadOnly, QColor( 0, 0, 0, 0 ), ::oColor ) ) ::oQTObject:setpalette( oPalette ) - + // Create inner controls ::CreatePendingChildControls() @@ -176,7 +182,7 @@ ::oQtObject:setText( IF( ::lIsNegativ, "-", "" ) + ALLTRIM( TRANSFORM( ::nValue, cMask ) ) ) - ::oImage:setVisible( ::oQtObject:hasFocus() ) + ::oImage:setVisible( ::oQtObject:hasFocus() .AND. ! ::lReadOnly ) RETURN NIL @@ -207,6 +213,10 @@ LOCAL lReturn := .T. LOCAL nDecimalPos := AT( ".", ::cValue) + IF ::lReadOnly + RETURN .F. + ENDIF + IF nKey == ASC( "-" ) ::lIsNegativ := ! ::lIsNegativ @@ -286,6 +296,22 @@ RETURN NIL /*.............................................................................. + ReadOnly +..............................................................................*/ +METHOD ReadOnly( lValue ) CLASS NUMGETC + + LOCAL oPalette := ::oQTObject:palette() + + IF PCOUNT() == 1 .AND. hb_IsLogical( lValue ) + ::lReadOnly := lValue + + oPalette:setColor( QPalette_Window, IF( lValue, QColor( 0, 0, 0, 0 ), ::oColor ) ) + ::oQTObject:setPalette( oPalette ) + ENDIF + +RETURN ::lReadOnly + +/*.............................................................................. Thousands ..............................................................................*/ METHOD Thousands( lValue ) CLASS NUMGETC This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ri...@us...> - 2012-01-10 07:59:36
|
Revision: 889 http://hmg.svn.sourceforge.net/hmg/?rev=889&view=rev Author: ricciz Date: 2012-01-10 07:59:30 +0000 (Tue, 10 Jan 2012) Log Message: ----------- Modified Paths: -------------- Changelog source/editbox.prg source/textbox.prg source/textboxsimple.prg Modified: Changelog =================================================================== --- Changelog 2012-01-09 08:25:58 UTC (rev 888) +++ Changelog 2012-01-10 07:59:30 UTC (rev 889) @@ -16,6 +16,13 @@ The license applies to all entries newer than 2009-04-28. */ +2012-01-10 09:00 UTC+0100 Ricci Zepmeusel ( ricci at conzoft.de ) + * source/textbox.prg + * source/editbox.prg + ! READONLY now use Qt :setReadOnly instead of :disabled, + the text can be marked and copied as in HMG3, + in readonly mode the background is transparent as in HMG3 + 2012-01-09 09:30 UTC+0100 Ricci Zepmeusel ( ricci at conzoft.de ) * include/hmg.ch + CARGO <xValue> command as a oneliner while object definition Modified: source/editbox.prg =================================================================== --- source/editbox.prg 2012-01-09 08:25:58 UTC (rev 888) +++ source/editbox.prg 2012-01-10 07:59:30 UTC (rev 889) @@ -45,14 +45,17 @@ DATA cClass INIT "EDITBOX" // data: please preserve alphabetic order. + DATA oColor INIT NIL PROTECTED DATA cValue INIT '' PROTECTED // Methods: please preserve alphabetic order. Methods "New" and "Create" must be the first if present METHOD New + METHOD Create // Properties & Events: please preserve alphabetic order. METHOD MaxLength SETGET // Not directly supported by QT -> Pending METHOD OnChange SETGET + METHOD ReadOnly SETGET METHOD ScrollBars SETGET METHOD Value SETGET @@ -80,6 +83,29 @@ RETURN Self +/*.............................................................................. + Create +..............................................................................*/ +METHOD Create() CLASS EDITBOX + + LOCAL oPalette + + ::lCreated := .T. + + ::CreatePendingChildControls() // Create inner controls + + ::__HmgConnectEv() + + IF ::Visible() + ::oQtObject:show() + ENDIF + + oPalette := ::oQtObject:palette() + ::oColor := oPalette:Color( QPalette_Base ) + +RETURN Self + + /*-------------------------------Properties & Events--------------------------*/ /*.............................................................................. @@ -94,6 +120,22 @@ RETURN NIL /*.............................................................................. + ReadOnly +..............................................................................*/ +METHOD ReadOnly( lValue ) CLASS EDITBOX + + LOCAL oPalette := ::oQTObject:palette() + + IF PCOUNT() == 1 .AND. hb_IsLogical( lValue ) + ::oQTObject:setReadOnly ( lValue ) + + oPalette:setColor( QPalette_Base, IF( lValue, QColor( 0, 0, 0, 0 ), ::oColor ) ) + ::oQTObject:setPalette( oPalette ) + ENDIF + +RETURN ::oQTObject:isReadOnly() + +/*.............................................................................. Value ..............................................................................*/ METHOD Value( cValue ) CLASS EDITBOX Modified: source/textbox.prg =================================================================== --- source/textbox.prg 2012-01-09 08:25:58 UTC (rev 888) +++ source/textbox.prg 2012-01-10 07:59:30 UTC (rev 889) @@ -98,6 +98,7 @@ // data: please preserve alphabetic order. DATA nAlignment INIT TXT_LEFT PROTECTED DATA nCaseConvert INIT TXT_NONE PROTECTED + DATA oColor INIT NIL PROTECTED DATA nDataType INIT NIL PROTECTED DATA cDecPoint INIT "." PROTECTED // by default USA format DATA cFormat INIT "" PROTECTED // by default USA format ELSE European @@ -132,6 +133,7 @@ METHOD OnEnter SETGET METHOD OnValid SETGET METHOD PassWord SETGET + METHOD ReadOnly SETGET METHOD Validator SETGET METHOD Value SETGET @@ -199,6 +201,7 @@ METHOD Create() CLASS TEXTBOX LOCAL cStyleSheet, lChanged := .F. + LOCAL oPalette IF ::lCreated RETURN NIL @@ -252,6 +255,9 @@ ::oQtObject:show() ENDIF + oPalette := ::oQtObject:palette() + ::oColor := oPalette:Color( QPalette_Base ) + RETURN Self /*.............................................................................. @@ -431,6 +437,22 @@ RETURN IIF( ::EchoMode() == QLineEdit_Normal, .F., .T. ) /*.............................................................................. + ReadOnly +..............................................................................*/ +METHOD ReadOnly( lValue ) CLASS TEXTBOX + + LOCAL oPalette := ::oQTObject:palette() + + IF PCOUNT() == 1 .AND. hb_IsLogical( lValue ) + ::oQTObject:setReadOnly ( lValue ) + + oPalette:setColor( QPalette_Base, IF( lValue, QColor( 0, 0, 0, 0 ), ::oColor ) ) + ::oQTObject:setPalette( oPalette ) + ENDIF + +RETURN ::oQTObject:isReadOnly() + +/*.............................................................................. Validator ..............................................................................*/ METHOD Validator( cValue ) CLASS TEXTBOX Modified: source/textboxsimple.prg =================================================================== --- source/textboxsimple.prg 2012-01-09 08:25:58 UTC (rev 888) +++ source/textboxsimple.prg 2012-01-10 07:59:30 UTC (rev 889) @@ -58,9 +58,10 @@ ==============================================================================*/ CLASS TEXTBOXSIMPLE FROM CONTROL - DATA cClass INIT "TEXTBOXSIMPLE" - DATA oColor INIT NIL + DATA cClass INIT "TEXTBOXSIMPLE" + // data: please preserve alphabetic order. + DATA oColor INIT NIL PROTECTED // Methods: please preserve alphabetic order. Methods "New" and "Create" must be the first if present METHOD New This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ri...@us...> - 2012-01-09 08:26:08
|
Revision: 888 http://hmg.svn.sourceforge.net/hmg/?rev=888&view=rev Author: ricciz Date: 2012-01-09 08:25:58 +0000 (Mon, 09 Jan 2012) Log Message: ----------- Modified Paths: -------------- Changelog include/hmg.ch Modified: Changelog =================================================================== --- Changelog 2012-01-09 07:04:50 UTC (rev 887) +++ Changelog 2012-01-09 08:25:58 UTC (rev 888) @@ -16,6 +16,10 @@ The license applies to all entries newer than 2009-04-28. */ +2012-01-09 09:30 UTC+0100 Ricci Zepmeusel ( ricci at conzoft.de ) + * include/hmg.ch + + CARGO <xValue> command as a oneliner while object definition + 2012-01-09 08:00 UTC+0100 Ricci Zepmeusel ( ricci at conzoft.de ) * source/basic.prg + Method cargo( xValue ) Modified: include/hmg.ch =================================================================== --- include/hmg.ch 2012-01-09 07:04:50 UTC (rev 887) +++ include/hmg.ch 2012-01-09 08:25:58 UTC (rev 888) @@ -3199,6 +3199,7 @@ #xcommand BUTTONWIDTH <value> => :ButtonWidth := <value> #xcommand BUTTONHEIGHT <value> => :ButtonHeight := <value> #xcommand CAPTION <value> => :Caption := <value> + #xcommand CARGO <value> => :Cargo := <value> #xcommand CASECONVERT <value> => :CaseConvert := if( <"value"> == "UPPER" , 1, if( <"value"> == "LOWER", 2, 0 ) ) #xcommand CELL <value> => :Cell := <value> #xcommand CELLNAVIGATION <value> => :CellNavigation := <value> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ri...@us...> - 2012-01-09 07:04:56
|
Revision: 887 http://hmg.svn.sourceforge.net/hmg/?rev=887&view=rev Author: ricciz Date: 2012-01-09 07:04:50 +0000 (Mon, 09 Jan 2012) Log Message: ----------- Modified Paths: -------------- Changelog source/basic.prg Modified: Changelog =================================================================== --- Changelog 2012-01-08 18:18:43 UTC (rev 886) +++ Changelog 2012-01-09 07:04:50 UTC (rev 887) @@ -16,6 +16,11 @@ The license applies to all entries newer than 2009-04-28. */ +2012-01-09 08:00 UTC+0100 Ricci Zepmeusel ( ricci at conzoft.de ) + * source/basic.prg + + Method cargo( xValue ) + xValue is an instance variable for free use in every control + 2012-01-08 19:20 UTC+0100 Ricci Zepmeusel ( ricci at conzoft.de ) * source/textboxsimple.prg ! READONLY now use QLineEdit:setReadOnly instead of :disabled, Modified: source/basic.prg =================================================================== --- source/basic.prg 2012-01-08 18:18:43 UTC (rev 886) +++ source/basic.prg 2012-01-09 07:04:50 UTC (rev 887) @@ -51,6 +51,7 @@ // data: please preserve alphabetic order. DATA aBackColor INIT {255,255,255} PROTECTED DATA lBreak INIT NIL PROTECTED + DATA xCargo INIT NIL PROTECTED // Instance variable for free use DATA nCol INIT NIL PROTECTED // please see Col method before restore to 0 DATA lCreated INIT .F. PROTECTED DATA xCursor INIT 0 PROTECTED @@ -89,6 +90,7 @@ METHOD Create METHOD BackColor SETGET METHOD Break SETGET + METHOD Cargo SETGET METHOD Col SETGET METHOD Cursor SETGET METHOD CursorPos SETGET @@ -269,6 +271,17 @@ RETURN Self /*.............................................................................. + Cargo +..............................................................................*/ +METHOD Cargo( xValue ) CLASS BASIC + + IF PCOUNT() == 1 + ::xCargo := xValue + ENDIF + +RETURN ::xCargo + +/*.............................................................................. Col ..............................................................................*/ METHOD Col( nValue ) CLASS BASIC This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ri...@us...> - 2012-01-08 18:18:49
|
Revision: 886 http://hmg.svn.sourceforge.net/hmg/?rev=886&view=rev Author: ricciz Date: 2012-01-08 18:18:43 +0000 (Sun, 08 Jan 2012) Log Message: ----------- Modified Paths: -------------- Changelog Modified: Changelog =================================================================== --- Changelog 2012-01-08 18:17:39 UTC (rev 885) +++ Changelog 2012-01-08 18:18:43 UTC (rev 886) @@ -16,7 +16,7 @@ The license applies to all entries newer than 2009-04-28. */ -2011-12-28 16:00 UTC+0100 Ricci Zepmeusel ( ricci at conzoft.de ) +2012-01-08 19:20 UTC+0100 Ricci Zepmeusel ( ricci at conzoft.de ) * source/textboxsimple.prg ! READONLY now use QLineEdit:setReadOnly instead of :disabled, the text can be marked and copied as in HMG3 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ri...@us...> - 2012-01-08 18:17:45
|
Revision: 885 http://hmg.svn.sourceforge.net/hmg/?rev=885&view=rev Author: ricciz Date: 2012-01-08 18:17:39 +0000 (Sun, 08 Jan 2012) Log Message: ----------- Modified Paths: -------------- Changelog include/hmg.ch source/textboxsimple.prg Modified: Changelog =================================================================== --- Changelog 2012-01-01 16:15:52 UTC (rev 884) +++ Changelog 2012-01-08 18:17:39 UTC (rev 885) @@ -16,6 +16,13 @@ The license applies to all entries newer than 2009-04-28. */ +2011-12-28 16:00 UTC+0100 Ricci Zepmeusel ( ricci at conzoft.de ) + * source/textboxsimple.prg + ! READONLY now use QLineEdit:setReadOnly instead of :disabled, + the text can be marked and copied as in HMG3 + * include/hmg.ch + only cosmetic changes + 2012-01-01 17:15 UTC+0100 Ricci Zepmeusel ( ricci at conzoft.de ) * source/numgetc.prg ! added a grafic arrow that displays the active status Modified: include/hmg.ch =================================================================== --- include/hmg.ch 2012-01-01 16:15:52 UTC (rev 884) +++ include/hmg.ch 2012-01-08 18:17:39 UTC (rev 885) @@ -3048,74 +3048,82 @@ // Alternate Syntax - oneliner /*----------------------------------------------------------------------*/ - #xcommand DEFINE WINDOW <oObj>[ <dummy1: OF, PARENT> <oParent> ] => ; - __mvPublic( <"oObj"> ) ;; - With Object <oObj> := Window():New( <"oObj">[ , <oParent> ] ) + #xcommand DEFINE ANIMATEBOX <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; + With Object [<varname> :=] ANIMATEBOX():New( <"tagreference">[ , <oParent> ] ) + #xcommand END ANIMATEBOX => End With - #xcommand DEFINE DATEPICKER <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; - With Object [<varname> :=] DATEPICKER():New( <"tagreference">[, <oParent> ] ) - #xcommand END DATEPICKER => End With + #xcommand DEFINE BROWSE <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; + With Object [<varname> :=] VIRTUALGRID():New( <"tagreference">[ , <oParent> ] ) + #xcommand END BROWSE => End With - #xcommand DEFINE FRAME <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; - With Object [<varname> :=] FRAME():New( <"tagreference">[, <oParent> ] ) - #xcommand END FRAME => End With - - #xcommand DEFINE IMAGE <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; - With Object [<varname> :=] BITMAP():New( <"tagreference">[, <oParent> ] ) - #xcommand END IMAGE => End With - #xcommand DEFINE BUTTON <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; With Object [<varname> :=] BUTTON():New( <"tagreference">[, <oParent> ] ) #xcommand END BUTTON => End With - #xcommand DEFINE LABEL <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; - With Object [<varname> :=] LABEL():New( <"tagreference">[ , <oParent> ] ) - #xcommand END LABEL => End With - #xcommand DEFINE CHECKBOX <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; With Object [<varname> :=] CHECKBOX():New( <"tagreference">[ , <oParent> ] ) #xcommand END CHECKBOX => End With - #xcommand DEFINE TEXTBOX <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; - With Object [<varname> :=] TEXTBOX():New( <"tagreference">[ , <oParent> ] ) - #xcommand END TEXTBOX => End With + #xcommand DEFINE CHECKBUTTON <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; + With Object [<varname> :=] CHECKBUTTON():New( <"tagreference">[ , <oParent> ] ) + #xcommand END CHECKBUTTON => End With - #xcommand DEFINE TEXTBOXSIMPLE <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; - With Object [<varname> :=] TEXTBOXSIMPLE():New( <"tagreference">[ , <oParent> ] ) - #xcommand END TEXTBOXSIMPLE => End With + #xcommand DEFINE COMBOBOX <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; + With Object [<varname> :=] COMBOBOX():New( <"tagreference">[ , <oParent> ] ) + #xcommand END COMBOBOX => End With #xcommand DEFINE DATEGET <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; With Object [<varname> :=] DATEGET():New( <"tagreference">[ , <oParent> ] ) #xcommand END DATEGET => End With + #xcommand DEFINE DATEPICKER <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; + With Object [<varname> :=] DATEPICKER():New( <"tagreference">[, <oParent> ] ) + #xcommand END DATEPICKER => End With + #xcommand DEFINE EDITBOX <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; With Object [<varname> :=] EDITBOX():New( <"tagreference">[ , <oParent> ] ) #xcommand END EDITBOX => End With - #xcommand DEFINE SPINNER <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; - With Object [<varname> :=] SPINNER():New( <"tagreference">[ , <oParent> ] ) - #xcommand END SPINNER => End With + #xcommand DEFINE FRAME <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; + With Object [<varname> :=] FRAME():New( <"tagreference">[, <oParent> ] ) + #xcommand END FRAME => End With #xcommand DEFINE GRID <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; With Object [<varname> :=] GRID():New( <"tagreference">[ , <oParent> ] ) #xcommand END GRID => End With - #xcommand DEFINE VIRTUALGRID <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; - With Object [<varname> :=] VIRTUALGRID():New( <"tagreference">[ , <oParent> ] ) - #xcommand END VIRTUALGRID => End With + #xcommand DEFINE IMAGE <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; + With Object [<varname> :=] BITMAP():New( <"tagreference">[, <oParent> ] ) + #xcommand END IMAGE => End With - #xcommand DEFINE BROWSE <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; - With Object [<varname> :=] VIRTUALGRID():New( <"tagreference">[ , <oParent> ] ) - #xcommand END BROWSE => End With + #xcommand DEFINE IPADDRESS <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; + With Object [<varname> :=] IPADDRESS():New( <"tagreference">[ , <oParent> ] ) + #xcommand END IPADDRESS => End With - #xcommand DEFINE COMBOBOX <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; - With Object [<varname> :=] COMBOBOX():New( <"tagreference">[ , <oParent> ] ) - #xcommand END COMBOBOX => End With + #xcommand DEFINE LABEL <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; + With Object [<varname> :=] LABEL():New( <"tagreference">[ , <oParent> ] ) + #xcommand END LABEL => End With + #xcommand DEFINE LCD <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; + With Object [<varname> :=] LCD():New( <"tagreference">[ , <oParent> ] ) + #xcommand END LCD => End With + #xcommand DEFINE LISTBOX <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; With Object [<varname> :=] LISTBOX():New( <"tagreference">[ , <oParent> ] ) #xcommand END LISTBOX => End With + #xcommand DEFINE HYPERLINK <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; + With Object [<varname> :=] HYPERLINK():New( <"tagreference">[ , <oParent> ] ) + #xcommand END HYPERLINK => End With + + #xcommand DEFINE MONTHCALENDAR <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; + With Object [<varname> :=] MONTHCALENDAR():New( <"tagreference">[ , <oParent> ] ) + #xcommand END MONTHCALENDAR => End With + + #xcommand DEFINE NUMGETC <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; + With Object [<varname> :=] NUMGETC():New( <"tagreference">[ , <oParent> ] ) + #xcommand END NUMGETC => End With + #xcommand DEFINE PROGRESSBAR <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; With Object [<varname> :=] PROGRESSBAR():New( <"tagreference">[ , <oParent> ] ) #xcommand END PROGRESSBAR => End With @@ -3124,38 +3132,26 @@ With Object [<varname> :=] RADIOGROUP():New( <"tagreference">[ , <oParent> ] ) #xcommand END RADIOGROUP => End With - #xcommand DEFINE HYPERLINK <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; - With Object [<varname> :=] HYPERLINK():New( <"tagreference">[ , <oParent> ] ) - #xcommand END HYPERLINK => End With + #xcommand DEFINE SCROLLAREA <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; + With Object [<varname> :=] SCROLLAREA():New( <"tagreference">[ , <oParent> ] ) + #xcommand END SCROLLAREA => End With - #xcommand DEFINE CHECKBUTTON <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; - With Object [<varname> :=] CHECKBUTTON():New( <"tagreference">[ , <oParent> ] ) - #xcommand END CHECKBUTTON => End With - - #xcommand DEFINE TREE <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; - With Object [<varname> :=] TREE():New( <"tagreference">[ , <oParent> ] ) - #xcommand END TREE => End With - #xcommand DEFINE SLIDER <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; With Object [<varname> :=] SLIDER():New( <"tagreference">[ , <oParent> ] ) #xcommand END SLIDER => End With - #xcommand DEFINE ANIMATEBOX <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; - With Object [<varname> :=] ANIMATEBOX():New( <"tagreference">[ , <oParent> ] ) - #xcommand END ANIMATEBOX => End With + #xcommand DEFINE SPINNER <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; + With Object [<varname> :=] SPINNER():New( <"tagreference">[ , <oParent> ] ) + #xcommand END SPINNER => End With - #xcommand DEFINE IPADDRESS <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; - With Object [<varname> :=] IPADDRESS():New( <"tagreference">[ , <oParent> ] ) - #xcommand END IPADDRESS => End With + #xcommand DEFINE TEXTBOX <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; + With Object [<varname> :=] TEXTBOX():New( <"tagreference">[ , <oParent> ] ) + #xcommand END TEXTBOX => End With - #xcommand DEFINE MONTHCALENDAR <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; - With Object [<varname> :=] MONTHCALENDAR():New( <"tagreference">[ , <oParent> ] ) - #xcommand END MONTHCALENDAR => End With + #xcommand DEFINE TEXTBOXSIMPLE <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; + With Object [<varname> :=] TEXTBOXSIMPLE():New( <"tagreference">[ , <oParent> ] ) + #xcommand END TEXTBOXSIMPLE => End With - #xcommand DEFINE SCROLLAREA <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; - With Object [<varname> :=] SCROLLAREA():New( <"tagreference">[ , <oParent> ] ) - #xcommand END SCROLLAREA => End With - #xcommand DEFINE TIMER <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; With Object [<varname> :=] TIMER():New( <"tagreference">[ , <oParent> ] ) #xcommand END TIMER => End With @@ -3167,14 +3163,18 @@ With Object [<varname> :=] TOOLBUTTON():New( <"tagreference">[ , <oParent> ] ) #xcommand END TOOLBUTTON => End With - #xcommand DEFINE LCD <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; - With Object [<varname> :=] LCD():New( <"tagreference">[ , <oParent> ] ) - #xcommand END LCD => End With + #xcommand DEFINE TREE <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; + With Object [<varname> :=] TREE():New( <"tagreference">[ , <oParent> ] ) + #xcommand END TREE => End With - #xcommand DEFINE NUMGETC <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; - With Object [<varname> :=] NUMGETC():New( <"tagreference">[ , <oParent> ] ) - #xcommand END NUMGETC => End With + #xcommand DEFINE VIRTUALGRID <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; + With Object [<varname> :=] VIRTUALGRID():New( <"tagreference">[ , <oParent> ] ) + #xcommand END VIRTUALGRID => End With + #xcommand DEFINE WINDOW <oObj>[ <dummy1: OF, PARENT> <oParent> ] => ; + __mvPublic( <"oObj"> ) ;; + With Object <oObj> := Window():New( <"oObj">[ , <oParent> ] ) + // One-liner definitions // // PLEASE ADD IN ALPHABETICAL ORDER ONLY !!!! Modified: source/textboxsimple.prg =================================================================== --- source/textboxsimple.prg 2012-01-01 16:15:52 UTC (rev 884) +++ source/textboxsimple.prg 2012-01-08 18:17:39 UTC (rev 885) @@ -58,8 +58,8 @@ ==============================================================================*/ CLASS TEXTBOXSIMPLE FROM CONTROL - DATA cClass INIT "TEXTBOXSIMPLE" - + DATA cClass INIT "TEXTBOXSIMPLE" + DATA oColor INIT NIL // data: please preserve alphabetic order. // Methods: please preserve alphabetic order. Methods "New" and "Create" must be the first if present @@ -67,13 +67,14 @@ METHOD Create // Properties & Events: please preserve alphabetic order. - METHOD Alignment SETGET - METHOD CaretPos SETGET - METHOD InputMask SETGET - METHOD MaxLength SETGET - METHOD OnEnter SETGET - METHOD PassWord SETGET - METHOD Value SETGET + METHOD Alignment SETGET + METHOD CaretPos SETGET + METHOD InputMask SETGET + METHOD MaxLength SETGET + METHOD OnEnter SETGET + METHOD PassWord SETGET + METHOD ReadOnly SETGET + METHOD Value SETGET // Connected events handling: please preserve alphabetic order. @@ -107,7 +108,7 @@ ::oQtFont := ::oQtObject:font() ::oQtObject:setFocusPolicy( Qt_StrongFocus ) -// ::oQtObject:setAutoFillBackground( .T. ) + ::oQtObject:setAutoFillBackground( .F. ) RETURN Self @@ -116,6 +117,8 @@ ..............................................................................*/ METHOD Create() CLASS TEXTBOXSIMPLE + LOCAL oPalette + ::lCreated := .T. ::CreatePendingChildControls() // Create inner controls @@ -126,6 +129,9 @@ ::oQtObject:show() ENDIF + oPalette := ::oQtObject:palette() + ::oColor := oPalette:Color( QPalette_Base ) + RETURN Self @@ -162,7 +168,6 @@ RETURN ::oQTObject:cursorPosition() - /*.............................................................................. InputMask ..............................................................................*/ @@ -212,6 +217,22 @@ RETURN ::oQTObject:echoMode /*.............................................................................. + ReadOnly +..............................................................................*/ +METHOD ReadOnly( lValue ) CLASS TEXTBOXSIMPLE + + LOCAL oPalette := ::oQTObject:palette() + + IF PCOUNT() == 1 .AND. hb_IsLogical( lValue ) + ::oQTObject:setReadOnly ( lValue ) + + oPalette:setColor( QPalette_Base, IF( lValue, QColor( 0, 0, 0, 0 ), ::oColor ) ) + ::oQTObject:setPalette( oPalette ) + ENDIF + +RETURN ::oQTObject:isReadOnly() + +/*.............................................................................. Value ..............................................................................*/ METHOD Value( cValue ) CLASS TEXTBOXSIMPLE This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ri...@us...> - 2012-01-01 16:15:58
|
Revision: 884 http://hmg.svn.sourceforge.net/hmg/?rev=884&view=rev Author: ricciz Date: 2012-01-01 16:15:52 +0000 (Sun, 01 Jan 2012) Log Message: ----------- Modified Paths: -------------- Changelog source/misc.prg source/numgetc.prg Modified: Changelog =================================================================== --- Changelog 2011-12-28 18:17:10 UTC (rev 883) +++ Changelog 2012-01-01 16:15:52 UTC (rev 884) @@ -16,6 +16,12 @@ The license applies to all entries newer than 2009-04-28. */ +2012-01-01 17:15 UTC+0100 Ricci Zepmeusel ( ricci at conzoft.de ) + * source/numgetc.prg + ! added a grafic arrow that displays the active status + * source/misc.prg + + function Xpm2Image( <aXpm> ) which convert an XPM array to a QImage object + 2011-12-28 18:50 UTC+0100 Ricci Zepmeusel ( ricci at conzoft.de ) + source/dateget.prg ! new "date only" input class. Modified: source/misc.prg =================================================================== --- source/misc.prg 2011-12-28 18:17:10 UTC (rev 883) +++ source/misc.prg 2012-01-01 16:15:52 UTC (rev 884) @@ -32,6 +32,7 @@ * HMG library code into it. */ #include "qtqvariant.ch" +#include "hbqtgui.ch" #if defined( _HMG_SET_VERSION_INFO_ ) #include "hmgver.h" @@ -529,3 +530,44 @@ END CASE RETURN xReturn + +/*.............................................................................. + Xpm2Image + This function converts a XPM2 image to a QImage object. +..............................................................................*/ +FUNCTION Xpm2Image( aXpm ) + + LOCAL oQImage, aValues, nWidth, nHeight, nColors + LOCAL nPos, nRow, nCol, nAktColor, aColor := {}, cValue + + aValues := hb_aTokens( aXpm[1] ) + nWidth := VAL( aValues[1] ) + nHeight := VAL( aValues[2] ) + nColors := VAL( aValues[3] ) + + oQImage := QImage( nWidth, nHeight, QImage_Format_Indexed8 ) // aValues[4] == 1 (one char per pixel) + + + FOR nPos := 1 TO nColors + AADD( aColor, hb_aTokens( aXpm[ nPos + 1 ] ) ) + + IF aColor[ nPos ][3] == "None" + nAktColor := 0x00000000 + ELSE + nAktColor := HB_HEXTONUM( "FF" + RIGHT( aColor[ nPos ][3], 6 ) ) + ENDIF + oQimage:setColor( nPos - 1, nAktColor ) + NEXT + + FOR nRow := 1 to nHeight + FOR nCol := 1 to nWidth + cValue := SUBSTR( aXpm[ nRow + 1 + nColors], nCol, 1 ) + + nPos := ASCAN( aColor, { |aPos| aPos[1] == cValue } ) + IF nPos > 0 + oQimage:setPixel( nCol - 1, nRow - 1, nPos - 1 ) + ENDIF + NEXT + NEXT + +RETURN( oQimage ) \ No newline at end of file Modified: source/numgetc.prg =================================================================== --- source/numgetc.prg 2011-12-28 18:17:10 UTC (rev 883) +++ source/numgetc.prg 2012-01-01 16:15:52 UTC (rev 884) @@ -32,6 +32,17 @@ #include "common.ch" #include "hbqtgui.ch" +STATIC aButton := { "7 7 2 1", ; + ". c None", ; + "# c #000000", ; + "....#..", ; + "...##..", ; + "..###..", ; + ".####..", ; + "..###..", ; + "...##..", ; + "....#.."} + /*============================================================================== NUMGETC class ==============================================================================*/ @@ -43,6 +54,7 @@ DATA nDecimals INIT 2 PROTECTED DATA cDecimalPoint INIT "A" PROTECTED DATA lIsNegativ INIT .F. PROTECTED + DATA oImage INIT NIL PROTECTED // Label which display the arrow DATA lThousands INIT .F. PROTECTED DATA cValue INIT "" PROTECTED DATA nValue INIT 0 PROTECTED @@ -63,6 +75,7 @@ METHOD OnEnter SETGET METHOD Thousands SETGET METHOD Value SETGET + METHOD Visible SETGET ENDCLASS /*----------------------------------------------------------------------*/ @@ -83,12 +96,14 @@ ::oQtObject := QLabel() ENDIF - ::oQtObject:setAlignment( TXT_RIGHT ) - ::oQtFont := ::oQtObject:font() ::oQtObject:setFocusPolicy( Qt_StrongFocus ) ::oQtObject:setAutoFillBackground( .T. ) + + // create button for calendar + ::oImage := QLabel( ::oParent:QtParent ) + RETURN Self @@ -97,12 +112,14 @@ ..............................................................................*/ METHOD Create() CLASS NUMGETC - LOCAL oLineEdit, oPalette, oPalette2 + LOCAL oLineEdit, oPalette, oPalette2, oQtImage ::lCreated := .T. - ::QtObject:setFrameStyle( QFrame_StyledPanel ) - + ::oQtObject:setFrameStyle( QFrame_StyledPanel ) + ::oQtObject:setAlignment( hb_bitOR( Qt_AlignVCenter, Qt_AlignRight ) ) + ::oQtObject:setIndent( 10 ) // right space for the arroy + // copy palette from Textbox to Label oLineEdit := QLineEdit() oPalette2 := oLineEdit:palette() @@ -117,12 +134,22 @@ // Create inner controls ::CreatePendingChildControls() + // assign the events ::oQTObject:connect( QEvent_KeyPress, { |e| ::DoKeyBoardEvents( e )} ) ::oQtObject:connect( QEvent_FocusIn, { |e| ::__HMGGotFocus( e ) } ) ::oQtObject:connect( QEvent_FocusOut, { |e| ::__HMGLostFocus( e ) } ) + + // get arrow from XPM + oQtImage := QPixmap():fromImage( Xpm2Image( aButton ) ) + // resize and align the QLabel object + ::oImage:Resize( oQtImage:width(), oQtImage:height() ) + ::oImage:Move( ::oQTObject:x() + ::oQTObject:width() - ::oImage:width() - 1, ::oQTObject:y() + ( ::oQTObject:height() - oQtImage:height() )/2 ) + ::oImage:setPixmap( oQtImage ) + IF ::Visible() ::oQtObject:show() + ::oImage:show() ENDIF ::DisplayNumber() @@ -147,8 +174,10 @@ ::nValue := VAL( ::cValue ) - ::oQtObject:setText( IF( ::lIsNegativ, "-", "" ) + ALLTRIM( TRANSFORM( ::nValue, cMask ) ) + IF( ::oQtObject:hasFocus(), " <", " " ) ) - + ::oQtObject:setText( IF( ::lIsNegativ, "-", "" ) + ALLTRIM( TRANSFORM( ::nValue, cMask ) ) ) + + ::oImage:setVisible( ::oQtObject:hasFocus() ) + RETURN NIL /*.............................................................................. @@ -293,4 +322,17 @@ ENDIF ENDIF -RETURN NIL \ No newline at end of file +RETURN NIL + +/*.............................................................................. + Visible +..............................................................................*/ +METHOD Visible( lValue ) CLASS NUMGETC + + IF PCOUNT() == 1 .AND. hb_IsLogical( lValue ) + ::oQTObject:setVisible( lValue ) + ::oImage:setVisible( lValue ) + ENDIF + +RETURN ::oQTObject:isVisible() + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ri...@us...> - 2011-12-28 18:17:16
|
Revision: 883 http://hmg.svn.sourceforge.net/hmg/?rev=883&view=rev Author: ricciz Date: 2011-12-28 18:17:10 +0000 (Wed, 28 Dec 2011) Log Message: ----------- Modified Paths: -------------- source/dateget.prg Modified: source/dateget.prg =================================================================== --- source/dateget.prg 2011-12-28 17:48:21 UTC (rev 882) +++ source/dateget.prg 2011-12-28 18:17:10 UTC (rev 883) @@ -286,7 +286,7 @@ ::s_oCurWidget := ::oParent:ChildGet( ::cName ) ENDIF - ::CaretPos( 1 ) +// ::CaretPos( 0 ) ::cLastValue := ::Value() IF hb_isBlock( ::bOnGotFocus ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ri...@us...> - 2011-12-28 17:48:29
|
Revision: 882 http://hmg.svn.sourceforge.net/hmg/?rev=882&view=rev Author: ricciz Date: 2011-12-28 17:48:21 +0000 (Wed, 28 Dec 2011) Log Message: ----------- Modified Paths: -------------- Changelog hmg.hbp include/hmg.ch Added Paths: ----------- source/dateget.prg Modified: Changelog =================================================================== --- Changelog 2011-12-28 15:05:27 UTC (rev 881) +++ Changelog 2011-12-28 17:48:21 UTC (rev 882) @@ -16,6 +16,11 @@ The license applies to all entries newer than 2009-04-28. */ +2011-12-28 18:50 UTC+0100 Ricci Zepmeusel ( ricci at conzoft.de ) + + source/dateget.prg + ! new "date only" input class. + Implemented because datepicker accept no empty date + 2011-12-28 16:00 UTC+0100 Ricci Zepmeusel ( ricci at conzoft.de ) * source/textboxsimple.prg ! some minor changes Modified: hmg.hbp =================================================================== --- hmg.hbp 2011-12-28 15:05:27 UTC (rev 881) +++ hmg.hbp 2011-12-28 17:48:21 UTC (rev 882) @@ -25,6 +25,7 @@ source/combobox.prg source/contextmenu.prg source/control.prg +source/dateget.prg source/datepicker.prg source/dial.prg source/dialog.prg Modified: include/hmg.ch =================================================================== --- include/hmg.ch 2011-12-28 15:05:27 UTC (rev 881) +++ include/hmg.ch 2011-12-28 17:48:21 UTC (rev 882) @@ -3084,6 +3084,10 @@ With Object [<varname> :=] TEXTBOXSIMPLE():New( <"tagreference">[ , <oParent> ] ) #xcommand END TEXTBOXSIMPLE => End With + #xcommand DEFINE DATEGET <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; + With Object [<varname> :=] DATEGET():New( <"tagreference">[ , <oParent> ] ) + #xcommand END DATEGET => End With + #xcommand DEFINE EDITBOX <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; With Object [<varname> :=] EDITBOX():New( <"tagreference">[ , <oParent> ] ) #xcommand END EDITBOX => End With Added: source/dateget.prg =================================================================== --- source/dateget.prg (rev 0) +++ source/dateget.prg 2011-12-28 17:48:21 UTC (rev 882) @@ -0,0 +1,338 @@ +/* + * $Id: textbox.prg 822 2011-11-27 22:50:25Z fperillo $ + */ + +/* + * HMG4 Source Code + * + * From an original idea of Roberto Lopez, founder of the project + * http://hmgforum.com <hm...@hm...> + * + * Developers list: + * + * Carlos Britos ( <bcd12a(a_t)yahoo.com.ar> ) + * Francesco Perillo ( fperillo at gmail.com ) + * Luigi Ferraris ( luigi at l3w.it ) + * Ricci Zepmeusel ( ricci at conzoft.de ) + * Mauricio Ventura Faria (<conc001 a+t gmail com>) + * Pritpal Bedi (bed...@ho...) + * Roberto Lopez ( mai...@gm... ) + * Rathinagiri ( <sr...@da...> ) + * Esgici + * Sudipb + * Martingamez + * Raumi75 + * Mol68 + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or( at your option ) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License FOR more details. + * + * You should have received a copy of the GNU General Public License along with + * this software; see the file COPYING. IF not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA( or + * visit the web site http://www.gnu.org/ ). + * + * As a special exception, you have permission FOR additional uses of the text + * contained in this release of HMG. + * + * The exception is that, IF you link the HMG library with other + * files to produce an executable, this does not by itself cause the resulting + * executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of linking the + * HMG library code into it. + */ + +#include "hbclass.ch" +#include "common.ch" +#include "hbqtgui.ch" +#include "hmg.ch" + +/*============================================================================== + TEXTBOXSIMPLE class +==============================================================================*/ +CLASS DATEGET FROM CONTROL + + DATA cClass INIT "DATEGET" + +// data: please preserve alphabetic order. + DATA cLastValue INIT "" PROTECTED + +// Methods: please preserve alphabetic order. Methods "New" and "Create" must be the first if present + METHOD New + METHOD Create + METHOD InputMask + +// Properties & Events: please preserve alphabetic order. + METHOD Alignment SETGET + METHOD CaretPos SETGET + METHOD OnEnter SETGET + METHOD PassWord SETGET + METHOD Value SETGET + +// Connected events handling: please preserve alphabetic order. + + METHOD __HmgConnectEv PROTECTED + METHOD __HmgDisconnectEv PROTECTED + METHOD __HmgOnEnterExec PROTECTED + METHOD __HmgOnGotFocusExec PROTECTED + METHOD __HmgOnLostFocusExec PROTECTED + METHOD __HmgTextChange PROTECTED + +ENDCLASS + + +/*----------------------------------------------------------------------*/ +// Methods +/*----------------------------------------------------------------------*/ + +/*.............................................................................. + New +..............................................................................*/ +METHOD New( cName, oParent ) CLASS DATEGET + + Super:New( cName, oParent ) + + IF hb_IsObject( ::oParent ) + ::oQtObject := QLineEdit( ::oParent:QtParent ) + ELSE + ::oQtObject := QLineEdit() + ENDIF + + ::oQtFont := ::oQtObject:font() + + ::oQtObject:setFocusPolicy( Qt_StrongFocus ) +// ::oQtObject:setAutoFillBackground( .T. ) + +RETURN Self + +/*.............................................................................. + Create +..............................................................................*/ +METHOD Create() CLASS DATEGET + + ::lCreated := .T. + + ::CreatePendingChildControls() // Create inner controls + + ::__HmgConnectEv() + + ::InputMask() + + IF ::Visible() + ::oQtObject:show() + ENDIF + +RETURN Self + +/*.............................................................................. + InputMask +..............................................................................*/ +METHOD InputMask( ) CLASS DATEGET + + LOCAL cDateFormat := set( _SET_DATEFORMAT ) + + cDateFormat := STRTRAN( cDateFormat, "dd", "09" ) + cDateFormat := STRTRAN( cDateFormat, "mm", "09" ) + cDateFormat := STRTRAN( cDateFormat, "yy", "99" ) + + ::oQTObject:SetInputMask( cDateFormat ) + ::oQTObject:setMaxLength( LEN( cDateFormat ) ) + +RETURN Self + + +/*----------------------------------------------------------------------*/ +// Properties +/*----------------------------------------------------------------------*/ + +/*.............................................................................. + Alignment +..............................................................................*/ +METHOD Alignment( nValue ) CLASS DATEGET + + IF PCOUNT() == 1 .AND. hb_IsNumeric( nValue ) + ::nAlignment := nValue + IF ::nAlignment == TXT_LEFT + ::oQTObject:setAlignment( Qt_AlignLeft ) + ELSEIF nValue == TXT_CENTER + ::oQTObject:setAlignment( Qt_AlignCenter ) + ELSEIF nValue == TXT_RIGHT + ::oQTObject:setAlignment( Qt_AlignRight ) + ENDIF + ENDIF + +RETURN ::nAlignment + +/*.............................................................................. + CaretPos +..............................................................................*/ +METHOD CaretPos( nValue ) CLASS DATEGET + + IF PCOUNT() == 1 .AND. hb_IsNumeric( nValue ) + ::oQTObject:setCursorPosition( nValue ) + ENDIF + +RETURN ::oQTObject:cursorPosition() + + +/*.............................................................................. + OnEnter +..............................................................................*/ +METHOD OnEnter( bValue ) CLASS DATEGET + + IF hb_IsBlock( bValue ) .OR. hb_IsNil( bValue ) + ::bOnEnter := bValue + ENDIF + +RETURN ::bOnEnter + +/*.............................................................................. + PassWord +..............................................................................*/ +METHOD PassWord( xValue ) CLASS DATEGET + + IF PCOUNT() == 1 + IF hb_IsLogical( xValue ) + ::oQTObject:setEchoMode( IF ( xValue, QLineEdit_Password, QLineEdit_Normal ) ) + ELSEIF hb_IsNumeric( xValue ) + ::oQTObject:setEchoMode( xValue ) + ENDIF + ENDIF + +RETURN ::oQTObject:echoMode + +/*.............................................................................. + Value +..............................................................................*/ +METHOD Value( dValue ) CLASS DATEGET + + IF PCOUNT() == 1 .AND. hb_IsDate( dValue ) + ::oQTObject:SetText( DTOC( dValue ) ) + ENDIF + +RETURN CTOD( ::oQTObject:text() ) + + +/*----------------------------------------------------------------------*/ +// Events +/*----------------------------------------------------------------------*/ + +/*.............................................................................. + __HmgConnectEv + ATTENTION: this is the most generic connector. Pay attention if you want add other event + If object needs more connected events, overwrite this method and __HmgDisconnectEv() +..............................................................................*/ +METHOD __HmgConnectEv() CLASS DATEGET + + ::oQtObject:connect( QEvent_Close, { |oEv| ::__HmgOnCloseExec( oEv ) } ) + ::oQtObject:connect( QEvent_FocusIn, { |oEv| ::__HmgOnGotFocusExec( oEv ) } ) + ::oQtObject:connect( QEvent_FocusOut, { |oEv| ::__HmgOnLostFocusExec( oEv ) } ) + + // hook onchange event + ::oQtObject:connect( "textChanged(QString)", { |cText| ::__HmgTextChange( cText ) } ) + ::oQtObject:connect( "returnPressed()", { |oEv| ::__HmgOnEnterExec( oEv ) } ) + + +RETURN Self + +/*.............................................................................. + __HmgDisconnectEv + ATTENTION: this is the most generic DISconnector. Pay attention if you want add other event + If object has more connected events, overwrite this method and __HmgConnectEv() +..............................................................................*/ +METHOD __HmgDisconnectEv() CLASS DATEGET + + ::oQtObject:disconnect( QEvent_Close ) + ::oQtObject:disconnect( QEvent_FocusIn ) + ::oQtObject:disconnect( QEvent_FocusOut ) + + ::oQtObject:disconnect( "textChanged(QString)" ) + ::oQtObject:disconnect( "returnPressed()" ) + +RETURN Self + +/*.............................................................................. + __HmgOnEnterExec +..............................................................................*/ +METHOD __HmgOnEnterExec( oEvent ) CLASS DATEGET + + IF hb_IsBlock( ::bOnEnter ) + EVAL( ::bOnEnter ) + ENDIF + +// ::__HmgSendEvent( Qt_Key_Tab, Qt_NoModifier ) + + HB_SYMBOL_UNUSED( oEvent ) + +RETURN .F. // .F. means don't stop event handler + +/*.............................................................................. + __HmgOnGotFocusExec +..............................................................................*/ +METHOD __HmgOnGotFocusExec( oQtEvent ) CLASS DATEGET + + LOCAL oQtReason := oQtEvent:reason() + + HB_SYMBOL_UNUSED( oQtReason ) + + IF hb_IsObject( ::oParent ) + HMGAPP():ThisWin( ::FindValidParent(1) ) // try to update current window if found it + ::s_oCurWidget := ::oParent:ChildGet( ::cName ) + ENDIF + + ::CaretPos( 1 ) + ::cLastValue := ::Value() + + IF hb_isBlock( ::bOnGotFocus ) + Eval( ::bOnGotFocus ) + ENDIF + +RETURN .F. // .F. means don't stop event handler + +/*.............................................................................. + __HmgOnLostFocusExec +..............................................................................*/ +METHOD __HmgOnLostFocusExec( oQtEvent ) CLASS DATEGET + + LOCAL cValue + + HB_SYMBOL_UNUSED( oQtEvent ) + + // Check if valid date or empty string ? + IF EMPTY( ::Value() ) + cValue := STRTRAN( ::oQTObject:text(), ".", "" ) + cValue := STRTRAN( cValue, "/", "" ) + cValue := STRTRAN( cValue, "-", "" ) + + IF ! EMPTY( cValue ) // invalid date, reset value + ::Value( ::cLastValue ) + ENDIF + ENDIF + + ::s_oCurWidget := NIL + + IF hb_isBlock( ::bOnLostFocus ) + Eval( ::bOnLostFocus ) + ENDIF + +RETURN .F. // .F. means don't stop event handler + +/*.............................................................................. + __HmgTextChange +..............................................................................*/ +METHOD __HmgTextChange( cText ) CLASS DATEGET + + HB_SYMBOL_UNUSED( cText ) + + IF ValType( ::bOnChange ) != 'U' + Eval( ::bOnChange ) + ENDIF + +RETURN NIL + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ri...@us...> - 2011-12-28 15:05:33
|
Revision: 881 http://hmg.svn.sourceforge.net/hmg/?rev=881&view=rev Author: ricciz Date: 2011-12-28 15:05:27 +0000 (Wed, 28 Dec 2011) Log Message: ----------- Modified Paths: -------------- Changelog source/textboxsimple.prg Modified: Changelog =================================================================== --- Changelog 2011-12-28 08:34:08 UTC (rev 880) +++ Changelog 2011-12-28 15:05:27 UTC (rev 881) @@ -16,6 +16,10 @@ The license applies to all entries newer than 2009-04-28. */ +2011-12-28 16:00 UTC+0100 Ricci Zepmeusel ( ricci at conzoft.de ) + * source/textboxsimple.prg + ! some minor changes + 2011-12-28 10:00 UTC+0100 Ricci Zepmeusel ( ricci at conzoft.de ) * source/textboxsimple.prg ! method Password( <xValue> ) accept .T./.F. or a number between 0 and 3, Modified: source/textboxsimple.prg =================================================================== --- source/textboxsimple.prg 2011-12-28 08:34:08 UTC (rev 880) +++ source/textboxsimple.prg 2011-12-28 15:05:27 UTC (rev 881) @@ -53,13 +53,6 @@ #include "hbqtgui.ch" #include "hmg.ch" -#ifndef TXT_LEFT - #define TXT_LEFT 0 -#endif -#ifndef TXT_RIGHT - #define TXT_RIGHT 2 -#endif - /*============================================================================== TEXTBOXSIMPLE class ==============================================================================*/ @@ -68,10 +61,6 @@ DATA cClass INIT "TEXTBOXSIMPLE" // data: please preserve alphabetic order. - DATA nCaretPos INIT 0 PROTECTED - DATA lGotFocusExecFlag INIT NIL PROTECTED - DATA lLostFocusExecFlag INIT NIL PROTECTED - DATA bOnLostFocus INIT NIL PROTECTED // Methods: please preserve alphabetic order. Methods "New" and "Create" must be the first if present METHOD New @@ -153,6 +142,8 @@ ::nAlignment := nValue IF ::nAlignment == TXT_LEFT ::oQTObject:setAlignment( Qt_AlignLeft ) + ELSEIF nValue == TXT_CENTER + ::oQTObject:setAlignment( Qt_AlignCenter ) ELSEIF nValue == TXT_RIGHT ::oQTObject:setAlignment( Qt_AlignRight ) ENDIF @@ -213,7 +204,7 @@ IF PCOUNT() == 1 IF hb_IsLogical( xValue ) ::oQTObject:setEchoMode( IF ( xValue, QLineEdit_Password, QLineEdit_Normal ) ) - ELSEIF hb_IsNumber( xValue ) + ELSEIF hb_IsNumeric( xValue ) ::oQTObject:setEchoMode( xValue ) ENDIF ENDIF @@ -299,14 +290,10 @@ ::s_oCurWidget := ::oParent:ChildGet( ::cName ) ENDIF - ::lGotFocusExecFlag := .T. - IF hb_isBlock( ::bOnGotFocus ) Eval( ::bOnGotFocus ) ENDIF - ::lGotFocusExecFlag := .F. - RETURN .F. // .F. means don't stop event handler /*.............................................................................. @@ -318,14 +305,10 @@ ::s_oCurWidget := NIL - ::lLostFocusExecFlag := .T. - IF hb_isBlock( ::bOnLostFocus ) Eval( ::bOnLostFocus ) ENDIF - ::lLostFocusExecFlag := .T. - RETURN .F. // .F. means don't stop event handler /*.............................................................................. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ri...@us...> - 2011-12-28 08:34:15
|
Revision: 880 http://hmg.svn.sourceforge.net/hmg/?rev=880&view=rev Author: ricciz Date: 2011-12-28 08:34:08 +0000 (Wed, 28 Dec 2011) Log Message: ----------- Modified Paths: -------------- Changelog source/textboxsimple.prg Modified: Changelog =================================================================== --- Changelog 2011-12-27 17:28:27 UTC (rev 879) +++ Changelog 2011-12-28 08:34:08 UTC (rev 880) @@ -16,6 +16,18 @@ The license applies to all entries newer than 2009-04-28. */ +2011-12-28 10:00 UTC+0100 Ricci Zepmeusel ( ricci at conzoft.de ) + * source/textboxsimple.prg + ! method Password( <xValue> ) accept .T./.F. or a number between 0 and 3, + it always return a number. + QLineEdit_Normal 0 Display characters as they are entered. This is the default. + QLineEdit_NoEcho 1 Do not display anything. This may be appropriate for passwords where even the length of the password should be kept secret. + QLineEdit_Password 2 Display asterisks instead of the characters actually entered. + QLineEdit_PasswordEchoOnEdit 3 Display characters as they are entered while editing otherwise display asterisks. + + method InputMask( <cValue> ) + Qt compatible inputmask is now accepted, see: + http://developer.qt.nokia.com/doc/qt-4.8/qlineedit.html#inputMask-prop + 2011-12-27 18:30 UTC+0100 Ricci Zepmeusel ( ricci at conzoft.de ) * source/textboxsimple.prg ! some minor changes Modified: source/textboxsimple.prg =================================================================== --- source/textboxsimple.prg 2011-12-27 17:28:27 UTC (rev 879) +++ source/textboxsimple.prg 2011-12-28 08:34:08 UTC (rev 880) @@ -71,7 +71,6 @@ DATA nCaretPos INIT 0 PROTECTED DATA lGotFocusExecFlag INIT NIL PROTECTED DATA lLostFocusExecFlag INIT NIL PROTECTED - DATA nMaxLength INIT 0 PROTECTED DATA bOnLostFocus INIT NIL PROTECTED // Methods: please preserve alphabetic order. Methods "New" and "Create" must be the first if present @@ -81,6 +80,7 @@ // Properties & Events: please preserve alphabetic order. METHOD Alignment SETGET METHOD CaretPos SETGET + METHOD InputMask SETGET METHOD MaxLength SETGET METHOD OnEnter SETGET METHOD PassWord SETGET @@ -171,16 +171,28 @@ RETURN ::oQTObject:cursorPosition() + /*.............................................................................. + InputMask +..............................................................................*/ +METHOD InputMask( cValue ) CLASS TEXTBOXSIMPLE + + IF PCOUNT() == 1 .AND. hb_IsChar( cValue ) + ::oQTObject:SetInputMask( cValue ) + ENDIF + +RETURN ::oQTObject:InputMask() + +/*.............................................................................. MaxLength ..............................................................................*/ METHOD MaxLength( nValue ) CLASS TEXTBOXSIMPLE IF PCOUNT() == 1 .AND. hb_IsNumeric( nValue ) - ::nMaxLength := nValue + ::oQTObject:setMaxLength( nValue ) ENDIF -RETURN ::nMaxLength +RETURN ::oQTObject:maxLength() /*.............................................................................. OnEnter @@ -196,13 +208,17 @@ /*.............................................................................. PassWord ..............................................................................*/ -METHOD PassWord( lValue ) CLASS TEXTBOXSIMPLE +METHOD PassWord( xValue ) CLASS TEXTBOXSIMPLE - IF PCOUNT() == 1 .AND. hb_IsLogical( lValue ) - ::oQTObject:setEchoMode( IF ( lValue, QLineEdit_Password, QLineEdit_Normal ) ) + IF PCOUNT() == 1 + IF hb_IsLogical( xValue ) + ::oQTObject:setEchoMode( IF ( xValue, QLineEdit_Password, QLineEdit_Normal ) ) + ELSEIF hb_IsNumber( xValue ) + ::oQTObject:setEchoMode( xValue ) + ENDIF ENDIF -RETURN IF ( ::oQTObject:echoMode == QLineEdit_Normal, .F., .T. ) +RETURN ::oQTObject:echoMode /*.............................................................................. Value @@ -317,23 +333,8 @@ ..............................................................................*/ METHOD __HmgTextChange( cText ) CLASS TEXTBOXSIMPLE - LOCAL nCursPos, cInBufferLeft, cInBufferRight, cInBuffer - HB_SYMBOL_UNUSED( cText ) - nCursPos := ::oQTObject:cursorPosition() - - IF ::nMaxLength > 0 - cInBuffer := ::oQTObject:text() - - IF Len( cInBuffer ) > ::nMaxLength - cInBufferLeft := Left( cInBuffer , nCursPos ) - cInBufferRight := Right( cInBuffer , Len( cInBuffer ) - nCursPos - 1 ) - ::oQTObject:setText( LEFT(cInBufferLeft + cInBufferRight, ::nMaxLength) ) - ::oQTObject:setCursorPosition( nCursPos ) - ENDIF - ENDIF - IF ValType( ::bOnChange ) != 'U' Eval( ::bOnChange ) ENDIF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ri...@us...> - 2011-12-27 17:28:35
|
Revision: 879 http://hmg.svn.sourceforge.net/hmg/?rev=879&view=rev Author: ricciz Date: 2011-12-27 17:28:27 +0000 (Tue, 27 Dec 2011) Log Message: ----------- Modified Paths: -------------- Changelog source/textboxsimple.prg Modified: Changelog =================================================================== --- Changelog 2011-12-27 16:13:45 UTC (rev 878) +++ Changelog 2011-12-27 17:28:27 UTC (rev 879) @@ -16,6 +16,10 @@ The license applies to all entries newer than 2009-04-28. */ +2011-12-27 18:30 UTC+0100 Ricci Zepmeusel ( ricci at conzoft.de ) + * source/textboxsimple.prg + ! some minor changes + 2011-12-27 17:15 UTC+0100 Ricci Zepmeusel ( ricci at conzoft.de ) + source/textboxsimple.prg ! new "text only" input class Modified: source/textboxsimple.prg =================================================================== --- source/textboxsimple.prg 2011-12-27 16:13:45 UTC (rev 878) +++ source/textboxsimple.prg 2011-12-27 17:28:27 UTC (rev 879) @@ -3,11 +3,27 @@ */ /* - * HMG Source Code + * HMG4 Source Code * - * Copyright 2002-2010 Roberto Lopez <mai...@gm...> - * http://sites.google.com/site/hmgweb/ + * From an original idea of Roberto Lopez, founder of the project + * http://hmgforum.com <hm...@hm...> * + * Developers list: + * + * Carlos Britos ( <bcd12a(a_t)yahoo.com.ar> ) + * Francesco Perillo ( fperillo at gmail.com ) + * Luigi Ferraris ( luigi at l3w.it ) + * Ricci Zepmeusel ( ricci at conzoft.de ) + * Mauricio Ventura Faria (<conc001 a+t gmail com>) + * Pritpal Bedi (bed...@ho...) + * Roberto Lopez ( mai...@gm... ) + * Rathinagiri ( <sr...@da...> ) + * Esgici + * Sudipb + * Martingamez + * Raumi75 + * Mol68 + * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or( at your option ) any later @@ -57,7 +73,6 @@ DATA lLostFocusExecFlag INIT NIL PROTECTED DATA nMaxLength INIT 0 PROTECTED DATA bOnLostFocus INIT NIL PROTECTED - DATA lPassWord INIT .F. PROTECTED // Methods: please preserve alphabetic order. Methods "New" and "Create" must be the first if present METHOD New @@ -82,49 +97,59 @@ ENDCLASS + /*----------------------------------------------------------------------*/ -// Properties +// Methods /*----------------------------------------------------------------------*/ -METHOD Value( cValue ) CLASS TEXTBOXSIMPLE +/*.............................................................................. + New +..............................................................................*/ +METHOD New( cName, oParent ) CLASS TEXTBOXSIMPLE - IF PCOUNT() == 1 .AND. hb_IsChar( cValue ) - ::oQTObject:SetText( TRIM( cValue ) ) + Super:New( cName, oParent ) + + IF hb_IsObject( ::oParent ) + ::oQtObject := QLineEdit( ::oParent:QtParent ) + ELSE + ::oQtObject := QLineEdit() ENDIF -RETURN ::oQTObject:text() + ::oQtFont := ::oQtObject:font() -/*----------------------------------------------------------------------*/ + ::oQtObject:setFocusPolicy( Qt_StrongFocus ) +// ::oQtObject:setAutoFillBackground( .T. ) -METHOD MaxLength( nValue ) CLASS TEXTBOXSIMPLE +RETURN Self - IF Pcount() == 0 - RETURN ::nMaxLength - ELSEIF PCOUNT() == 1 .AND. hb_IsNumeric( nValue ) - ::nMaxLength := nValue - ENDIF +/*.............................................................................. + Create +..............................................................................*/ +METHOD Create() CLASS TEXTBOXSIMPLE - RETURN NIL + ::lCreated := .T. -/*----------------------------------------------------------------------*/ + ::CreatePendingChildControls() // Create inner controls -METHOD CaretPos( nValue ) CLASS TEXTBOXSIMPLE + ::__HmgConnectEv() - IF PCOUNT() == 0 - RETURN ::oQTObject:cursorPosition() - ELSEIF PCOUNT() == 1 .AND. hb_IsNumeric( nValue ) - ::oQTObject:setCursorPosition( nValue ) + IF ::Visible() + ::oQtObject:show() ENDIF - RETURN NIL +RETURN Self + /*----------------------------------------------------------------------*/ +// Properties +/*----------------------------------------------------------------------*/ +/*.............................................................................. + Alignment +..............................................................................*/ METHOD Alignment( nValue ) CLASS TEXTBOXSIMPLE - IF PCOUNT() == 0 - RETURN ::nAlignment - ELSEIF PCOUNT() == 1 .AND. hb_IsNumeric( nValue ) + IF PCOUNT() == 1 .AND. hb_IsNumeric( nValue ) ::nAlignment := nValue IF ::nAlignment == TXT_LEFT ::oQTObject:setAlignment( Qt_AlignLeft ) @@ -133,144 +158,125 @@ ENDIF ENDIF - RETURN NIL +RETURN ::nAlignment -/*----------------------------------------------------------------------*/ +/*.............................................................................. + CaretPos +..............................................................................*/ +METHOD CaretPos( nValue ) CLASS TEXTBOXSIMPLE -METHOD PassWord( lValue ) CLASS TEXTBOXSIMPLE - - IF PCOUNT() == 0 - RETURN ::lPassword - ELSEIF PCOUNT() == 1 .AND. hb_IsLogical( lValue ) - ::lPassword := lValue - IF ::lPassword - ::oQTObject:setEchoMode( QLineEdit_Password ) - ELSE - ::oQTObject:setEchoMode( QLineEdit_Normal ) - ENDIF + IF PCOUNT() == 1 .AND. hb_IsNumeric( nValue ) + ::oQTObject:setCursorPosition( nValue ) ENDIF - RETURN NIL +RETURN ::oQTObject:cursorPosition() -/*----------------------------------------------------------------------*/ -// Events -/*----------------------------------------------------------------------*/ +/*.............................................................................. + MaxLength +..............................................................................*/ +METHOD MaxLength( nValue ) CLASS TEXTBOXSIMPLE + IF PCOUNT() == 1 .AND. hb_IsNumeric( nValue ) + ::nMaxLength := nValue + ENDIF +RETURN ::nMaxLength + +/*.............................................................................. + OnEnter +..............................................................................*/ METHOD OnEnter( bValue ) CLASS TEXTBOXSIMPLE - IF PCOUNT() == 0 - RETURN ::bOnEnter - ELSEIF hb_IsBlock( bValue ) .OR. hb_IsNil( bValue ) + IF hb_IsBlock( bValue ) .OR. hb_IsNil( bValue ) ::bOnEnter := bValue ENDIF - RETURN NIL +RETURN ::bOnEnter -/*----------------------------------------------------------------------*/ -// Methods -/*----------------------------------------------------------------------*/ - /*.............................................................................. - New + PassWord ..............................................................................*/ -METHOD New( cName, oParent ) CLASS TEXTBOXSIMPLE +METHOD PassWord( lValue ) CLASS TEXTBOXSIMPLE - Super:New( cName, oParent ) - - // create QT object - IF ::s_lGridCellFlag // Grid cell textbox should not have row, col and other usual textbox properties - ::oQTObject := QLineEdit() - ELSE - IF hb_IsObject( ::oParent ) - ::oQtObject := QLineEdit( ::oParent:QtParent ) //QLineEdit( ::oParent:QtObject ) - ELSE - ::oQtObject := QLineEdit() - ENDIF + IF PCOUNT() == 1 .AND. hb_IsLogical( lValue ) + ::oQTObject:setEchoMode( IF ( lValue, QLineEdit_Password, QLineEdit_Normal ) ) ENDIF - ::oQtFont := ::oQtObject:font() - ::oQtObject:setFocusPolicy( Qt_StrongFocus ) -// ::oQtObject:setAutoFillBackground( .T. ) +RETURN IF ( ::oQTObject:echoMode == QLineEdit_Normal, .F., .T. ) - RETURN Self +/*.............................................................................. + Value +..............................................................................*/ +METHOD Value( cValue ) CLASS TEXTBOXSIMPLE -/*----------------------------------------------------------------------*/ + IF PCOUNT() == 1 .AND. hb_IsChar( cValue ) + ::oQTObject:SetText( TRIM( cValue ) ) + ENDIF -METHOD Create() CLASS TEXTBOXSIMPLE +RETURN ::oQTObject:text() - LOCAL cStyleSheet, lChanged - ::lCreated := .T. +/*----------------------------------------------------------------------*/ +// Events +/*----------------------------------------------------------------------*/ - IF ! ::lEnabled - cStyleSheet := "" ; lChanged := .F. - IF hb_IsArray( ::aDisabledFontColor ) - cStyleSheet += "color:#" + hb_numtohex( ::aDisabledFontColor[1], 2 ) + hb_numtohex( ::aDisabledFontColor[2], 2 ) + hb_numtohex( ::aDisabledFontColor[3], 2 ) + ";" - lChanged := .T. - ENDIF - IF hb_IsArray( ::aDisabledBackColor ) - cStyleSheet += "background-color:#" + hb_numtohex( ::aDisabledBackColor[1], 2 ) + hb_numtohex( ::aDisabledBackColor[2], 2 ) + hb_numtohex( ::aDisabledBackColor[3], 2 ) + ";" - lChanged := .T. - ENDIF - IF lChanged; Self:StyleSheet( cStyleSheet ) ; ENDIF - ENDIF +/*.............................................................................. + __HmgConnectEv + ATTENTION: this is the most generic connector. Pay attention if you want add other event + If object needs more connected events, overwrite this method and __HmgDisconnectEv() +..............................................................................*/ +METHOD __HmgConnectEv() CLASS TEXTBOXSIMPLE - // Create inner controls - ::CreatePendingChildControls() + ::oQtObject:connect( QEvent_Close, { |oEv| ::__HmgOnCloseExec( oEv ) } ) + ::oQtObject:connect( QEvent_FocusIn, { |oEv| ::__HmgOnGotFocusExec( oEv ) } ) + ::oQtObject:connect( QEvent_FocusOut, { |oEv| ::__HmgOnLostFocusExec( oEv ) } ) - ::__HmgConnectEv() + // hook onchange event + ::oQtObject:connect( "textChanged(QString)", { |cText| ::__HmgTextChange( cText ) } ) + ::oQtObject:connect( "returnPressed()", { |oEv| ::__HmgOnEnterExec( oEv ) } ) - IF ::Visible() - ::oQtObject:show() - ENDIF - RETURN Self +RETURN Self +/*.............................................................................. + __HmgDisconnectEv + ATTENTION: this is the most generic DISconnector. Pay attention if you want add other event + If object has more connected events, overwrite this method and __HmgConnectEv() +..............................................................................*/ +METHOD __HmgDisconnectEv() CLASS TEXTBOXSIMPLE -/*----------------------------------------------------------------------*/ + ::oQtObject:disconnect( QEvent_Close ) + ::oQtObject:disconnect( QEvent_FocusIn ) + ::oQtObject:disconnect( QEvent_FocusOut ) -METHOD __HmgTextChange( cText ) CLASS TEXTBOXSIMPLE - LOCAL icp, InBufferLeft, InBufferRight, InBuffer + ::oQtObject:disconnect( "textChanged(QString)" ) + ::oQtObject:disconnect( "returnPressed()" ) - HB_SYMBOL_UNUSED( cText ) +RETURN Self - icp := ::oQTObject:cursorPosition() +/*.............................................................................. + __HmgOnEnterExec +..............................................................................*/ +METHOD __HmgOnEnterExec( oEvent ) CLASS TEXTBOXSIMPLE - IF ::nMaxLength>0 - InBuffer := ::oQTObject:text() - IF Len( InBuffer ) > ::nMaxLength - InBufferLeft := Left( InBuffer , icp ) - InBufferRight := Right( InBuffer , Len( InBuffer ) - icp - 1 ) - ::oQTObject:setText( LEFT(InBufferLeft + InBufferRight,::nMaxLength) ) - ::oQTObject:setCursorPosition( icp ) - ENDIF - ENDIF + IF hb_IsBlock( ::bOnEnter ) + EVAL( ::bOnEnter ) + ENDIF - IF ValType( ::bOnChange ) != 'U' - Eval( ::bOnChange ) - ENDIF +// ::__HmgSendEvent( Qt_Key_Tab, Qt_NoModifier ) + HB_SYMBOL_UNUSED( oEvent ) -RETURN NIL +RETURN .F. // .F. means don't stop event handler -/*----------------------------------------------------------------------*/ - +/*.............................................................................. + __HmgOnGotFocusExec +..............................................................................*/ METHOD __HmgOnGotFocusExec( oQtEvent ) CLASS TEXTBOXSIMPLE - LOCAL lQtEventStop:= .F. // .F. means don't stop event hanlder, else .T. STOP see Harbour Changelog - LOCAL oQtReason := oQtEvent:reason() + LOCAL oQtReason := oQtEvent:reason() HB_SYMBOL_UNUSED( oQtReason ) -/* IF ::lTabStop == .F. - DO CASE - CASE oQtReason == Qt_BacktabFocusReason - ::__HmgSendEvent( Qt_Key_Tab, Qt_ShiftModifier ) - CASE oQtReason == Qt_TabFocusReason - ::__HmgSendEvent( Qt_Key_Tab, Qt_NoModifier ) - END CASE - RETURN lQtEventStop - ENDIF */ IF hb_IsObject( ::oParent ) HMGAPP():ThisWin( ::FindValidParent(1) ) // try to update current window if found it @@ -285,17 +291,16 @@ ::lGotFocusExecFlag := .F. -RETURN lQtEventStop +RETURN .F. // .F. means don't stop event handler -/*----------------------------------------------------------------------*/ - +/*.............................................................................. + __HmgOnLostFocusExec +..............................................................................*/ METHOD __HmgOnLostFocusExec( oQtEvent ) CLASS TEXTBOXSIMPLE - LOCAL lQtEventStop := .F. // .F. means don't stop event hanlder, else .T. STOP see Harbour Changelog - HB_SYMBOL_UNUSED( oQtEvent ) - ::s_oCurWidget := NIL + ::s_oCurWidget := NIL ::lLostFocusExecFlag := .T. @@ -305,61 +310,34 @@ ::lLostFocusExecFlag := .T. +RETURN .F. // .F. means don't stop event handler -RETURN lQtEventStop - -/*----------------------------------------------------------------------*/ - -METHOD __HmgOnEnterExec( oEvent ) CLASS TEXTBOXSIMPLE - - LOCAL lQtEventStop := .F. // .F. means don't stop event hanlder, else .T. STOP see Harbour Changelog - - IF hb_IsBlock( ::bOnEnter ) - EVAL( ::bOnEnter ) - ENDIF - -// ::__HmgSendEvent( Qt_Key_Tab, Qt_NoModifier ) - - HB_SYMBOL_UNUSED( oEvent ) - -RETURN lQtEventStop - /*.............................................................................. - __HmgConnectEv - ATTENTION: this is the most generic connector. Pay attention if you want add other event - If object needs more connected events, overwrite this method and __HmgDisconnectEv() + __HmgTextChange ..............................................................................*/ -METHOD __HmgConnectEv() CLASS TEXTBOXSIMPLE +METHOD __HmgTextChange( cText ) CLASS TEXTBOXSIMPLE - ::oQtObject:connect( QEvent_Close, { |oEv| ::__HmgOnCloseExec(oEv) } ) - ::oQtObject:connect( QEvent_FocusIn, { |oEv| ::__HmgOnGotFocusExec(oEv) } ) - ::oQtObject:connect( QEvent_FocusOut, { |oEv| ::__HmgOnLostFocusExec(oEv) } ) + LOCAL nCursPos, cInBufferLeft, cInBufferRight, cInBuffer - // hook onchange event -// ::oQTObject:connect( "textEdited(QString)",{|cText| Self:__HmgTextChange( cText )} ) - ::oQtObject:connect( "textChanged(QString)", { |cText| ::__HmgTextChange(cText) } ) - ::oQtObject:connect( "returnPressed()", {|oEv| ::__HmgOnEnterExec(oEv) } ) -// ::oQtObject:connect( "editingFinished()", {|oEv| ::__HmgOnEnterExec(oEv) } ) + HB_SYMBOL_UNUSED( cText ) + nCursPos := ::oQTObject:cursorPosition() -RETURN Self + IF ::nMaxLength > 0 + cInBuffer := ::oQTObject:text() + + IF Len( cInBuffer ) > ::nMaxLength + cInBufferLeft := Left( cInBuffer , nCursPos ) + cInBufferRight := Right( cInBuffer , Len( cInBuffer ) - nCursPos - 1 ) + ::oQTObject:setText( LEFT(cInBufferLeft + cInBufferRight, ::nMaxLength) ) + ::oQTObject:setCursorPosition( nCursPos ) + ENDIF + ENDIF -/*.............................................................................. - __HmgDisconnectEv - ATTENTION: this is the most generic DISconnector. Pay attention if you want add other event - If object has more connected events, overwrite this method and __HmgConnectEv() -..............................................................................*/ -METHOD __HmgDisconnectEv() CLASS TEXTBOXSIMPLE + IF ValType( ::bOnChange ) != 'U' + Eval( ::bOnChange ) + ENDIF - ::oQtObject:disconnect( QEvent_Close ) - ::oQtObject:disconnect( QEvent_FocusIn ) - ::oQtObject:disconnect( QEvent_FocusOut ) +RETURN NIL -// ::oQTObject:disconnect( "textEdited(QString)" ) - ::oQtObject:disconnect( "textChanged(QString)" ) - ::oQtObject:disconnect( "returnPressed()" ) -// ::oQtObject:disconnect( "editingFinished()" ) -RETURN Self - - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ri...@us...> - 2011-12-27 16:13:52
|
Revision: 878 http://hmg.svn.sourceforge.net/hmg/?rev=878&view=rev Author: ricciz Date: 2011-12-27 16:13:45 +0000 (Tue, 27 Dec 2011) Log Message: ----------- Modified Paths: -------------- Changelog hmg.hbp include/hmg.ch Added Paths: ----------- source/textboxsimple.prg Modified: Changelog =================================================================== --- Changelog 2011-12-26 17:19:27 UTC (rev 877) +++ Changelog 2011-12-27 16:13:45 UTC (rev 878) @@ -16,6 +16,10 @@ The license applies to all entries newer than 2009-04-28. */ +2011-12-27 17:15 UTC+0100 Ricci Zepmeusel ( ricci at conzoft.de ) + + source/textboxsimple.prg + ! new "text only" input class + 2011-12-26 18:20 UTC+0100 Ricci Zepmeusel ( ricci at conzoft.de ) * source/datepicker.prg + method InputMask( cValue ) Modified: hmg.hbp =================================================================== --- hmg.hbp 2011-12-26 17:19:27 UTC (rev 877) +++ hmg.hbp 2011-12-27 16:13:45 UTC (rev 878) @@ -65,6 +65,7 @@ source/tab.prg source/tabpage.prg source/textbox.prg +source/textboxsimple.prg source/timer.prg source/toolbar.prg source/toolbutton.prg Modified: include/hmg.ch =================================================================== --- include/hmg.ch 2011-12-26 17:19:27 UTC (rev 877) +++ include/hmg.ch 2011-12-27 16:13:45 UTC (rev 878) @@ -3080,6 +3080,10 @@ With Object [<varname> :=] TEXTBOX():New( <"tagreference">[ , <oParent> ] ) #xcommand END TEXTBOX => End With + #xcommand DEFINE TEXTBOXSIMPLE <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; + With Object [<varname> :=] TEXTBOXSIMPLE():New( <"tagreference">[ , <oParent> ] ) + #xcommand END TEXTBOXSIMPLE => End With + #xcommand DEFINE EDITBOX <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; With Object [<varname> :=] EDITBOX():New( <"tagreference">[ , <oParent> ] ) #xcommand END EDITBOX => End With Added: source/textboxsimple.prg =================================================================== --- source/textboxsimple.prg (rev 0) +++ source/textboxsimple.prg 2011-12-27 16:13:45 UTC (rev 878) @@ -0,0 +1,365 @@ +/* + * $Id: textbox.prg 822 2011-11-27 22:50:25Z fperillo $ + */ + +/* + * HMG Source Code + * + * Copyright 2002-2010 Roberto Lopez <mai...@gm...> + * http://sites.google.com/site/hmgweb/ + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or( at your option ) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License FOR more details. + * + * You should have received a copy of the GNU General Public License along with + * this software; see the file COPYING. IF not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA( or + * visit the web site http://www.gnu.org/ ). + * + * As a special exception, you have permission FOR additional uses of the text + * contained in this release of HMG. + * + * The exception is that, IF you link the HMG library with other + * files to produce an executable, this does not by itself cause the resulting + * executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of linking the + * HMG library code into it. + */ + +#include "hbclass.ch" +#include "common.ch" +#include "hbqtgui.ch" +#include "hmg.ch" + +#ifndef TXT_LEFT + #define TXT_LEFT 0 +#endif +#ifndef TXT_RIGHT + #define TXT_RIGHT 2 +#endif + +/*============================================================================== + TEXTBOXSIMPLE class +==============================================================================*/ +CLASS TEXTBOXSIMPLE FROM CONTROL + + DATA cClass INIT "TEXTBOXSIMPLE" + +// data: please preserve alphabetic order. + DATA nCaretPos INIT 0 PROTECTED + DATA lGotFocusExecFlag INIT NIL PROTECTED + DATA lLostFocusExecFlag INIT NIL PROTECTED + DATA nMaxLength INIT 0 PROTECTED + DATA bOnLostFocus INIT NIL PROTECTED + DATA lPassWord INIT .F. PROTECTED + +// Methods: please preserve alphabetic order. Methods "New" and "Create" must be the first if present + METHOD New + METHOD Create + +// Properties & Events: please preserve alphabetic order. + METHOD Alignment SETGET + METHOD CaretPos SETGET + METHOD MaxLength SETGET + METHOD OnEnter SETGET + METHOD PassWord SETGET + METHOD Value SETGET + +// Connected events handling: please preserve alphabetic order. + + METHOD __HmgConnectEv PROTECTED + METHOD __HmgDisconnectEv PROTECTED + METHOD __HmgOnEnterExec PROTECTED + METHOD __HmgOnGotFocusExec PROTECTED + METHOD __HmgOnLostFocusExec PROTECTED + METHOD __HmgTextChange PROTECTED + +ENDCLASS + +/*----------------------------------------------------------------------*/ +// Properties +/*----------------------------------------------------------------------*/ + +METHOD Value( cValue ) CLASS TEXTBOXSIMPLE + + IF PCOUNT() == 1 .AND. hb_IsChar( cValue ) + ::oQTObject:SetText( TRIM( cValue ) ) + ENDIF + +RETURN ::oQTObject:text() + +/*----------------------------------------------------------------------*/ + +METHOD MaxLength( nValue ) CLASS TEXTBOXSIMPLE + + IF Pcount() == 0 + RETURN ::nMaxLength + ELSEIF PCOUNT() == 1 .AND. hb_IsNumeric( nValue ) + ::nMaxLength := nValue + ENDIF + + RETURN NIL + +/*----------------------------------------------------------------------*/ + +METHOD CaretPos( nValue ) CLASS TEXTBOXSIMPLE + + IF PCOUNT() == 0 + RETURN ::oQTObject:cursorPosition() + ELSEIF PCOUNT() == 1 .AND. hb_IsNumeric( nValue ) + ::oQTObject:setCursorPosition( nValue ) + ENDIF + + RETURN NIL + +/*----------------------------------------------------------------------*/ + +METHOD Alignment( nValue ) CLASS TEXTBOXSIMPLE + + IF PCOUNT() == 0 + RETURN ::nAlignment + ELSEIF PCOUNT() == 1 .AND. hb_IsNumeric( nValue ) + ::nAlignment := nValue + IF ::nAlignment == TXT_LEFT + ::oQTObject:setAlignment( Qt_AlignLeft ) + ELSEIF nValue == TXT_RIGHT + ::oQTObject:setAlignment( Qt_AlignRight ) + ENDIF + ENDIF + + RETURN NIL + +/*----------------------------------------------------------------------*/ + +METHOD PassWord( lValue ) CLASS TEXTBOXSIMPLE + + IF PCOUNT() == 0 + RETURN ::lPassword + ELSEIF PCOUNT() == 1 .AND. hb_IsLogical( lValue ) + ::lPassword := lValue + IF ::lPassword + ::oQTObject:setEchoMode( QLineEdit_Password ) + ELSE + ::oQTObject:setEchoMode( QLineEdit_Normal ) + ENDIF + ENDIF + + RETURN NIL + +/*----------------------------------------------------------------------*/ +// Events +/*----------------------------------------------------------------------*/ + + +METHOD OnEnter( bValue ) CLASS TEXTBOXSIMPLE + + IF PCOUNT() == 0 + RETURN ::bOnEnter + ELSEIF hb_IsBlock( bValue ) .OR. hb_IsNil( bValue ) + ::bOnEnter := bValue + ENDIF + + RETURN NIL + +/*----------------------------------------------------------------------*/ +// Methods +/*----------------------------------------------------------------------*/ + +/*.............................................................................. + New +..............................................................................*/ +METHOD New( cName, oParent ) CLASS TEXTBOXSIMPLE + + Super:New( cName, oParent ) + + // create QT object + IF ::s_lGridCellFlag // Grid cell textbox should not have row, col and other usual textbox properties + ::oQTObject := QLineEdit() + ELSE + IF hb_IsObject( ::oParent ) + ::oQtObject := QLineEdit( ::oParent:QtParent ) //QLineEdit( ::oParent:QtObject ) + ELSE + ::oQtObject := QLineEdit() + ENDIF + ENDIF + + ::oQtFont := ::oQtObject:font() + ::oQtObject:setFocusPolicy( Qt_StrongFocus ) +// ::oQtObject:setAutoFillBackground( .T. ) + + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD Create() CLASS TEXTBOXSIMPLE + + LOCAL cStyleSheet, lChanged + + ::lCreated := .T. + + IF ! ::lEnabled + cStyleSheet := "" ; lChanged := .F. + IF hb_IsArray( ::aDisabledFontColor ) + cStyleSheet += "color:#" + hb_numtohex( ::aDisabledFontColor[1], 2 ) + hb_numtohex( ::aDisabledFontColor[2], 2 ) + hb_numtohex( ::aDisabledFontColor[3], 2 ) + ";" + lChanged := .T. + ENDIF + IF hb_IsArray( ::aDisabledBackColor ) + cStyleSheet += "background-color:#" + hb_numtohex( ::aDisabledBackColor[1], 2 ) + hb_numtohex( ::aDisabledBackColor[2], 2 ) + hb_numtohex( ::aDisabledBackColor[3], 2 ) + ";" + lChanged := .T. + ENDIF + IF lChanged; Self:StyleSheet( cStyleSheet ) ; ENDIF + ENDIF + + // Create inner controls + ::CreatePendingChildControls() + + ::__HmgConnectEv() + + IF ::Visible() + ::oQtObject:show() + ENDIF + + RETURN Self + + +/*----------------------------------------------------------------------*/ + +METHOD __HmgTextChange( cText ) CLASS TEXTBOXSIMPLE + LOCAL icp, InBufferLeft, InBufferRight, InBuffer + + HB_SYMBOL_UNUSED( cText ) + + icp := ::oQTObject:cursorPosition() + + IF ::nMaxLength>0 + InBuffer := ::oQTObject:text() + IF Len( InBuffer ) > ::nMaxLength + InBufferLeft := Left( InBuffer , icp ) + InBufferRight := Right( InBuffer , Len( InBuffer ) - icp - 1 ) + ::oQTObject:setText( LEFT(InBufferLeft + InBufferRight,::nMaxLength) ) + ::oQTObject:setCursorPosition( icp ) + ENDIF + ENDIF + + IF ValType( ::bOnChange ) != 'U' + Eval( ::bOnChange ) + ENDIF + + +RETURN NIL + +/*----------------------------------------------------------------------*/ + +METHOD __HmgOnGotFocusExec( oQtEvent ) CLASS TEXTBOXSIMPLE + + LOCAL lQtEventStop:= .F. // .F. means don't stop event hanlder, else .T. STOP see Harbour Changelog + LOCAL oQtReason := oQtEvent:reason() + + HB_SYMBOL_UNUSED( oQtReason ) +/* IF ::lTabStop == .F. + DO CASE + CASE oQtReason == Qt_BacktabFocusReason + ::__HmgSendEvent( Qt_Key_Tab, Qt_ShiftModifier ) + CASE oQtReason == Qt_TabFocusReason + ::__HmgSendEvent( Qt_Key_Tab, Qt_NoModifier ) + END CASE + RETURN lQtEventStop + ENDIF */ + + IF hb_IsObject( ::oParent ) + HMGAPP():ThisWin( ::FindValidParent(1) ) // try to update current window if found it + ::s_oCurWidget := ::oParent:ChildGet( ::cName ) + ENDIF + + ::lGotFocusExecFlag := .T. + + IF hb_isBlock( ::bOnGotFocus ) + Eval( ::bOnGotFocus ) + ENDIF + + ::lGotFocusExecFlag := .F. + +RETURN lQtEventStop + +/*----------------------------------------------------------------------*/ + +METHOD __HmgOnLostFocusExec( oQtEvent ) CLASS TEXTBOXSIMPLE + + LOCAL lQtEventStop := .F. // .F. means don't stop event hanlder, else .T. STOP see Harbour Changelog + + HB_SYMBOL_UNUSED( oQtEvent ) + + ::s_oCurWidget := NIL + + ::lLostFocusExecFlag := .T. + + IF hb_isBlock( ::bOnLostFocus ) + Eval( ::bOnLostFocus ) + ENDIF + + ::lLostFocusExecFlag := .T. + + +RETURN lQtEventStop + +/*----------------------------------------------------------------------*/ + +METHOD __HmgOnEnterExec( oEvent ) CLASS TEXTBOXSIMPLE + + LOCAL lQtEventStop := .F. // .F. means don't stop event hanlder, else .T. STOP see Harbour Changelog + + IF hb_IsBlock( ::bOnEnter ) + EVAL( ::bOnEnter ) + ENDIF + +// ::__HmgSendEvent( Qt_Key_Tab, Qt_NoModifier ) + + HB_SYMBOL_UNUSED( oEvent ) + +RETURN lQtEventStop + +/*.............................................................................. + __HmgConnectEv + ATTENTION: this is the most generic connector. Pay attention if you want add other event + If object needs more connected events, overwrite this method and __HmgDisconnectEv() +..............................................................................*/ +METHOD __HmgConnectEv() CLASS TEXTBOXSIMPLE + + ::oQtObject:connect( QEvent_Close, { |oEv| ::__HmgOnCloseExec(oEv) } ) + ::oQtObject:connect( QEvent_FocusIn, { |oEv| ::__HmgOnGotFocusExec(oEv) } ) + ::oQtObject:connect( QEvent_FocusOut, { |oEv| ::__HmgOnLostFocusExec(oEv) } ) + + // hook onchange event +// ::oQTObject:connect( "textEdited(QString)",{|cText| Self:__HmgTextChange( cText )} ) + ::oQtObject:connect( "textChanged(QString)", { |cText| ::__HmgTextChange(cText) } ) + ::oQtObject:connect( "returnPressed()", {|oEv| ::__HmgOnEnterExec(oEv) } ) +// ::oQtObject:connect( "editingFinished()", {|oEv| ::__HmgOnEnterExec(oEv) } ) + + +RETURN Self + +/*.............................................................................. + __HmgDisconnectEv + ATTENTION: this is the most generic DISconnector. Pay attention if you want add other event + If object has more connected events, overwrite this method and __HmgConnectEv() +..............................................................................*/ +METHOD __HmgDisconnectEv() CLASS TEXTBOXSIMPLE + + ::oQtObject:disconnect( QEvent_Close ) + ::oQtObject:disconnect( QEvent_FocusIn ) + ::oQtObject:disconnect( QEvent_FocusOut ) + +// ::oQTObject:disconnect( "textEdited(QString)" ) + ::oQtObject:disconnect( "textChanged(QString)" ) + ::oQtObject:disconnect( "returnPressed()" ) +// ::oQtObject:disconnect( "editingFinished()" ) + +RETURN Self + + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ri...@us...> - 2011-12-26 17:19:34
|
Revision: 877 http://hmg.svn.sourceforge.net/hmg/?rev=877&view=rev Author: ricciz Date: 2011-12-26 17:19:27 +0000 (Mon, 26 Dec 2011) Log Message: ----------- Modified Paths: -------------- Changelog source/datepicker.prg source/hyperlink.prg Modified: Changelog =================================================================== --- Changelog 2011-12-26 11:16:05 UTC (rev 876) +++ Changelog 2011-12-26 17:19:27 UTC (rev 877) @@ -16,6 +16,13 @@ The license applies to all entries newer than 2009-04-28. */ +2011-12-26 18:20 UTC+0100 Ricci Zepmeusel ( ricci at conzoft.de ) + * source/datepicker.prg + + method InputMask( cValue ) + * source/hyperlink.prg + ! now call the browser even ther is no "http:/" in link adress + and email program only if "@" is in link adress + 2011-12-26 12:15 UTC+0100 Ricci Zepmeusel ( ricci at conzoft.de ) * source/numgetc.prg * include/hmg.ch Modified: source/datepicker.prg =================================================================== --- source/datepicker.prg 2011-12-26 11:16:05 UTC (rev 876) +++ source/datepicker.prg 2011-12-26 17:19:27 UTC (rev 877) @@ -50,6 +50,7 @@ // Methods: please preserve alphabetic order. Methods "New" and "Create" must be the first if present METHOD New METHOD Alignment SETGET + METHOD InputMask SETGET METHOD OnChange SETGET METHOD ShowNone SETGET METHOD Symbols SETGET @@ -119,6 +120,17 @@ RETURN NIL /*.............................................................................. + InputMask +..............................................................................*/ +METHOD InputMask( cValue ) CLASS DATEPICKER + + IF PCOUNT() == 1 .AND. hb_IsChar( cValue) + ::oQtObject:setDisplayFormat( cValue ) + ENDIF + +RETURN ::oQtObject:displayFormat() + +/*.............................................................................. OnChange ..............................................................................*/ METHOD OnChange( bValue ) CLASS DATEPICKER Modified: source/hyperlink.prg =================================================================== --- source/hyperlink.prg 2011-12-26 11:16:05 UTC (rev 876) +++ source/hyperlink.prg 2011-12-26 17:19:27 UTC (rev 877) @@ -82,7 +82,7 @@ RETURN ::cAddress ELSEIF PCOUNT() == 1 .AND. hb_IsChar( cValue ) ::cAddress := cValue - IF lower( left( ::cAddress , 7 ) ) == 'http://' + IF AT( "@", ::cAddress ) == 0 cText := "<a href='"+::cAddress+"'>"+::cValue+"</a>" ELSE cText := "<a href='mailto:"+::cAddress+"'>"+::cValue+"</a>" @@ -133,7 +133,7 @@ IF PCOUNT() == 0 RETURN ::oQTObject:Text() ELSEIF PCOUNT() == 1 .AND. hb_IsChar( cValue ) - IF lower( left( ::cAddress , 7 ) ) == 'http://' + IF AT( "@", ::cAddress ) == 0 cText := "<a href='"+::cAddress+"'>"+::cValue+"</a>" ELSE cText := "<a href='mailto:"+::cAddress+"'>"+::cValue+"</a>" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ri...@us...> - 2011-12-26 11:16:11
|
Revision: 876 http://hmg.svn.sourceforge.net/hmg/?rev=876&view=rev Author: ricciz Date: 2011-12-26 11:16:05 +0000 (Mon, 26 Dec 2011) Log Message: ----------- Modified Paths: -------------- Changelog include/hmg.ch samples/numgetc/demo_1.prg source/numgetc.prg Modified: Changelog =================================================================== --- Changelog 2011-12-25 15:38:44 UTC (rev 875) +++ Changelog 2011-12-26 11:16:05 UTC (rev 876) @@ -16,6 +16,12 @@ The license applies to all entries newer than 2009-04-28. */ +2011-12-26 12:15 UTC+0100 Ricci Zepmeusel ( ricci at conzoft.de ) + * source/numgetc.prg + * include/hmg.ch + ! changed THOUSENDS to THOUSANDS + + samples/numgetc/demo_1.prg + 2011-12-25 16:30 UTC+0100 Ricci Zepmeusel ( ricci at conzoft.de ) + source/numgetc.prg ! new numeric input class Modified: include/hmg.ch =================================================================== --- include/hmg.ch 2011-12-25 15:38:44 UTC (rev 875) +++ include/hmg.ch 2011-12-26 11:16:05 UTC (rev 876) @@ -3363,7 +3363,7 @@ #xcommand TABSTOP <value> => :TabStop := <value> #xcommand TABSTOP => :TabStop := .T. #xcommand TBARPLACE <value> => :TBarPlace := <value> - #xcommand THOUSENDS <value> => :Thousends := <value> + #xcommand THOUSANDS <value> => :Thousands := <value> #xcommand TITLE <value> => :Title := <value> #xcommand TITLEBAR <value> => :TitleBar := <value> #xcommand TOOLTIP <value> => :ToolTip := <value> Modified: samples/numgetc/demo_1.prg =================================================================== --- samples/numgetc/demo_1.prg 2011-12-25 15:38:44 UTC (rev 875) +++ samples/numgetc/demo_1.prg 2011-12-26 11:16:05 UTC (rev 876) @@ -14,10 +14,6 @@ LOCAL oWindow HbQt_ErrorSys() - REQUEST HB_CODEPAGE_DEWIN - REQUEST HB_LANG_DEWIN - HB_SetCodePage( "DEWIN" ) - HB_LANGSELECT( "DEWIN" ) DEFINE MAINWINDOW oWindow WIDTH 600 @@ -26,7 +22,7 @@ TITLE "Calculator NUMGET control" ONINIT { || ( oWindow:Center() ) } - DEFINE LABEL oLabel1; ROW 20; COL 10; WIDTH 400; HEIGHT 20; VALUE "US format, 2 decimals, no thousends delimiter"; TABSTOP .F.; END LABEL + DEFINE LABEL oLabel1; ROW 20; COL 10; WIDTH 400; HEIGHT 20; VALUE "US format, 2 decimals, no thousands delimiter"; TABSTOP .F.; END LABEL DEFINE NUMGETC oNumGet1 ROW 20 @@ -34,11 +30,11 @@ WIDTH 160 HEIGHT 20 FORMAT "." - THOUSENDS .F. + THOUSANDS .F. ONENTER { || MsgInfo( hb_ValToExp( oWindow:oNumGet1:Value ) ) } END NUMGETC - DEFINE LABEL oLabel2; ROW 60; COL 10; WIDTH 400; HEIGHT 20; VALUE "US format, 2 decimals, with thousends delimiter"; TABSTOP .F.; END LABEL + DEFINE LABEL oLabel2; ROW 60; COL 10; WIDTH 400; HEIGHT 20; VALUE "US format, 2 decimals, with thousands delimiter"; TABSTOP .F.; END LABEL DEFINE NUMGETC oNumGet2 ROW 60 @@ -46,11 +42,11 @@ WIDTH 160 HEIGHT 20 FORMAT "." - THOUSENDS .T. + THOUSANDS .T. ONENTER { || MsgInfo( hb_ValToExp( oWindow:oNumGet2:Value ) ) } END NUMGETC - DEFINE LABEL oLabel3; ROW 100; COL 10; WIDTH 400; HEIGHT 20; VALUE "European format, 4 decimals, no thousends delimiter"; TABSTOP .F.; END LABEL + DEFINE LABEL oLabel3; ROW 100; COL 10; WIDTH 400; HEIGHT 20; VALUE "European format, 4 decimals, no thousands delimiter"; TABSTOP .F.; END LABEL DEFINE NUMGETC oNumGet3 ROW 100 @@ -58,12 +54,12 @@ WIDTH 160 HEIGHT 20 FORMAT "," - THOUSENDS .F. + THOUSANDS .F. DECIMALS 4 ONENTER { || MsgInfo( hb_ValToExp( oWindow:oNumGet3:Value ) ) } END NUMGETC - DEFINE LABEL oLabel4; ROW 140; COL 10; WIDTH 400; HEIGHT 20; VALUE "European format, no decimals, with thousends delimiter"; TABSTOP .F.; END LABEL + DEFINE LABEL oLabel4; ROW 140; COL 10; WIDTH 400; HEIGHT 20; VALUE "European format, no decimals, with thousands delimiter"; TABSTOP .F.; END LABEL DEFINE NUMGETC oNumGet4 ROW 140 @@ -71,7 +67,7 @@ WIDTH 160 HEIGHT 20 FORMAT "," - THOUSENDS .T. + THOUSANDS .T. DECIMALS 0 ONENTER { || MsgInfo( hb_ValToExp( oWindow:oNumGet4:Value ) ) } END NUMGETC Modified: source/numgetc.prg =================================================================== --- source/numgetc.prg 2011-12-25 15:38:44 UTC (rev 875) +++ source/numgetc.prg 2011-12-26 11:16:05 UTC (rev 876) @@ -1,4 +1,3 @@ - /* * NUMGETC class for HMG * @@ -28,11 +27,10 @@ * NUMGET class into it. */ -#include "hbtrace.ch" +#include "hmg.ch" #include "hbclass.ch" #include "common.ch" #include "hbqtgui.ch" -#include "hmg.ch" /*============================================================================== NUMGETC class @@ -45,7 +43,7 @@ DATA nDecimals INIT 2 PROTECTED DATA cDecimalPoint INIT "A" PROTECTED DATA lIsNegativ INIT .F. PROTECTED - DATA lThousends INIT .F. PROTECTED + DATA lThousands INIT .F. PROTECTED DATA cValue INIT "" PROTECTED DATA nValue INIT 0 PROTECTED @@ -63,7 +61,7 @@ METHOD Decimals SETGET METHOD Format SETGET METHOD OnEnter SETGET - METHOD Thousends SETGET + METHOD Thousands SETGET METHOD Value SETGET ENDCLASS @@ -80,18 +78,17 @@ // create QT object IF hb_IsObject( ::oParent ) - ::oQtObject := QLineEdit( ::oParent:QtParent ) + ::oQtObject := QLabel( ::oParent:QtParent ) ELSE - ::oQtObject := QLineEdit() + ::oQtObject := QLabel() ENDIF ::oQtObject:setAlignment( TXT_RIGHT ) - ::oQtObject:setReadOnly(.T.) ::oQtFont := ::oQtObject:font() ::oQtObject:setFocusPolicy( Qt_StrongFocus ) -// ::oQtObject:setAutoFillBackground( .T. ) + ::oQtObject:setAutoFillBackground( .T. ) RETURN Self @@ -100,23 +97,23 @@ ..............................................................................*/ METHOD Create() CLASS NUMGETC - LOCAL cStyleSheet, lChanged + LOCAL oLineEdit, oPalette, oPalette2 ::lCreated := .T. - IF ! ::lEnabled - cStyleSheet := "" ; lChanged := .F. - IF hb_IsArray( ::aDisabledFontColor ) - cStyleSheet += "color:#" + hb_numtohex( ::aDisabledFontColor[1], 2 ) + hb_numtohex( ::aDisabledFontColor[2], 2 ) + hb_numtohex( ::aDisabledFontColor[3], 2 ) + ";" - lChanged := .T. - ENDIF - IF hb_IsArray( ::aDisabledBackColor ) - cStyleSheet += "background-color:#" + hb_numtohex( ::aDisabledBackColor[1], 2 ) + hb_numtohex( ::aDisabledBackColor[2], 2 ) + hb_numtohex( ::aDisabledBackColor[3], 2 ) + ";" - lChanged := .T. - ENDIF - IF lChanged; Self:StyleSheet( cStyleSheet ) ; ENDIF - ENDIF + ::QtObject:setFrameStyle( QFrame_StyledPanel ) + // copy palette from Textbox to Label + oLineEdit := QLineEdit() + oPalette2 := oLineEdit:palette() + + oPalette := ::oQTObject:palette() + oPalette:SetColor( QPalette_Base, oPalette2:Color( 0, QPalette_Base ) ) + oPalette:SetColor( QPalette_Window, oPalette2:Color( 0, QPalette_Base ) ) + oPalette:SetColor( QPalette_WindowText, oPalette2:Color( 0, QPalette_WindowText ) ) + oPalette:SetColor( QPalette_Text, oPalette2:Color( 0, QPalette_Text ) ) + ::oQTObject:setpalette( oPalette ) + // Create inner controls ::CreatePendingChildControls() @@ -144,7 +141,7 @@ cMask += "." + REPLICATE( "9", MIN( LEN( ::cValue ) - nDecimalPos, ::nDecimals ) ) ENDIF - IF ! ::lThousends + IF ! ::lThousands cMask := STRTRAN( cMask, ",", "" ) ENDIF @@ -260,14 +257,14 @@ RETURN NIL /*.............................................................................. - Thousends + Thousands ..............................................................................*/ -METHOD Thousends( lValue ) CLASS NUMGETC +METHOD Thousands( lValue ) CLASS NUMGETC IF PCOUNT() == 0 - RETURN ::lThousends + RETURN ::lThousands ELSEIF PCOUNT() == 1 .AND. hb_IsLogical( lValue ) - ::lThousends := lValue + ::lThousands := lValue IF ::lCreated ::DisplayNumber() @@ -296,5 +293,4 @@ ENDIF ENDIF -RETURN NIL - +RETURN NIL \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ri...@us...> - 2011-12-25 15:38:51
|
Revision: 875 http://hmg.svn.sourceforge.net/hmg/?rev=875&view=rev Author: ricciz Date: 2011-12-25 15:38:44 +0000 (Sun, 25 Dec 2011) Log Message: ----------- Modified Paths: -------------- Changelog hmg.hbp include/hmg.ch Added Paths: ----------- samples/numgetc/ samples/numgetc/build.bat samples/numgetc/demo_1.prg samples/numgetc/hbmk.hbm samples/numgetc/qt.conf source/numgetc.prg Modified: Changelog =================================================================== --- Changelog 2011-12-22 23:19:45 UTC (rev 874) +++ Changelog 2011-12-25 15:38:44 UTC (rev 875) @@ -16,6 +16,19 @@ The license applies to all entries newer than 2009-04-28. */ +2011-12-25 16:30 UTC+0100 Ricci Zepmeusel ( ricci at conzoft.de ) + + source/numgetc.prg + ! new numeric input class + * hmg.hbp + ! please rebuild your library with buildlib.bat + * include/hmg.ch + ! new commands: + + DEFINE NUMGETC / END NUMGETC + + DECIMALS <nvalue> + + THOUSENDS <nvalue> + + samples/numgetc/demo_1.prg + ! demonstration of the new class + 2011-12-23 00:05 UTC+0100 Luigi Ferraris ( <luigi at l3w.it> ) * source/abstractbutton.prg * removed lChecked internal var Modified: hmg.hbp =================================================================== --- hmg.hbp 2011-12-22 23:19:45 UTC (rev 874) +++ hmg.hbp 2011-12-25 15:38:44 UTC (rev 875) @@ -52,6 +52,7 @@ source/modalwindow.prg source/monthcalendar.prg source/msgbox.prg +source/numgetc.prg source/notifymenu.prg source/printer.prg source/progressbar.prg Modified: include/hmg.ch =================================================================== --- include/hmg.ch 2011-12-22 23:19:45 UTC (rev 874) +++ include/hmg.ch 2011-12-25 15:38:44 UTC (rev 875) @@ -3163,6 +3163,9 @@ With Object [<varname> :=] LCD():New( <"tagreference">[ , <oParent> ] ) #xcommand END LCD => End With + #xcommand DEFINE NUMGETC <tagreference>[ <dummy1: OF, PARENT> <oParent> ] [ TOVAR <varname> ] => ; + With Object [<varname> :=] NUMGETC():New( <"tagreference">[ , <oParent> ] ) + #xcommand END NUMGETC => End With // One-liner definitions // @@ -3208,6 +3211,7 @@ #xcommand DATATYPE NUMERIC => :DataType := 1 #xcommand DATE <value> => :DataType := If(<value>,2,0) #xcommand DAYNAME <value> => :Dayname := <value> + #xcommand DECIMALS <value> => :Decimals := <value> #xcommand DISABLED => :Enabled := .F. #xcommand DISABLEDBACKCOLOR <value> => :DisabledBackColor := <value> #xcommand DISABLEDFONTCOLOR <value> => :DisabledFontColor := <value> @@ -3359,6 +3363,7 @@ #xcommand TABSTOP <value> => :TabStop := <value> #xcommand TABSTOP => :TabStop := .T. #xcommand TBARPLACE <value> => :TBarPlace := <value> + #xcommand THOUSENDS <value> => :Thousends := <value> #xcommand TITLE <value> => :Title := <value> #xcommand TITLEBAR <value> => :TitleBar := <value> #xcommand TOOLTIP <value> => :ToolTip := <value> Added: samples/numgetc/build.bat =================================================================== --- samples/numgetc/build.bat (rev 0) +++ samples/numgetc/build.bat 2011-12-25 15:38:44 UTC (rev 875) @@ -0,0 +1,2 @@ +@echo off +..\..\buildapp.bat %1 %2 %3 %4 %5 %6 %7 %8 -run \ No newline at end of file Added: samples/numgetc/demo_1.prg =================================================================== --- samples/numgetc/demo_1.prg (rev 0) +++ samples/numgetc/demo_1.prg 2011-12-25 15:38:44 UTC (rev 875) @@ -0,0 +1,84 @@ +/* + * HMG 4 demo + * + * By Ricci Zepmeusel (ricci at conzoft.de) +*/ + +#include "hmg.ch" +#include "hbclass.ch" +#include "common.ch" +#include "hbqtgui.ch" + +FUNCTION Main + + LOCAL oWindow + + HbQt_ErrorSys() + REQUEST HB_CODEPAGE_DEWIN + REQUEST HB_LANG_DEWIN + HB_SetCodePage( "DEWIN" ) + HB_LANGSELECT( "DEWIN" ) + + DEFINE MAINWINDOW oWindow + WIDTH 600 + HEIGHT 400 + FONT "ARIAL"; SIZE 09 + TITLE "Calculator NUMGET control" + ONINIT { || ( oWindow:Center() ) } + + DEFINE LABEL oLabel1; ROW 20; COL 10; WIDTH 400; HEIGHT 20; VALUE "US format, 2 decimals, no thousends delimiter"; TABSTOP .F.; END LABEL + + DEFINE NUMGETC oNumGet1 + ROW 20 + COL 420 + WIDTH 160 + HEIGHT 20 + FORMAT "." + THOUSENDS .F. + ONENTER { || MsgInfo( hb_ValToExp( oWindow:oNumGet1:Value ) ) } + END NUMGETC + + DEFINE LABEL oLabel2; ROW 60; COL 10; WIDTH 400; HEIGHT 20; VALUE "US format, 2 decimals, with thousends delimiter"; TABSTOP .F.; END LABEL + + DEFINE NUMGETC oNumGet2 + ROW 60 + COL 420 + WIDTH 160 + HEIGHT 20 + FORMAT "." + THOUSENDS .T. + ONENTER { || MsgInfo( hb_ValToExp( oWindow:oNumGet2:Value ) ) } + END NUMGETC + + DEFINE LABEL oLabel3; ROW 100; COL 10; WIDTH 400; HEIGHT 20; VALUE "European format, 4 decimals, no thousends delimiter"; TABSTOP .F.; END LABEL + + DEFINE NUMGETC oNumGet3 + ROW 100 + COL 420 + WIDTH 160 + HEIGHT 20 + FORMAT "," + THOUSENDS .F. + DECIMALS 4 + ONENTER { || MsgInfo( hb_ValToExp( oWindow:oNumGet3:Value ) ) } + END NUMGETC + + DEFINE LABEL oLabel4; ROW 140; COL 10; WIDTH 400; HEIGHT 20; VALUE "European format, no decimals, with thousends delimiter"; TABSTOP .F.; END LABEL + + DEFINE NUMGETC oNumGet4 + ROW 140 + COL 420 + WIDTH 160 + HEIGHT 20 + FORMAT "," + THOUSENDS .T. + DECIMALS 0 + ONENTER { || MsgInfo( hb_ValToExp( oWindow:oNumGet4:Value ) ) } + END NUMGETC + + END WINDOW + + oWindow:Activate() + +RETURN NIL + Added: samples/numgetc/hbmk.hbm =================================================================== --- samples/numgetc/hbmk.hbm (rev 0) +++ samples/numgetc/hbmk.hbm 2011-12-25 15:38:44 UTC (rev 875) @@ -0,0 +1 @@ +../../hmg.hbc \ No newline at end of file Added: samples/numgetc/qt.conf =================================================================== --- samples/numgetc/qt.conf (rev 0) +++ samples/numgetc/qt.conf 2011-12-25 15:38:44 UTC (rev 875) @@ -0,0 +1,2 @@ +[Paths] +plugins=../../../qt/plugins \ No newline at end of file Added: source/numgetc.prg =================================================================== --- source/numgetc.prg (rev 0) +++ source/numgetc.prg 2011-12-25 15:38:44 UTC (rev 875) @@ -0,0 +1,300 @@ + +/* + * NUMGETC class for HMG + * + * Copyright 2011 Ricci Zepmeusel (info at conzoft.de) + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or( at your option ) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License FOR more details. + * + * You should have received a copy of the GNU General Public License along with + * this software; see the file COPYING. IF not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA( or + * visit the web site http://www.gnu.org/ ). + * + * As a special exception, you have permission FOR additional uses of the text + * contained in this file. + * + * The exception is that: If you link the this class to produce an executable, + * this does not by itself cause the resulting executable to be covered by the + * GNU General Public License. + * Your use of that executable is in no way restricted on account of linking the + * NUMGET class into it. + */ + +#include "hbtrace.ch" +#include "hbclass.ch" +#include "common.ch" +#include "hbqtgui.ch" +#include "hmg.ch" + +/*============================================================================== + NUMGETC class +==============================================================================*/ +CLASS NUMGETC FROM CONTROL + + DATA cClass INIT "NUMGETC" + +// data: please preserve alphabetic order. + DATA nDecimals INIT 2 PROTECTED + DATA cDecimalPoint INIT "A" PROTECTED + DATA lIsNegativ INIT .F. PROTECTED + DATA lThousends INIT .F. PROTECTED + DATA cValue INIT "" PROTECTED + DATA nValue INIT 0 PROTECTED + +// Methods: please preserve alphabetic order. Methods "New" and "Create" must be the first if present + METHOD New + METHOD Create + METHOD DisplayNumber + +// Connected events handling: please preserve alphabetic order. + METHOD __HMGGotFocus + METHOD __HMGLostFocus + METHOD DoKeyBoardEvents + +// Properties & Events: please preserve alphabetic order. + METHOD Decimals SETGET + METHOD Format SETGET + METHOD OnEnter SETGET + METHOD Thousends SETGET + METHOD Value SETGET +ENDCLASS + +/*----------------------------------------------------------------------*/ +// Methods +/*----------------------------------------------------------------------*/ + +/*.............................................................................. + New +..............................................................................*/ +METHOD New( cName, oParent ) CLASS NUMGETC + + Super:New( cName, oParent ) + + // create QT object + IF hb_IsObject( ::oParent ) + ::oQtObject := QLineEdit( ::oParent:QtParent ) + ELSE + ::oQtObject := QLineEdit() + ENDIF + + ::oQtObject:setAlignment( TXT_RIGHT ) + ::oQtObject:setReadOnly(.T.) + + ::oQtFont := ::oQtObject:font() + + ::oQtObject:setFocusPolicy( Qt_StrongFocus ) +// ::oQtObject:setAutoFillBackground( .T. ) + +RETURN Self + +/*.............................................................................. + Create +..............................................................................*/ +METHOD Create() CLASS NUMGETC + + LOCAL cStyleSheet, lChanged + + ::lCreated := .T. + + IF ! ::lEnabled + cStyleSheet := "" ; lChanged := .F. + IF hb_IsArray( ::aDisabledFontColor ) + cStyleSheet += "color:#" + hb_numtohex( ::aDisabledFontColor[1], 2 ) + hb_numtohex( ::aDisabledFontColor[2], 2 ) + hb_numtohex( ::aDisabledFontColor[3], 2 ) + ";" + lChanged := .T. + ENDIF + IF hb_IsArray( ::aDisabledBackColor ) + cStyleSheet += "background-color:#" + hb_numtohex( ::aDisabledBackColor[1], 2 ) + hb_numtohex( ::aDisabledBackColor[2], 2 ) + hb_numtohex( ::aDisabledBackColor[3], 2 ) + ";" + lChanged := .T. + ENDIF + IF lChanged; Self:StyleSheet( cStyleSheet ) ; ENDIF + ENDIF + + // Create inner controls + ::CreatePendingChildControls() + + ::oQTObject:connect( QEvent_KeyPress, { |e| ::DoKeyBoardEvents( e )} ) + ::oQtObject:connect( QEvent_FocusIn, { |e| ::__HMGGotFocus( e ) } ) + ::oQtObject:connect( QEvent_FocusOut, { |e| ::__HMGLostFocus( e ) } ) + + IF ::Visible() + ::oQtObject:show() + ENDIF + + ::DisplayNumber() + +RETURN Self + +/*.............................................................................. + DisplayNumber +..............................................................................*/ +METHOD DisplayNumber() CLASS NUMGETC + + LOCAL cMask := IF( ::cDecimalPoint == ",", "@E ", "" ) + "999,999,999,999,999,999" + LOCAL nDecimalPos := AT( ".", ::cValue) + + IF nDecimalPos > 0 + cMask += "." + REPLICATE( "9", MIN( LEN( ::cValue ) - nDecimalPos, ::nDecimals ) ) + ENDIF + + IF ! ::lThousends + cMask := STRTRAN( cMask, ",", "" ) + ENDIF + + ::nValue := VAL( ::cValue ) + + ::oQtObject:setText( IF( ::lIsNegativ, "-", "" ) + ALLTRIM( TRANSFORM( ::nValue, cMask ) ) + IF( ::oQtObject:hasFocus(), " <", " " ) ) + +RETURN NIL + +/*.............................................................................. + __HMGGotFocus +..............................................................................*/ +METHOD __HMGGotFocus() CLASS NUMGETC + + ::DisplayNumber() + +RETURN .F. + +/*.............................................................................. + __HMGLostFocus +..............................................................................*/ +METHOD __HMGLostFocus() CLASS NUMGETC + + ::DisplayNumber() + +RETURN .F. + +/*.............................................................................. + DoKeyBoardEvents +..............................................................................*/ +METHOD DoKeyBoardEvents( oKeyEvent ) CLASS NUMGETC + + LOCAL nKey := oKeyEvent:key() + LOCAL lReturn := .T. + LOCAL nDecimalPos := AT( ".", ::cValue) + + IF nKey == ASC( "-" ) + ::lIsNegativ := ! ::lIsNegativ + + ELSEIF ( nKey == ASC( "." ) .OR. nKey == ASC( "," ) ) + IF ::nDecimals > 0 .AND. nDecimalPos == 0 + ::cValue += "." // insert decimal point + ENDIF + + ELSEIF nKey == Qt_Key_Backspace + IF ! ::cValue == "" + ::cValue := LEFT( ::cValue, LEN( ::cValue ) - 1 ) + ENDIF + + ELSEIF ! ( nKey < ASC( "0" ) .OR. nKey > ASC( "9" ) ) + IF ::nDecimals == 0 .OR. nDecimalPos == 0 .OR. LEN( ::cValue ) - nDecimalPos < ::nDecimals + ::cValue += CHR( nKey ) // insert number + ENDIF + + ELSEIF nKey == Qt_Key_Return .OR. nKey == Qt_Key_Enter + EVAL( ::bOnEnter ) + + ELSE + lReturn := .F. // .F. = continue event processing + ENDIF + + IF lReturn + ::DisplayNumber() + ENDIF + +RETURN lReturn + +/*.............................................................................. + Decimals +..............................................................................*/ +METHOD Decimals( nValue ) CLASS NUMGETC + + IF PCOUNT() == 0 + RETURN ::nDecimals + ELSEIF PCOUNT() == 1 .AND. hb_IsNumeric( nValue ) .AND. nValue >= 0 + ::nDecimals := nValue + + IF ::lCreated + ::DisplayNumber() + ENDIF + ENDIF + +RETURN NIL + +/*.............................................................................. + Format +..............................................................................*/ +METHOD Format( cValue ) CLASS NUMGETC + + IF PCOUNT() == 0 + RETURN ::cDecimalPoint + ELSEIF PCOUNT() == 1 .AND. hb_IsChar( cValue ) .AND. cValue $ "A.," + ::cDecimalPoint := IF( cValue == "A", HMGAPP():DecimalPoint(), cValue ) + + IF ::lCreated + ::DisplayNumber() + ENDIF + ENDIF + +RETURN NIL + +/*.............................................................................. + OnEnter +..............................................................................*/ +METHOD OnEnter( bValue ) CLASS NUMGETC + + IF PCOUNT() == 0 + RETURN ::bOnEnter + ELSEIF hb_IsBlock( bValue ) .OR. hb_IsNil( bValue ) + ::bOnEnter := bValue + ENDIF + + RETURN NIL + +/*.............................................................................. + Thousends +..............................................................................*/ +METHOD Thousends( lValue ) CLASS NUMGETC + + IF PCOUNT() == 0 + RETURN ::lThousends + ELSEIF PCOUNT() == 1 .AND. hb_IsLogical( lValue ) + ::lThousends := lValue + + IF ::lCreated + ::DisplayNumber() + ENDIF + ENDIF + +RETURN NIL + +/*.............................................................................. + Value +..............................................................................*/ +METHOD Value( nValue ) CLASS NUMGETC + + IF PCOUNT() == 0 + RETURN ::nValue * IF( ::lIsNegativ, -1, 1 ) + ELSEIF PCOUNT() == 1 .AND. hb_IsNumeric( nValue ) .AND. ! nValue == 0 + IF nValue < 0 + ::lIsNegativ := .T. + ENDIF + + ::nValue := ABS( nValue ) + ::cValue := ALLTRIM( TRANSFORM( ::nValue, "999999999999999999" + IF( ::nDecimals > 0, "." + REPLICATE( "9", ::nDecimals ), ) ) ) + + IF ::lCreated + ::DisplayNumber() + ENDIF + ENDIF + +RETURN NIL + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <l3...@us...> - 2011-12-22 23:19:54
|
Revision: 874 http://hmg.svn.sourceforge.net/hmg/?rev=874&view=rev Author: l3wonsf Date: 2011-12-22 23:19:45 +0000 (Thu, 22 Dec 2011) Log Message: ----------- 2011-12-23 00:05 UTC+0100 Luigi Ferraris ( <luigi at l3w.it> ) * source/abstractbutton.prg * removed lChecked internal var + CheckAble() method to know if check-able * samples/alldemo/demo_1p000.prg * samples/alldemo/demo_1p001.prg * samples/alldemo/demo_1p002.prg * samples/alldemo/demo_1p003.prg * samples/alldemo/demo_1p004.prg * samples/alldemo/demo_1p005.prg * samples/alldemo/demo_1p006.prg * samples/alldemo/demo_1p007.prg * samples/alldemo/demo_1p008.prg * samples/alldemo/demo_1p009.prg * samples/alldemo/demo_1p010.prg * samples/alldemo/demo_1p011.prg * samples/alldemo/demo_1p012.prg * revised items menu and related calling methods Modified Paths: -------------- Changelog samples/alldemo/demo_1p000.prg samples/alldemo/demo_1p001.prg samples/alldemo/demo_1p002.prg samples/alldemo/demo_1p003.prg samples/alldemo/demo_1p004.prg samples/alldemo/demo_1p005.prg samples/alldemo/demo_1p006.prg samples/alldemo/demo_1p007.prg samples/alldemo/demo_1p008.prg samples/alldemo/demo_1p009.prg samples/alldemo/demo_1p010.prg samples/alldemo/demo_1p011.prg samples/alldemo/demo_1p012.prg source/abstractbutton.prg Modified: Changelog =================================================================== --- Changelog 2011-12-22 21:15:33 UTC (rev 873) +++ Changelog 2011-12-22 23:19:45 UTC (rev 874) @@ -16,6 +16,26 @@ The license applies to all entries newer than 2009-04-28. */ +2011-12-23 00:05 UTC+0100 Luigi Ferraris ( <luigi at l3w.it> ) + * source/abstractbutton.prg + * removed lChecked internal var + + CheckAble() method to know if check-able + + * samples/alldemo/demo_1p000.prg + * samples/alldemo/demo_1p001.prg + * samples/alldemo/demo_1p002.prg + * samples/alldemo/demo_1p003.prg + * samples/alldemo/demo_1p004.prg + * samples/alldemo/demo_1p005.prg + * samples/alldemo/demo_1p006.prg + * samples/alldemo/demo_1p007.prg + * samples/alldemo/demo_1p008.prg + * samples/alldemo/demo_1p009.prg + * samples/alldemo/demo_1p010.prg + * samples/alldemo/demo_1p011.prg + * samples/alldemo/demo_1p012.prg + * revised items menu and related calling methods + 2011-12-22 22:15 UTC+0100 Ricci Zepmeusel ( ricci at conzoft.de ) * samples/drag_and_drop/demo_1_cmd.prg ! source/combobox.prg Modified: samples/alldemo/demo_1p000.prg =================================================================== --- samples/alldemo/demo_1p000.prg 2011-12-22 21:15:33 UTC (rev 873) +++ samples/alldemo/demo_1p000.prg 2011-12-22 23:19:45 UTC (rev 874) @@ -20,9 +20,8 @@ :Icon := ":HMG_ICO" :OnInit := { || FrmOnInit() } - // define menu WITH OBJECT MAINMENU():New( "MainMenu" ) - // popup file + WITH OBJECT MENUPOPUP():New( "File", NIL, "&File" ) WITH OBJECT MENUITEM():New( "File_Exit" ) :Caption := "e&Xit" @@ -30,6 +29,7 @@ :Image := ":EXIT" END WITH END WITH + END WITH // define status bar Modified: samples/alldemo/demo_1p001.prg =================================================================== --- samples/alldemo/demo_1p001.prg 2011-12-22 21:15:33 UTC (rev 873) +++ samples/alldemo/demo_1p001.prg 2011-12-22 23:19:45 UTC (rev 874) @@ -21,14 +21,24 @@ :OnInit := { || FrmOnInit() } // define menu - WITH OBJECT MAINMENU():New( "MainMenu" ) - WITH OBJECT MENUPOPUP():New( "File", NIL, "&File" ) + WITH OBJECT MAINMENU():New() + + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&File" ) WITH OBJECT MENUITEM():New( NIL, NIL, "e&Xit", { || FrmExit() }, ":EXIT" ) ; END WITH END WITH - WITH OBJECT MENUPOPUP():New( "Options", NIL, "&Options" ) - WITH OBJECT MENUITEM():New( "Visib", NIL, "&Visible", { || ActionMenu( 200 ) } ) ; END WITH - WITH OBJECT MENUITEM():New( "Enabl", NIL, "&Enable", { || ActionMenu( 201 ) } ) ; END WITH + + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&Options" ) + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&Visible" ) + WITH OBJECT MENUITEM():New( NIL, NIL, "&Show", { || ActionMenu( 200 ) } ) ; END WITH + WITH OBJECT MENUITEM():New( NIL, NIL, "&Hide", { || ActionMenu( 201 ) } ) ; END WITH + END WITH + :AddSeparator() + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&Enable" ) + WITH OBJECT MENUITEM():New( NIL, NIL, "&Enable", { || ActionMenu( 202 ) } ) ; END WITH + WITH OBJECT MENUITEM():New( NIL, NIL, "&Disable", { || ActionMenu( 203 ) } ) ; END WITH + END WITH END WITH + END WITH // define status bar @@ -88,8 +98,6 @@ STATIC FUNCTION FrmOnInit() THISWINDOW:Center() - THISWINDOW:MainMenu:Options:Visib:Checked := .T. - THISWINDOW:MainMenu:Options:Enabl:Checked := .T. RETURN NIL @@ -140,11 +148,13 @@ DO CASE CASE nOption == 200 - THISWINDOW:MainMenu:Options:Visib:Checked := IIF( THISWINDOW:MainMenu:Options:Visib:Checked == .T., .F., .T. ) - THISWINDOW:AnimateBox1:Visible := THISWINDOW:MainMenu:Options:Visib:Checked + THISWINDOW:AnimateBox1:Visible := .T. CASE nOption == 201 - THISWINDOW:MainMenu:Options:Enabl:Checked := IIF( THISWINDOW:MainMenu:Options:Enabl:Checked == .T., .F., .T. ) - THISWINDOW:AnimateBox1:Enabled := THISWINDOW:MainMenu:Options:Enabl:Checked + THISWINDOW:AnimateBox1:Visible := .F. + CASE nOption == 202 + THISWINDOW:AnimateBox1:Enabled := .T. + CASE nOption == 203 + THISWINDOW:AnimateBox1:Enabled := .F. END CASE Modified: samples/alldemo/demo_1p002.prg =================================================================== --- samples/alldemo/demo_1p002.prg 2011-12-22 21:15:33 UTC (rev 873) +++ samples/alldemo/demo_1p002.prg 2011-12-22 23:19:45 UTC (rev 874) @@ -21,14 +21,24 @@ :OnInit := { || FrmOnInit() } // define menu - WITH OBJECT MAINMENU():New( "MainMenu" ) - WITH OBJECT MENUPOPUP():New( "File", NIL, "&File" ) + WITH OBJECT MAINMENU():New() + + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&File" ) WITH OBJECT MENUITEM():New( NIL, NIL, "e&Xit", { || FrmExit() }, ":EXIT" ) ; END WITH END WITH - WITH OBJECT MENUPOPUP():New( "Options", NIL, "&Options" ) - WITH OBJECT MENUITEM():New( "Visib", NIL, "&Visible", { || ActionMenu( 200 ) } ) ; END WITH - WITH OBJECT MENUITEM():New( "Enabl", NIL, "&Enable", { || ActionMenu( 201 ) } ) ; END WITH + + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&Options" ) + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&Visible" ) + WITH OBJECT MENUITEM():New( NIL, NIL, "&Show", { || ActionMenu( 200 ) } ) ; END WITH + WITH OBJECT MENUITEM():New( NIL, NIL, "&Hide", { || ActionMenu( 201 ) } ) ; END WITH + END WITH + :AddSeparator() + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&Enable" ) + WITH OBJECT MENUITEM():New( NIL, NIL, "&Enable", { || ActionMenu( 202 ) } ) ; END WITH + WITH OBJECT MENUITEM():New( NIL, NIL, "&Disable", { || ActionMenu( 203 ) } ) ; END WITH + END WITH END WITH + END WITH // define status bar @@ -57,28 +67,28 @@ END WITH WITH OBJECT ToolButton():New( "TbButton2" ) :Picture := ":SIZEBOTH" - :OnClick := { || BitmapScaled(0) } + :OnClick := { || BitmapScaled() } :ToolTip := "Stretch ON/OFF" :Checked := .T. END WITH WITH OBJECT ToolButton():New( "TbButton3" ) :Picture := ":SIZEHEIGHT" - :OnClick := { || BitmapScaled(1) } + :OnClick := { || BitmapScaled() } :ToolTip := "Scaled to height canvas ON/OF" END WITH WITH OBJECT ToolButton():New( "TbButton4" ) :Picture := ":SIZEWIDTH" - :OnClick := { || BitmapScaled(2) } + :OnClick := { || BitmapScaled() } :ToolTip := "Scaled to width canvas ON/OF" END WITH WITH OBJECT ToolButton():New( "TbButton5" ) :Picture := ":SIZEASPECT" - :OnClick := { || BitmapScaled(3) } + :OnClick := { || BitmapScaled() } :ToolTip := "Aspect ratio ON/OF" END WITH WITH OBJECT ToolButton():New( "TbButton6" ) :Picture := ":SIZESMOOTH" - :OnClick := { || BitmapScaled(4) } + :OnClick := { || BitmapScaled() } :ToolTip := "Smooth ON/OF" END WITH END WITH @@ -107,9 +117,13 @@ STATIC FUNCTION FrmOnInit() THISWINDOW:Center() - THISWINDOW:MainMenu:Options:Visib:Checked := .T. - THISWINDOW:MainMenu:Options:Enabl:Checked := .T. + THISWINDOW:ToolBar:TbButton2:Checked := .T. + THISWINDOW:ToolBar:TbButton3:Checked := .F. + THISWINDOW:ToolBar:TbButton4:Checked := .F. + THISWINDOW:ToolBar:TbButton5:Checked := .F. + THISWINDOW:ToolBar:TbButton6:Checked := .F. + RETURN NIL /* @@ -150,31 +164,13 @@ /* Scaling */ -STATIC FUNCTION BitmapScaled( nOption ) +STATIC FUNCTION BitmapScaled() - DO CASE - CASE nOption == 0 //stretch - THISWINDOW:ToolBar:TbButton2:Checked := IIF( THISWINDOW:ToolBar:TbButton2:Checked == .T., .F., .T. ) - THISWINDOW:Image1:Stretch := THISWINDOW:ToolBar:TbButton2:Checked - THISWINDOW:ToolBar:TbButton3:Checked := THISWINDOW:Image1:ScaledToHeight - THISWINDOW:ToolBar:TbButton4:Checked := THISWINDOW:Image1:ScaledToWidth - CASE nOption == 1 //scaled height - THISWINDOW:ToolBar:TbButton3:Checked := IIF( THISWINDOW:ToolBar:TbButton3:Checked == .T., .F., .T. ) - THISWINDOW:ToolBar:TbButton2:Checked := THISWINDOW:Image1:Stretch - THISWINDOW:Image1:ScaledToHeight := THISWINDOW:ToolBar:TbButton3:Checked - THISWINDOW:ToolBar:TbButton4:Checked := THISWINDOW:Image1:ScaledToWidth - CASE nOption == 2 // scaled width - THISWINDOW:ToolBar:TbButton4:Checked := IIF( THISWINDOW:ToolBar:TbButton4:Checked == .T., .F., .T. ) - THISWINDOW:ToolBar:TbButton2:Checked := THISWINDOW:Image1:Stretch - THISWINDOW:ToolBar:TbButton3:Checked := THISWINDOW:Image1:ScaledToHeight - THISWINDOW:Image1:ScaledToWidth := THISWINDOW:ToolBar:TbButton4:Checked - CASE nOption == 3 // aspect ratio - THISWINDOW:ToolBar:TbButton5:Checked := IIF( THISWINDOW:ToolBar:TbButton5:Checked == .T., .F., .T. ) - THISWINDOW:Image1:AspectRatio := THISWINDOW:ToolBar:TbButton5:Checked - CASE nOption == 4 // smoothing - THISWINDOW:ToolBar:TbButton6:Checked := IIF( THISWINDOW:ToolBar:TbButton6:Checked == .T., .F., .T. ) - THISWINDOW:Image1:Smoothing := IIF( THISWINDOW:ToolBar:TbButton6:Checked == .T., Qt_SmoothTransformation, Qt_FastTransformation ) - END CASE + THISWINDOW:Image1:Stretch := THISWINDOW:ToolBar:TbButton2:Checked + THISWINDOW:Image1:ScaledToHeight := THISWINDOW:ToolBar:TbButton3:Checked + THISWINDOW:Image1:ScaledToWidth := THISWINDOW:ToolBar:TbButton4:Checked + THISWINDOW:Image1:AspectRatio := THISWINDOW:ToolBar:TbButton5:Checked + THISWINDOW:Image1:Smoothing := IIF( THISWINDOW:ToolBar:TbButton6:Checked == .T., Qt_SmoothTransformation, Qt_FastTransformation ) RETURN NIL @@ -186,11 +182,13 @@ DO CASE CASE nOption == 200 - THISWINDOW:MainMenu:Options:Visib:Checked := IIF( THISWINDOW:MainMenu:Options:Visib:Checked == .T., .F., .T. ) - THISWINDOW:Image1:Visible := THISWINDOW:MainMenu:Options:Visib:Checked + THISWINDOW:Image1:Visible := .T. CASE nOption == 201 - THISWINDOW:MainMenu:Options:Enabl:Checked := IIF( THISWINDOW:MainMenu:Options:Enabl:Checked == .T., .F., .T. ) - THISWINDOW:Image1:Enabled := THISWINDOW:MainMenu:Options:Enabl:Checked + THISWINDOW:Image1:Visible := .F. + CASE nOption == 202 + THISWINDOW:Image1:Enabled := .T. + CASE nOption == 203 + THISWINDOW:Image1:Enabled := .F. END CASE Modified: samples/alldemo/demo_1p003.prg =================================================================== --- samples/alldemo/demo_1p003.prg 2011-12-22 21:15:33 UTC (rev 873) +++ samples/alldemo/demo_1p003.prg 2011-12-22 23:19:45 UTC (rev 874) @@ -21,33 +21,63 @@ :OnInit := { || FrmOnInit() } // define menu - WITH OBJECT MAINMENU():New( "MainMenu" ) + WITH OBJECT MAINMENU():New() - WITH OBJECT MENUPOPUP():New( "File", NIL, "&File" ) + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&File" ) WITH OBJECT MENUITEM():New( NIL, NIL, "e&Xit", { || FrmExit() }, ":EXIT" ) ; END WITH END WITH - WITH OBJECT MENUPOPUP():New( "Images", NIL, "&Image" ) - WITH OBJECT MENUITEM():New( "ImgOnOff", NIL, "&ON/OFF", { || ActionMenu( 100 ) } ) ; END WITH - WITH OBJECT MENUITEM():New( NIL, NIL, "&Left align", { || ActionMenu( 101 ) } ) ; END WITH - WITH OBJECT MENUITEM():New( NIL, NIL, "&Right align", { || ActionMenu( 102 ) } ) ; END WITH + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&Image" ) + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&ON/OFF" ) + WITH OBJECT MENUITEM():New( NIL, NIL, "&ON", { || ActionMenu( 100 ) } ) ; END WITH + WITH OBJECT MENUITEM():New( NIL, NIL, "O&FF", { || ActionMenu( 101 ) } ) ; END WITH + END WITH + :AddSeparator() + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&Alignment" ) + WITH OBJECT MENUITEM():New( NIL, NIL, "&Left", { || ActionMenu( 102 ) } ) ; END WITH + WITH OBJECT MENUITEM():New( NIL, NIL, "&Right", { || ActionMenu( 103 ) } ) ; END WITH + END WITH END WITH - WITH OBJECT MENUPOPUP():New( "Options", NIL, "&Options" ) - WITH OBJECT MENUITEM():New( "Visib", NIL, "&Visible", { || ActionMenu( 200 ) } ) ; END WITH - WITH OBJECT MENUITEM():New( "Enabl", NIL, "&Enable", { || ActionMenu( 201 ) } ) ; END WITH - WITH OBJECT MENUITEM():New( NIL, NIL, "&Caption", { || ActionMenu( 202 ) } ) ; END WITH - WITH OBJECT MENUITEM():New( NIL, NIL, "&ToolTip", { || ActionMenu( 203 ) } ) ; END WITH - WITH OBJECT MENUITEM():New( "Flatted", NIL, "&Flat", { || ActionMenu( 204 ) } ) ; END WITH - WITH OBJECT MENUITEM():New( NIL, NIL, "&Size", { || ActionMenu( 205 ) } ) ; END WITH - WITH OBJECT MENUITEM():New( NIL, NIL, "&BackColor", { || ActionMenu( 206 ) } ) ; END WITH - WITH OBJECT MENUITEM():New( NIL, NIL, "&FontColor", { || ActionMenu( 207 ) } ) ; END WITH - WITH OBJECT MENUITEM():New( "Check", NIL, "&Checked", { || ActionMenu( 208 ) } ) ; END WITH - WITH OBJECT MENUITEM():New( "AutoSize", NIL, "&AutoSize", { || ActionMenu( 209 ) } ) ; END WITH + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&Options" ) + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&Visible" ) + WITH OBJECT MENUITEM():New( NIL, NIL, "&Show", { || ActionMenu( 200 ) } ) ; END WITH + WITH OBJECT MENUITEM():New( NIL, NIL, "&Hide", { || ActionMenu( 201 ) } ) ; END WITH + END WITH + :AddSeparator() + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&Enable" ) + WITH OBJECT MENUITEM():New( NIL, NIL, "&Enable", { || ActionMenu( 202 ) } ) ; END WITH + WITH OBJECT MENUITEM():New( NIL, NIL, "&Disable", { || ActionMenu( 203 ) } ) ; END WITH + END WITH + :AddSeparator() + WITH OBJECT MENUITEM():New( NIL, NIL, "&Caption", { || ActionMenu( 204 ) } ) ; END WITH + WITH OBJECT MENUITEM():New( NIL, NIL, "&ToolTip", { || ActionMenu( 205 ) } ) ; END WITH + :AddSeparator() + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&Flat" ) + WITH OBJECT MENUITEM():New( NIL, NIL, "&ON", { || ActionMenu( 206 ) } ) ; END WITH + WITH OBJECT MENUITEM():New( NIL, NIL, "O&FF", { || ActionMenu( 207 ) } ) ; END WITH + END WITH + :AddSeparator() + WITH OBJECT MENUITEM():New( NIL, NIL, "&Size", { || ActionMenu( 208 ) } ) ; END WITH + WITH OBJECT MENUITEM():New( NIL, NIL, "&BackColor", { || ActionMenu( 209 ) } ) ; END WITH + WITH OBJECT MENUITEM():New( NIL, NIL, "&FontColor", { || ActionMenu( 210 ) } ) ; END WITH + :AddSeparator() + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&Checked" ) + WITH OBJECT MENUITEM():New( NIL, NIL, "&ON", { || ActionMenu( 211 ) } ) ; END WITH + WITH OBJECT MENUITEM():New( NIL, NIL, "O&FF", { || ActionMenu( 212 ) } ) ; END WITH + END WITH + :AddSeparator() + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&AutoSize" ) + WITH OBJECT MENUITEM():New( NIL, NIL, "&ON", { || ActionMenu( 213 ) } ) ; END WITH + WITH OBJECT MENUITEM():New( NIL, NIL, "O&FF", { || ActionMenu( 214 ) } ) ; END WITH + END WITH END WITH - WITH OBJECT MENUPOPUP():New( "Events", NIL, "&Events" ) - WITH OBJECT MENUITEM():New( "OnClk", NIL, "&OnClick", { || ActionMenu( 300 ) } ) ; END WITH + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&Events" ) + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&OnClick" ) + WITH OBJECT MENUITEM():New( NIL, NIL, "&Enable", { || ActionMenu( 300 ) } ) ; END WITH + WITH OBJECT MENUITEM():New( NIL, NIL, "&Disable", { || ActionMenu( 301 ) } ) ; END WITH + END WITH END WITH END WITH @@ -67,37 +97,37 @@ WITH OBJECT TOOLBAR():New( "ToolBar" ) WITH OBJECT ToolButton():New() :Picture := ":CLEAR" - :OnClick := { || ChangeFont(0) } + :OnClick := { || ChangeFont(.T.) } :ToolTip := "Font normal" END WITH WITH OBJECT ToolButton():New( "TbFntBld" ) :Picture := ":FNTBOLD" - :OnClick := { || ChangeFont(1) } + :OnClick := { || ChangeFont() } :ToolTip := "Bold ON/OFF" END WITH WITH OBJECT ToolButton():New( "TbFntIta" ) :Picture := ":FNTITAL" - :OnClick := { || ChangeFont(2) } + :OnClick := { || ChangeFont() } :ToolTip := "Italic ON/OFF" END WITH WITH OBJECT ToolButton():New( "TbFntStr" ) :Picture := ":FNTSTRK" - :OnClick := { || ChangeFont(3) } + :OnClick := { || ChangeFont() } :ToolTip := "StrikeOut ON/OFF" END WITH WITH OBJECT ToolButton():New( "TbFntUnd" ) :Picture := ":FNTUND" - :OnClick := { || ChangeFont(4) } + :OnClick := { || ChangeFont() } :ToolTip := "Underline ON/OFF" END WITH WITH OBJECT ToolButton():New( "TbFntSiz" ) :Picture := ":FNTSIZE" - :OnClick := { || ChangeFont(5) } + :OnClick := { || ChangeFont() } :ToolTip := "Size ON/OFF" END WITH WITH OBJECT ToolButton():New( "TbFntNam" ) :Picture := ":FNTNAME" - :OnClick := { || ChangeFont(6) } + :OnClick := { || ChangeFont() } :ToolTip := "Name ON/OFF" END WITH END WITH @@ -142,9 +172,14 @@ STATIC FUNCTION FrmOnInit() THISWINDOW:Center() - THISWINDOW:MainMenu:Options:Visib:Checked := .T. - THISWINDOW:MainMenu:Options:Enabl:Checked := .T. + THISWINDOW:ToolBar:TbFntBld:Checked := .F. + THISWINDOW:ToolBar:TbFntIta:Checked := .F. + THISWINDOW:ToolBar:TbFntStr:Checked := .F. + THISWINDOW:ToolBar:TbFntUnd:Checked := .F. + THISWINDOW:ToolBar:TbFntSiz:Checked := .F. + THISWINDOW:ToolBar:TbFntNam:Checked := .F. + RETURN NIL /* @@ -163,33 +198,33 @@ DO CASE CASE nOption == 100 //image - THISWINDOW:MainMenu:Images:ImgOnOff:Checked := IIF( THISWINDOW:MainMenu:Images:ImgOnOff:Checked == .T., .F., .T. ) - IF THISWINDOW:MainMenu:Images:ImgOnOff:Checked == .T. - THISWINDOW:Button1:Picture := ":EJECT" // or file name "./icons/hmg.ico" - THISWINDOW:Button1:ImageWidth := 24 - THISWINDOW:Button1:ImageHeight := 24 - ELSE - THISWINDOW:Button1:Picture := NIL - ENDIF - CASE nOption == 101 //image left + THISWINDOW:Button1:Picture := ":EJECT" // or file name "./icons/hmg.ico" + THISWINDOW:Button1:ImageWidth := 24 + THISWINDOW:Button1:ImageHeight := 24 + CASE nOption == 101 //image + THISWINDOW:Button1:Picture := NIL + CASE nOption == 102 //image left THISWINDOW:Button1:PictAlignment := BTN_LEFT - CASE nOption == 102 //image right + CASE nOption == 103 //image right THISWINDOW:Button1:PictAlignment := BTN_RIGHT CASE nOption == 200 - THISWINDOW:MainMenu:Options:Visib:Checked := IIF( THISWINDOW:MainMenu:Options:Visib:Checked == .T., .F., .T. ) - THISWINDOW:Button1:Visible := THISWINDOW:MainMenu:Options:Visib:Checked + THISWINDOW:Button1:Visible := .T. CASE nOption == 201 - THISWINDOW:MainMenu:Options:Enabl:Checked := IIF( THISWINDOW:MainMenu:Options:Enabl:Checked == .T., .F., .T. ) - THISWINDOW:Button1:Enabled := THISWINDOW:MainMenu:Options:Enabl:Checked + THISWINDOW:Button1:Visible := .F. CASE nOption == 202 - THISWINDOW:Button1:Caption := IIF( THISWINDOW:Button1:Caption == "Default caption", "Changed caption", "Default caption" ) + THISWINDOW:Button1:Enabled := .T. CASE nOption == 203 - THISWINDOW:Button1:Tooltip := IIF( THISWINDOW:Button1:Tooltip == "Default tooltip", "Changed tooltip", "Default tooltip" ) + THISWINDOW:Button1:Enabled := .F. CASE nOption == 204 - THISWINDOW:MainMenu:Options:Flatted:Checked := IIF( THISWINDOW:MainMenu:Options:Flatted:Checked == .T., .F., .T. ) - THISWINDOW:Button1:Flat := THISWINDOW:MainMenu:Options:Flatted:Checked + THISWINDOW:Button1:Caption := IIF( THISWINDOW:Button1:Caption == "Default caption", "Changed caption", "Default caption" ) CASE nOption == 205 + THISWINDOW:Button1:Tooltip := IIF( THISWINDOW:Button1:Tooltip == "Default tooltip", "Changed tooltip", "Default tooltip" ) + CASE nOption == 206 + THISWINDOW:Button1:Flat := .T. + CASE nOption == 207 + THISWINDOW:Button1:Flat := .F. + CASE nOption == 208 IF THISWINDOW:Button1:Width == 150 THISWINDOW:Button1:Width := 300 THISWINDOW:Button1:Height := 60 @@ -197,24 +232,25 @@ THISWINDOW:Button1:Width := 150 THISWINDOW:Button1:Height := 30 ENDIF - CASE nOption == 206 + CASE nOption == 209 THISWINDOW:Button1:StyleSheet := "background-color: rgb(204, 204, 102);" - CASE nOption == 207 + CASE nOption == 210 THISWINDOW:Button1:StyleSheet := "color: rgb(0, 0, 255);" - CASE nOption == 208 - THISWINDOW:MainMenu:Options:Check:Checked := IIF( THISWINDOW:MainMenu:Options:Check:Checked == .T., .F., .T. ) - THISWINDOW:Button1:Checked := THISWINDOW:MainMenu:Options:Check:Checked - CASE nOption == 209 - THISWINDOW:Button1:AutoSize := IIF( THISWINDOW:Button1:AutoSize == .T., .F., .T. ) - THISWINDOW:MainMenu:Options:AutoSize:Checked := THISWINDOW:Button1:AutoSize - IF THISWINDOW:Button1:AutoSize == .F. - THISWINDOW:Button1:Width := 150 - THISWINDOW:Button1:Height := 40 - ENDIF + CASE nOption == 211 + THISWINDOW:Button1:Checked := .T. + CASE nOption == 212 + THISWINDOW:Button1:Checked := .F. + CASE nOption == 213 + THISWINDOW:Button1:AutoSize := .T. + CASE nOption == 214 + THISWINDOW:Button1:AutoSize := .F. + THISWINDOW:Button1:Width := 150 + THISWINDOW:Button1:Height := 40 CASE nOption == 300 - THISWINDOW:MainMenu:Events:OnClk:Checked := IIF( THISWINDOW:MainMenu:Events:OnClk:Checked == .T., .F., .T. ) - THISWINDOW:Button1:OnClick := IIF( THISWINDOW:MainMenu:Events:OnClk:Checked == .T., {|| MsgInfo( "Default message") }, NIL ) + THISWINDOW:Button1:OnClick := {|| MsgInfo( "Default message") } + CASE nOption == 301 + THISWINDOW:Button1:OnClick := NIL END CASE @@ -223,44 +259,24 @@ /* ChangeFont */ -STATIC FUNCTION ChangeFont( nOption ) +STATIC FUNCTION ChangeFont( lOption ) - DO CASE - CASE nOption == 0 - THISWINDOW:Button1:font := HMGAPP():DefaultFont - THISWINDOW:ToolBar:TbFntBld:Checked := .F. - THISWINDOW:ToolBar:TbFntIta:Checked := .F. - THISWINDOW:ToolBar:TbFntStr:Checked := .F. - THISWINDOW:ToolBar:TbFntUnd:Checked := .F. - THISWINDOW:ToolBar:TbFntSiz:Checked := .F. - THISWINDOW:ToolBar:TbFntNam:Checked := .F. - CASE nOption == 1 - THISWINDOW:ToolBar:TbFntBld:Checked := IIF( THISWINDOW:ToolBar:TbFntBld:Checked == .T., .F., .T. ) - CASE nOption == 2 - THISWINDOW:ToolBar:TbFntIta:Checked := IIF( THISWINDOW:ToolBar:TbFntIta:Checked == .T., .F., .T. ) - CASE nOption == 3 - THISWINDOW:ToolBar:TbFntStr:Checked := IIF( THISWINDOW:ToolBar:TbFntStr:Checked == .T., .F., .T. ) - CASE nOption == 4 - THISWINDOW:ToolBar:TbFntUnd:Checked := IIF( THISWINDOW:ToolBar:TbFntUnd:Checked == .T., .F., .T. ) - CASE nOption == 5 - THISWINDOW:ToolBar:TbFntSiz:Checked := IIF( THISWINDOW:ToolBar:TbFntSiz:Checked == .T., .F., .T. ) - IF THISWINDOW:ToolBar:TbFntSiz:Checked == .T. - THISWINDOW:Button1:FontSize := 16 - ELSE - THISWINDOW:Button1:FontSize := HMGAPP():DefaultFontSize - ENDIF - CASE nOption == 6 - THISWINDOW:ToolBar:TbFntNam:Checked := IIF( THISWINDOW:ToolBar:TbFntNam:Checked == .T., .F., .T. ) - IF THISWINDOW:ToolBar:TbFntNam:Checked == .T. - THISWINDOW:Button1:FontName := "Arial" - ELSE - THISWINDOW:Button1:FontName := HMGAPP():DefaultFontName - ENDIF - END CASE + IF hb_IsLogical( lOption ) + THISWINDOW:Button1:font := HMGAPP():DefaultFont + THISWINDOW:ToolBar:TbFntBld:Checked := .F. + THISWINDOW:ToolBar:TbFntIta:Checked := .F. + THISWINDOW:ToolBar:TbFntStr:Checked := .F. + THISWINDOW:ToolBar:TbFntUnd:Checked := .F. + THISWINDOW:ToolBar:TbFntSiz:Checked := .F. + THISWINDOW:ToolBar:TbFntNam:Checked := .F. + ENDIF - THISWINDOW:Button1:FontBold := THISWINDOW:ToolBar:TbFntBld:Checked - THISWINDOW:Button1:FontItalic := THISWINDOW:ToolBar:TbFntIta:Checked - THISWINDOW:Button1:FontStrikeout := THISWINDOW:ToolBar:TbFntStr:Checked - THISWINDOW:Button1:FontUnderLine := THISWINDOW:ToolBar:TbFntUnd:Checked + THISWINDOW:Button1:FontBold := THISWINDOW:ToolBar:TbFntBld:Checked + THISWINDOW:Button1:FontItalic := THISWINDOW:ToolBar:TbFntIta:Checked + THISWINDOW:Button1:FontStrikeout := THISWINDOW:ToolBar:TbFntStr:Checked + THISWINDOW:Button1:FontUnderLine := THISWINDOW:ToolBar:TbFntUnd:Checked + THISWINDOW:Button1:FontSize := IIF( THISWINDOW:ToolBar:TbFntSiz:Checked == .T., 16, HMGAPP():DefaultFontSize ) + THISWINDOW:Button1:FontName := IIF( THISWINDOW:ToolBar:TbFntNam:Checked == .T., "Arial", HMGAPP():DefaultFontName ) + RETURN NIL Modified: samples/alldemo/demo_1p004.prg =================================================================== --- samples/alldemo/demo_1p004.prg 2011-12-22 21:15:33 UTC (rev 873) +++ samples/alldemo/demo_1p004.prg 2011-12-22 23:19:45 UTC (rev 874) @@ -21,24 +21,48 @@ :OnInit := { || FrmOnInit() } // define menu - WITH OBJECT MAINMENU():New( "MainMenu" ) + WITH OBJECT MAINMENU():New() - WITH OBJECT MENUPOPUP():New( "File", NIL, "&File" ) + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&File" ) WITH OBJECT MENUITEM():New( NIL, NIL, "e&Xit", { || FrmExit() }, ":EXIT" ) ; END WITH END WITH - WITH OBJECT MENUPOPUP():New( "Options", NIL, "&Options" ) - WITH OBJECT MENUITEM():New( "Visib", NIL, "&Visible", { || ActionMenu( 200 ) } ) ; END WITH - WITH OBJECT MENUITEM():New( "Enabl", NIL, "&Enable", { || ActionMenu( 201 ) } ) ; END WITH - WITH OBJECT MENUITEM():New( NIL, NIL, "&Value", { || ActionMenu( 202 ) } ) ; END WITH - WITH OBJECT MENUITEM():New( "UpDown", NIL, "&UpDown", { || ActionMenu( 203 ) } ) ; END WITH - WITH OBJECT MENUITEM():New( "Align", NIL, "&Align right", { || ActionMenu( 204 ) } ) ; END WITH - WITH OBJECT MENUITEM():New( "Symbols", NIL, "&Symbols", { || ActionMenu( 205 ) } ) ; END WITH - WITH OBJECT MENUITEM():New( "ShowNone", NIL, "&ShowNone", { || ActionMenu( 206 ) } ) ; END WITH + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&Options" ) + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&Visible" ) + WITH OBJECT MENUITEM():New( NIL, NIL, "&Show", { || ActionMenu( 200 ) } ) ; END WITH + WITH OBJECT MENUITEM():New( NIL, NIL, "&Hide", { || ActionMenu( 201 ) } ) ; END WITH + END WITH + :AddSeparator() + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&Enable" ) + WITH OBJECT MENUITEM():New( NIL, NIL, "&Enable", { || ActionMenu( 202 ) } ) ; END WITH + WITH OBJECT MENUITEM():New( NIL, NIL, "&Disable", { || ActionMenu( 203 ) } ) ; END WITH + END WITH + :AddSeparator() + WITH OBJECT MENUITEM():New( NIL, NIL, "&Value", { || ActionMenu( 204 ) } ) ; END WITH + :AddSeparator() + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&UpDown" ) + WITH OBJECT MENUITEM():New( NIL, NIL, "&ON", { || ActionMenu( 205 ) } ) ; END WITH + WITH OBJECT MENUITEM():New( NIL, NIL, "O&FF", { || ActionMenu( 206 ) } ) ; END WITH + END WITH + :AddSeparator() + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&Alignment" ) + WITH OBJECT MENUITEM():New( NIL, NIL, "&Left", { || ActionMenu( 207 ) } ) ; END WITH + WITH OBJECT MENUITEM():New( NIL, NIL, "&Right", { || ActionMenu( 208 ) } ) ; END WITH + END WITH + :AddSeparator() + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&Symbols" ) + WITH OBJECT MENUITEM():New( NIL, NIL, "&Rows", { || ActionMenu( 209 ) } ) ; END WITH + WITH OBJECT MENUITEM():New( NIL, NIL, "&Signs", { || ActionMenu( 210 ) } ) ; END WITH + END WITH + :AddSeparator() + WITH OBJECT MENUITEM():New( NIL, NIL, "&ShowNone", { || ActionMenu( 211 ) } ) ; END WITH END WITH - WITH OBJECT MENUPOPUP():New( "Events", NIL, "&Events" ) - WITH OBJECT MENUITEM():New( "OnChg", NIL, "&On Change", { || ActionMenu( 300 ) } ) ; END WITH + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&Events" ) + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&On Change" ) + WITH OBJECT MENUITEM():New( NIL, NIL, "&Enable", { || ActionMenu( 300 ) } ) ; END WITH + WITH OBJECT MENUITEM():New( NIL, NIL, "&Disable", { || ActionMenu( 301 ) } ) ; END WITH + END WITH END WITH END WITH @@ -59,37 +83,37 @@ WITH OBJECT TOOLBAR():New( "ToolBar" ) WITH OBJECT ToolButton():New() :Picture := ":CLEAR" - :OnClick := { || ChangeFont(0) } + :OnClick := { || ChangeFont(.T.) } :ToolTip := "Font normal" END WITH WITH OBJECT ToolButton():New( "TbFntBld" ) :Picture := ":FNTBOLD" - :OnClick := { || ChangeFont(1) } + :OnClick := { || ChangeFont() } :ToolTip := "Bold ON/OFF" END WITH WITH OBJECT ToolButton():New( "TbFntIta" ) :Picture := ":FNTITAL" - :OnClick := { || ChangeFont(2) } + :OnClick := { || ChangeFont() } :ToolTip := "Italic ON/OFF" END WITH WITH OBJECT ToolButton():New( "TbFntStr" ) :Picture := ":FNTSTRK" - :OnClick := { || ChangeFont(3) } + :OnClick := { || ChangeFont() } :ToolTip := "StrikeOut ON/OFF" END WITH WITH OBJECT ToolButton():New( "TbFntUnd" ) :Picture := ":FNTUND" - :OnClick := { || ChangeFont(4) } + :OnClick := { || ChangeFont() } :ToolTip := "Underline ON/OFF" END WITH WITH OBJECT ToolButton():New( "TbFntSiz" ) :Picture := ":FNTSIZE" - :OnClick := { || ChangeFont(5) } + :OnClick := { || ChangeFont() } :ToolTip := "Size ON/OFF" END WITH WITH OBJECT ToolButton():New( "TbFntNam" ) :Picture := ":FNTNAME" - :OnClick := { || ChangeFont(6) } + :OnClick := { || ChangeFont() } :ToolTip := "Name ON/OFF" END WITH END WITH @@ -121,10 +145,14 @@ STATIC FUNCTION FrmOnInit() THISWINDOW:Center() - THISWINDOW:MainMenu:Options:UpDown:Checked := THISWINDOW:DatePick1:Updown - THISWINDOW:MainMenu:Options:Visib:Checked := .T. - THISWINDOW:MainMenu:Options:Enabl:Checked := .T. + THISWINDOW:ToolBar:TbFntBld:Checked := .F. + THISWINDOW:ToolBar:TbFntIta:Checked := .F. + THISWINDOW:ToolBar:TbFntStr:Checked := .F. + THISWINDOW:ToolBar:TbFntUnd:Checked := .F. + THISWINDOW:ToolBar:TbFntSiz:Checked := .F. + THISWINDOW:ToolBar:TbFntNam:Checked := .F. + RETURN NIL /* @@ -142,38 +170,37 @@ STATIC FUNCTION ActionMenu( nOption ) DO CASE + CASE nOption == 200 - THISWINDOW:MainMenu:Options:Visib:Checked := IIF( THISWINDOW:MainMenu:Options:Visib:Checked == .T., .F., .T. ) - THISWINDOW:DatePick1:Visible := THISWINDOW:MainMenu:Options:Visib:Checked + THISWINDOW:DatePick1:Visible := .T. CASE nOption == 201 - THISWINDOW:MainMenu:Options:Enabl:Checked := IIF( THISWINDOW:MainMenu:Options:Enabl:Checked == .T., .F., .T. ) - THISWINDOW:DatePick1:Enabled := THISWINDOW:MainMenu:Options:Enabl:Checked + THISWINDOW:DatePick1:Visible := .F. CASE nOption == 202 - ShowValue() + THISWINDOW:DatePick1:Enabled := .T. CASE nOption == 203 - THISWINDOW:MainMenu:Options:UpDown:Checked := IIF( THISWINDOW:MainMenu:Options:UpDown:Checked == .T., .F., .T. ) - THISWINDOW:DatePick1:Updown := THISWINDOW:MainMenu:Options:UpDown:Checked + THISWINDOW:DatePick1:Enabled := .F. CASE nOption == 204 - THISWINDOW:MainMenu:Options:Align:Checked := IIF( THISWINDOW:MainMenu:Options:Align:Checked == .T., .F., .T. ) - THISWINDOW:DatePick1:Alignment := IIF( THISWINDOW:MainMenu:Options:Align:Checked == .T., DTP_RIGHT, DTP_LEFT ) + ShowValue() CASE nOption == 205 - THISWINDOW:MainMenu:Options:Symbols:Checked := IIF( THISWINDOW:MainMenu:Options:Align:Checked == .T., .F., .T. ) - THISWINDOW:DatePick1:Symbols := IIF( THISWINDOW:MainMenu:Options:Symbols:Checked == .T., QAbstractSpinBox_PlusMinus, QAbstractSpinBox_UpDownArrows ) - IF THISWINDOW:MainMenu:Options:Symbols:Checked == .T. - THISWINDOW:DatePick1:UpDown := .T. - THISWINDOW:MainMenu:Options:UpDown:Checked := .T. - ENDIF - - CASE nOption == 204 + THISWINDOW:DatePick1:Updown := .T. + CASE nOption == 206 + THISWINDOW:DatePick1:Updown := .F. + CASE nOption == 207 + THISWINDOW:DatePick1:Alignment := DTP_LEFT + CASE nOption == 208 + THISWINDOW:DatePick1:Alignment := DTP_RIGHT + CASE nOption == 209 + THISWINDOW:DatePick1:Symbols := QAbstractSpinBox_UpDownArrows + CASE nOption == 210 + THISWINDOW:DatePick1:Updown := .T. + THISWINDOW:DatePick1:Symbols := QAbstractSpinBox_PlusMinus + CASE nOption == 211 THISWINDOW:DatePick2:ShowNone := .T. CASE nOption == 300 - THISWINDOW:MainMenu:Events:OnChg:Checked := IIF( THISWINDOW:MainMenu:Events:OnChg:Checked == .T., .F., .T. ) - IF THISWINDOW:MainMenu:Events:OnChg:Checked == .T. - THISWINDOW:DatePick1:OnChange := {|| MsgInfo( "Changed " ) } - ELSE - THISWINDOW:DatePick1:OnChange := NIL - ENDIF + THISWINDOW:DatePick1:OnChange := {|| MsgInfo( "Changed " ) } + CASE nOption == 301 + THISWINDOW:DatePick1:OnChange := NIL END CASE @@ -192,44 +219,23 @@ /* ChangeFont */ -STATIC FUNCTION ChangeFont( nOption ) +STATIC FUNCTION ChangeFont( lOption ) - DO CASE - CASE nOption == 0 - THISWINDOW:DatePick1:font := HMGAPP():DefaultFont - THISWINDOW:ToolBar:TbFntBld:Checked := .F. - THISWINDOW:ToolBar:TbFntIta:Checked := .F. - THISWINDOW:ToolBar:TbFntStr:Checked := .F. - THISWINDOW:ToolBar:TbFntUnd:Checked := .F. - THISWINDOW:ToolBar:TbFntSiz:Checked := .F. - THISWINDOW:ToolBar:TbFntNam:Checked := .F. - CASE nOption == 1 - THISWINDOW:ToolBar:TbFntBld:Checked := IIF( THISWINDOW:ToolBar:TbFntBld:Checked == .T., .F., .T. ) - CASE nOption == 2 - THISWINDOW:ToolBar:TbFntIta:Checked := IIF( THISWINDOW:ToolBar:TbFntIta:Checked == .T., .F., .T. ) - CASE nOption == 3 - THISWINDOW:ToolBar:TbFntStr:Checked := IIF( THISWINDOW:ToolBar:TbFntStr:Checked == .T., .F., .T. ) - CASE nOption == 4 - THISWINDOW:ToolBar:TbFntUnd:Checked := IIF( THISWINDOW:ToolBar:TbFntUnd:Checked == .T., .F., .T. ) - CASE nOption == 5 - THISWINDOW:ToolBar:TbFntSiz:Checked := IIF( THISWINDOW:ToolBar:TbFntSiz:Checked == .T., .F., .T. ) - IF THISWINDOW:ToolBar:TbFntSiz:Checked == .T. - THISWINDOW:DatePick1:FontSize := 16 - ELSE - THISWINDOW:DatePick1:FontSize := HMGAPP():DefaultFontSize - ENDIF - CASE nOption == 6 - THISWINDOW:ToolBar:TbFntNam:Checked := IIF( THISWINDOW:ToolBar:TbFntNam:Checked == .T., .F., .T. ) - IF THISWINDOW:ToolBar:TbFntNam:Checked == .T. - THISWINDOW:DatePick1:FontName := "Arial" - ELSE - THISWINDOW:DatePick1:FontName := HMGAPP():DefaultFontName - ENDIF - END CASE + IF hb_IsLogical( lOption ) + THISWINDOW:DatePick1:font := HMGAPP():DefaultFont + THISWINDOW:ToolBar:TbFntBld:Checked := .F. + THISWINDOW:ToolBar:TbFntIta:Checked := .F. + THISWINDOW:ToolBar:TbFntStr:Checked := .F. + THISWINDOW:ToolBar:TbFntUnd:Checked := .F. + THISWINDOW:ToolBar:TbFntSiz:Checked := .F. + THISWINDOW:ToolBar:TbFntNam:Checked := .F. + ENDIF - THISWINDOW:DatePick1:FontBold := THISWINDOW:ToolBar:TbFntBld:Checked - THISWINDOW:DatePick1:FontItalic := THISWINDOW:ToolBar:TbFntIta:Checked - THISWINDOW:DatePick1:FontStrikeout := THISWINDOW:ToolBar:TbFntStr:Checked - THISWINDOW:DatePick1:FontUnderLine := THISWINDOW:ToolBar:TbFntUnd:Checked + THISWINDOW:DatePick1:FontBold := THISWINDOW:ToolBar:TbFntBld:Checked + THISWINDOW:DatePick1:FontItalic := THISWINDOW:ToolBar:TbFntIta:Checked + THISWINDOW:DatePick1:FontStrikeout := THISWINDOW:ToolBar:TbFntStr:Checked + THISWINDOW:DatePick1:FontUnderLine := THISWINDOW:ToolBar:TbFntUnd:Checked + THISWINDOW:DatePick1:FontSize := IIF( THISWINDOW:ToolBar:TbFntSiz:Checked == .T., 16, HMGAPP():DefaultFontSize ) + THISWINDOW:DatePick1:FontName := IIF( THISWINDOW:ToolBar:TbFntNam:Checked == .T., "Arial", HMGAPP():DefaultFontName ) RETURN NIL Modified: samples/alldemo/demo_1p005.prg =================================================================== --- samples/alldemo/demo_1p005.prg 2011-12-22 21:15:33 UTC (rev 873) +++ samples/alldemo/demo_1p005.prg 2011-12-22 23:19:45 UTC (rev 874) @@ -21,14 +21,24 @@ :OnInit := { || FrmOnInit() } // define menu - WITH OBJECT MAINMENU():New( "MainMenu" ) - WITH OBJECT MENUPOPUP():New( "File", NIL, "&File" ) + WITH OBJECT MAINMENU():New() + + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&File" ) WITH OBJECT MENUITEM():New( NIL, NIL, "e&Xit", { || FrmExit() }, ":EXIT" ) ; END WITH END WITH - WITH OBJECT MENUPOPUP():New( "Options", NIL, "&Options" ) - WITH OBJECT MENUITEM():New( "Visib", NIL, "&Visible", { || ActionMenu( 200 ) } ) ; END WITH - WITH OBJECT MENUITEM():New( "Enabl", NIL, "&Enable", { || ActionMenu( 201 ) } ) ; END WITH + + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&Options" ) + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&Visible" ) + WITH OBJECT MENUITEM():New( NIL, NIL, "&Show", { || ActionMenu( 200 ) } ) ; END WITH + WITH OBJECT MENUITEM():New( NIL, NIL, "&Hide", { || ActionMenu( 201 ) } ) ; END WITH + END WITH + :AddSeparator() + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&Enable" ) + WITH OBJECT MENUITEM():New( NIL, NIL, "&Enable", { || ActionMenu( 202 ) } ) ; END WITH + WITH OBJECT MENUITEM():New( NIL, NIL, "&Disable", { || ActionMenu( 203 ) } ) ; END WITH + END WITH END WITH + END WITH // define status bar @@ -79,8 +89,6 @@ STATIC FUNCTION FrmOnInit() THISWINDOW:Center() - THISWINDOW:MainMenu:Options:Visib:Checked := .T. - THISWINDOW:MainMenu:Options:Enabl:Checked := .T. RETURN NIL @@ -141,13 +149,14 @@ STATIC FUNCTION ActionMenu( nOption ) DO CASE - CASE nOption == 200 - THISWINDOW:MainMenu:Options:Visib:Checked := IIF( THISWINDOW:MainMenu:Options:Visib:Checked == .T., .F., .T. ) - THISWINDOW:GraphLabel:Visible := THISWINDOW:MainMenu:Options:Visib:Checked + THISWINDOW:GraphLabel:Visible := .T. CASE nOption == 201 - THISWINDOW:MainMenu:Options:Enabl:Checked := IIF( THISWINDOW:MainMenu:Options:Enabl:Checked == .T., .F., .T. ) - THISWINDOW:GraphLabel:Enabled := THISWINDOW:MainMenu:Options:Enabl:Checked + THISWINDOW:GraphLabel:Visible := .F. + CASE nOption == 202 + THISWINDOW:GraphLabel:Enabled := .T. + CASE nOption == 203 + THISWINDOW:GraphLabel:Enabled := .F. END CASE Modified: samples/alldemo/demo_1p006.prg =================================================================== --- samples/alldemo/demo_1p006.prg 2011-12-22 21:15:33 UTC (rev 873) +++ samples/alldemo/demo_1p006.prg 2011-12-22 23:19:45 UTC (rev 874) @@ -21,13 +21,13 @@ :OnInit := { || FrmOnInit() } // define menu - WITH OBJECT MAINMENU():New( "MainMenu" ) + WITH OBJECT MAINMENU():New( NIL ) - WITH OBJECT MENUPOPUP():New( "File", NIL, "&File" ) + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&File" ) WITH OBJECT MENUITEM():New( NIL, NIL, "e&Xit", { || FrmExit() }, ":EXIT" ) ; END WITH END WITH - WITH OBJECT MENUPOPUP():New( "Align", NIL, "&Align" ) + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&Align" ) WITH OBJECT MENUITEM():New( NIL, NIL, "&Left", { || ActionMenu( 100 ) } ) ; END WITH WITH OBJECT MENUITEM():New( NIL, NIL, "&Right", { || ActionMenu( 101 ) } ) ; END WITH WITH OBJECT MENUITEM():New( NIL, NIL, "&Top", { || ActionMenu( 102 ) } ) ; END WITH @@ -36,19 +36,34 @@ WITH OBJECT MENUITEM():New( NIL, NIL, "&VCenter", { || ActionMenu( 105 ) } ) ; END WITH END WITH - WITH OBJECT MENUPOPUP():New( "Options", NIL, "&Options" ) - WITH OBJECT MENUITEM():New( "Visib", NIL, "&Visible", { || ActionMenu( 200 ) } ) ; END WITH - WITH OBJECT MENUITEM():New( "Enabl", NIL, "&Enable", { || ActionMenu( 201 ) } ) ; END WITH - WITH OBJECT MENUITEM():New( NIL, NIL, "&Caption", { || ActionMenu( 202 ) } ) ; END WITH - WITH OBJECT MENUITEM():New( NIL, NIL, "&ToolTip", { || ActionMenu( 203 ) } ) ; END WITH - WITH OBJECT MENUITEM():New( NIL, NIL, "&Size", { || ActionMenu( 204 ) } ) ; END WITH - WITH OBJECT MENUITEM():New( NIL, NIL, "&BackColor", { || ActionMenu( 205 ) } ) ; END WITH - WITH OBJECT MENUITEM():New( NIL, NIL, "&FontColor", { || ActionMenu( 206 ) } ) ; END WITH - WITH OBJECT MENUITEM():New( "AutoSize", NIL, "&AutoSize", { || ActionMenu( 207 ) } ) ; END WITH + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&Options" ) + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&Visible" ) + WITH OBJECT MENUITEM():New( NIL, NIL, "&Show", { || ActionMenu( 200 ) } ) ; END WITH + WITH OBJECT MENUITEM():New( NIL, NIL, "&Hide", { || ActionMenu( 201 ) } ) ; END WITH + END WITH + :AddSeparator() + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&Enable" ) + WITH OBJECT MENUITEM():New( NIL, NIL, "&Enable", { || ActionMenu( 202 ) } ) ; END WITH + WITH OBJECT MENUITEM():New( NIL, NIL, "&Disable", { || ActionMenu( 203 ) } ) ; END WITH + END WITH + :AddSeparator() + WITH OBJECT MENUITEM():New( NIL, NIL, "&Caption", { || ActionMenu( 204 ) } ) ; END WITH + WITH OBJECT MENUITEM():New( NIL, NIL, "&ToolTip", { || ActionMenu( 205 ) } ) ; END WITH + WITH OBJECT MENUITEM():New( NIL, NIL, "&Size", { || ActionMenu( 206 ) } ) ; END WITH + WITH OBJECT MENUITEM():New( NIL, NIL, "&BackColor", { || ActionMenu( 207 ) } ) ; END WITH + WITH OBJECT MENUITEM():New( NIL, NIL, "&FontColor", { || ActionMenu( 208 ) } ) ; END WITH + :AddSeparator() + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&AutoSize" ) + WITH OBJECT MENUITEM():New( NIL, NIL, "&ON", { || ActionMenu( 209 ) } ) ; END WITH + WITH OBJECT MENUITEM():New( NIL, NIL, "O&FF", { || ActionMenu( 210 ) } ) ; END WITH + END WITH END WITH - WITH OBJECT MENUPOPUP():New( "Events", NIL, "&Events" ) - WITH OBJECT MENUITEM():New( "OnClk", NIL, "&OnClick", { || ActionMenu( 300 ) } ) ; END WITH + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&Events" ) + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&OnClick" ) + WITH OBJECT MENUITEM():New( NIL, NIL, "&Enable", { || ActionMenu( 300 ) } ) ; END WITH + WITH OBJECT MENUITEM():New( NIL, NIL, "&Disable", { || ActionMenu( 301 ) } ) ; END WITH + END WITH END WITH END WITH @@ -69,37 +84,37 @@ WITH OBJECT TOOLBAR():New( "ToolBar" ) WITH OBJECT ToolButton():New() :Picture := ":CLEAR" - :OnClick := { || ChangeFont(0) } + :OnClick := { || ChangeFont(.T.) } :ToolTip := "Font normal" END WITH WITH OBJECT ToolButton():New( "TbFntBld" ) :Picture := ":FNTBOLD" - :OnClick := { || ChangeFont(1) } + :OnClick := { || ChangeFont() } :ToolTip := "Bold ON/OFF" END WITH WITH OBJECT ToolButton():New( "TbFntIta" ) :Picture := ":FNTITAL" - :OnClick := { || ChangeFont(2) } + :OnClick := { || ChangeFont() } :ToolTip := "Italic ON/OFF" END WITH WITH OBJECT ToolButton():New( "TbFntStr" ) :Picture := ":FNTSTRK" - :OnClick := { || ChangeFont(3) } + :OnClick := { || ChangeFont() } :ToolTip := "StrikeOut ON/OFF" END WITH WITH OBJECT ToolButton():New( "TbFntUnd" ) :Picture := ":FNTUND" - :OnClick := { || ChangeFont(4) } + :OnClick := { || ChangeFont() } :ToolTip := "Underline ON/OFF" END WITH WITH OBJECT ToolButton():New( "TbFntSiz" ) :Picture := ":FNTSIZE" - :OnClick := { || ChangeFont(5) } + :OnClick := { || ChangeFont() } :ToolTip := "Size ON/OFF" END WITH WITH OBJECT ToolButton():New( "TbFntNam" ) :Picture := ":FNTNAME" - :OnClick := { || ChangeFont(6) } + :OnClick := { || ChangeFont() } :ToolTip := "Name ON/OFF" END WITH END WITH @@ -126,9 +141,14 @@ STATIC FUNCTION FrmOnInit() THISWINDOW:Center() - THISWINDOW:MainMenu:Options:Visib:Checked := .T. - THISWINDOW:MainMenu:Options:Enabl:Checked := .T. + THISWINDOW:ToolBar:TbFntBld:Checked := .F. + THISWINDOW:ToolBar:TbFntIta:Checked := .F. + THISWINDOW:ToolBar:TbFntStr:Checked := .F. + THISWINDOW:ToolBar:TbFntUnd:Checked := .F. + THISWINDOW:ToolBar:TbFntSiz:Checked := .F. + THISWINDOW:ToolBar:TbFntNam:Checked := .F. + RETURN NIL /* @@ -161,16 +181,18 @@ THISWINDOW:Label1:VAlignment := LBL_VCENTER CASE nOption == 200 - THISWINDOW:MainMenu:Options:Visib:Checked := IIF( THISWINDOW:MainMenu:Options:Visib:Checked == .T., .F., .T. ) - THISWINDOW:Label1:Visible := THISWINDOW:MainMenu:Options:Visib:Checked + THISWINDOW:Label1:Visible := .T. CASE nOption == 201 - THISWINDOW:MainMenu:Options:Enabl:Checked := IIF( THISWINDOW:MainMenu:Options:Enabl:Checked == .T., .F., .T. ) - THISWINDOW:Label1:Enabled := THISWINDOW:MainMenu:Options:Enabl:Checked + THISWINDOW:Label1:Visible := .F. CASE nOption == 202 + THISWINDOW:Label1:Enabled := .T. + CASE nOption == 203 + THISWINDOW:Label1:Enabled := .F. + CASE nOption == 204 THISWINDOW:Label1:Caption := IIF( THISWINDOW:Label1:Caption == "Default caption", "Changed caption", "Default caption" ) - CASE nOption == 203 + CASE nOption == 205 THISWINDOW:Label1:Tooltip := IIF( THISWINDOW:Label1:Tooltip == "Default tooltip", "Changed tooltip", "Default tooltip" ) - CASE nOption == 204 + CASE nOption == 206 IF THISWINDOW:Label1:Width == 150 THISWINDOW:Label1:Width := 500 THISWINDOW:Label1:Height := 60 @@ -178,21 +200,21 @@ THISWINDOW:Label1:Width := 150 THISWINDOW:Label1:Height := 30 ENDIF - CASE nOption == 205 + CASE nOption == 207 THISWINDOW:Label1:StyleSheet := "background-color: rgb(204, 204, 102);" - CASE nOption == 206 + CASE nOption == 208 THISWINDOW:Label1:StyleSheet := "color: rgb(0, 0, 255);" - CASE nOption == 207 - THISWINDOW:Label1:AutoSize := IIF( THISWINDOW:Label1:AutoSize == .T., .F., .T. ) - THISWINDOW:MainMenu:Options:AutoSize:Checked := THISWINDOW:Label1:AutoSize - IF THISWINDOW:Label1:AutoSize == .F. - THISWINDOW:Label1:Width := 150 - THISWINDOW:Label1:Height := 40 - ENDIF + CASE nOption == 209 + THISWINDOW:Label1:AutoSize := .T. + CASE nOption == 210 + THISWINDOW:Label1:AutoSize := .F. + THISWINDOW:Label1:Width := 150 + THISWINDOW:Label1:Height := 40 CASE nOption == 300 - THISWINDOW:MainMenu:Events:OnClk:Checked := IIF( THISWINDOW:MainMenu:Events:OnClk:Checked == .T., .F., .T. ) - THISWINDOW:Label1:OnClick := IIF( THISWINDOW:MainMenu:Events:OnClk:Checked == .T., {|| MsgInfo( "Default message") }, NIL ) + THISWINDOW:Label1:OnClick := {|| MsgInfo( "Default message") } + CASE nOption == 301 + THISWINDOW:Label1:OnClick := NIL END CASE @@ -201,44 +223,23 @@ /* ChangeFont */ -STATIC FUNCTION ChangeFont( nOption ) +STATIC FUNCTION ChangeFont( lOption ) - DO CASE - CASE nOption == 0 - THISWINDOW:Label1:font := HMGAPP():DefaultFont - THISWINDOW:ToolBar:TbFntBld:Checked := .F. - THISWINDOW:ToolBar:TbFntIta:Checked := .F. - THISWINDOW:ToolBar:TbFntStr:Checked := .F. - THISWINDOW:ToolBar:TbFntUnd:Checked := .F. - THISWINDOW:ToolBar:TbFntSiz:Checked := .F. - THISWINDOW:ToolBar:TbFntNam:Checked := .F. - CASE nOption == 1 - THISWINDOW:ToolBar:TbFntBld:Checked := IIF( THISWINDOW:ToolBar:TbFntBld:Checked == .T., .F., .T. ) - CASE nOption == 2 - THISWINDOW:ToolBar:TbFntIta:Checked := IIF( THISWINDOW:ToolBar:TbFntIta:Checked == .T., .F., .T. ) - CASE nOption == 3 - THISWINDOW:ToolBar:TbFntStr:Checked := IIF( THISWINDOW:ToolBar:TbFntStr:Checked == .T., .F., .T. ) - CASE nOption == 4 - THISWINDOW:ToolBar:TbFntUnd:Checked := IIF( THISWINDOW:ToolBar:TbFntUnd:Checked == .T., .F., .T. ) - CASE nOption == 5 - THISWINDOW:ToolBar:TbFntSiz:Checked := IIF( THISWINDOW:ToolBar:TbFntSiz:Checked == .T., .F., .T. ) - IF THISWINDOW:ToolBar:TbFntSiz:Checked == .T. - THISWINDOW:Label1:FontSize := 16 - ELSE - THISWINDOW:Label1:FontSize := HMGAPP():DefaultFontSize - ENDIF - CASE nOption == 6 - THISWINDOW:ToolBar:TbFntNam:Checked := IIF( THISWINDOW:ToolBar:TbFntNam:Checked == .T., .F., .T. ) - IF THISWINDOW:ToolBar:TbFntNam:Checked == .T. - THISWINDOW:Label1:FontName := "Arial" - ELSE - THISWINDOW:Label1:FontName := HMGAPP():DefaultFontName - ENDIF - END CASE + IF hb_IsLogical( lOption ) + THISWINDOW:Label1:font := HMGAPP():DefaultFont + THISWINDOW:ToolBar:TbFntBld:Checked := .F. + THISWINDOW:ToolBar:TbFntIta:Checked := .F. + THISWINDOW:ToolBar:TbFntStr:Checked := .F. + THISWINDOW:ToolBar:TbFntUnd:Checked := .F. + THISWINDOW:ToolBar:TbFntSiz:Checked := .F. + THISWINDOW:ToolBar:TbFntNam:Checked := .F. + ENDIF - THISWINDOW:Label1:FontBold := THISWINDOW:ToolBar:TbFntBld:Checked - THISWINDOW:Label1:FontItalic := THISWINDOW:ToolBar:TbFntIta:Checked - THISWINDOW:Label1:FontStrikeout := THISWINDOW:ToolBar:TbFntStr:Checked - THISWINDOW:Label1:FontUnderLine := THISWINDOW:ToolBar:TbFntUnd:Checked + THISWINDOW:Label1:FontBold := THISWINDOW:ToolBar:TbFntBld:Checked + THISWINDOW:Label1:FontItalic := THISWINDOW:ToolBar:TbFntIta:Checked + THISWINDOW:Label1:FontStrikeout := THISWINDOW:ToolBar:TbFntStr:Checked + THISWINDOW:Label1:FontUnderLine := THISWINDOW:ToolBar:TbFntUnd:Checked + THISWINDOW:Label1:FontSize := IIF( THISWINDOW:ToolBar:TbFntSiz:Checked == .T., 16, HMGAPP():DefaultFontSize ) + THISWINDOW:Label1:FontName := IIF( THISWINDOW:ToolBar:TbFntNam:Checked == .T., "Arial", HMGAPP():DefaultFontName ) RETURN NIL Modified: samples/alldemo/demo_1p007.prg =================================================================== --- samples/alldemo/demo_1p007.prg 2011-12-22 21:15:33 UTC (rev 873) +++ samples/alldemo/demo_1p007.prg 2011-12-22 23:19:45 UTC (rev 874) @@ -21,14 +21,24 @@ :OnInit := { || FrmOnInit() } // define menu - WITH OBJECT MAINMENU():New( "MainMenu" ) - WITH OBJECT MENUPOPUP():New( "File", NIL, "&File" ) + WITH OBJECT MAINMENU():New( NIL ) + + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&File" ) WITH OBJECT MENUITEM():New( NIL, NIL, "e&Xit", { || FrmExit() }, ":EXIT" ) ; END WITH END WITH - WITH OBJECT MENUPOPUP():New( "Options", NIL, "&Options" ) - WITH OBJECT MENUITEM():New( "Visib", NIL, "&Visible", { || ActionMenu( 200 ) } ) ; END WITH - WITH OBJECT MENUITEM():New( "Enabl", NIL, "&Enable", { || ActionMenu( 201 ) } ) ; END WITH + + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&Options" ) + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&Visible" ) + WITH OBJECT MENUITEM():New( NIL, NIL, "&Show", { || ActionMenu( 200 ) } ) ; END WITH + WITH OBJECT MENUITEM():New( NIL, NIL, "&Hide", { || ActionMenu( 201 ) } ) ; END WITH + END WITH + :AddSeparator() + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&Enable" ) + WITH OBJECT MENUITEM():New( NIL, NIL, "&Enable", { || ActionMenu( 202 ) } ) ; END WITH + WITH OBJECT MENUITEM():New( NIL, NIL, "&Disable", { || ActionMenu( 203 ) } ) ; END WITH + END WITH END WITH + END WITH // define status bar @@ -101,8 +111,6 @@ STATIC FUNCTION FrmOnInit() THISWINDOW:Center() - THISWINDOW:MainMenu:Options:Visib:Checked := .T. - THISWINDOW:MainMenu:Options:Enabl:Checked := .T. RETURN NIL @@ -162,14 +170,14 @@ STATIC FUNCTION ActionMenu( nOption ) DO CASE - CASE nOption == 200 - THISWINDOW:MainMenu:Options:Visib:Checked := IIF( THISWINDOW:MainMenu:Options:Visib:Checked == .T., .F., .T. ) - THISWINDOW:Lcd2:Visible := THISWINDOW:MainMenu:Options:Visib:Checked + THISWINDOW:Lcd2:Visible := .T. CASE nOption == 201 - THISWINDOW:MainMenu:Options:Enabl:Checked := IIF( THISWINDOW:MainMenu:Options:Enabl:Checked == .T., .F., .T. ) - THISWINDOW:Lcd2:Enabled := THISWINDOW:MainMenu:Options:Enabl:Checked - + THISWINDOW:Lcd2:Visible := .F. + CASE nOption == 202 + THISWINDOW:Lcd2:Enabled := .T. + CASE nOption == 203 + THISWINDOW:Lcd2:Enabled := .F. END CASE RETURN NIL Modified: samples/alldemo/demo_1p008.prg =================================================================== --- samples/alldemo/demo_1p008.prg 2011-12-22 21:15:33 UTC (rev 873) +++ samples/alldemo/demo_1p008.prg 2011-12-22 23:19:45 UTC (rev 874) @@ -21,23 +21,42 @@ :OnInit := { || FrmOnInit() } // define menu - WITH OBJECT MAINMENU():New( "MainMenu" ) + WITH OBJECT MAINMENU():New( NIL ) - WITH OBJECT MENUPOPUP():New( "File", NIL, "&File" ) + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&File" ) WITH OBJECT MENUITEM():New( NIL, NIL, "e&Xit", { || FrmExit() }, ":EXIT" ) ; END WITH END WITH - WITH OBJECT MENUPOPUP():New( "Options", NIL, "&Options" ) - WITH OBJECT MENUITEM():New( "Visib", NIL, "&Visible", { || ActionMenu( 200 ) } ) ; END WITH - WITH OBJECT MENUITEM():New( "Enabl", NIL, "&Enable", { || ActionMenu( 201 ) } ) ; END WITH - WITH OBJECT MENUITEM():New( "Capt", NIL, "&Caption", { || ActionMenu( 202 ) } ) ; END WITH - WITH OBJECT MENUITEM():New( "TooTip", NIL, "&ToolTip", { || ActionMenu( 203 ) } ) ; END WITH + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&Options" ) + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&Visible" ) + WITH OBJECT MENUITEM():New( NIL, NIL, "&Show", { || ActionMenu( 200 ) } ) ; END WITH + WITH OBJECT MENUITEM():New( NIL, NIL, "&Hide", { || ActionMenu( 201 ) } ) ; END WITH + END WITH + :AddSeparator() + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&Enable" ) + WITH OBJECT MENUITEM():New( NIL, NIL, "&Enable", { || ActionMenu( 202 ) } ) ; END WITH + WITH OBJECT MENUITEM():New( NIL, NIL, "&Disable", { || ActionMenu( 203 ) } ) ; END WITH + END WITH + :AddSeparator() + WITH OBJECT MENUITEM():New( NIL, NIL, "&Caption", { || ActionMenu( 204 ) } ) ; END WITH + WITH OBJECT MENUITEM():New( NIL, NIL, "&ToolTip", { || ActionMenu( 205 ) } ) ; END WITH END WITH - WITH OBJECT MENUPOPUP():New( "Events", NIL, "&Events" ) - WITH OBJECT MENUITEM():New( "OnChg", NIL, "&On Change", { || ActionMenu( 300 ) } ) ; END WITH - WITH OBJECT MENUITEM():New( "OnGotFoc", NIL, "&On GotFocus", { || ActionMenu( 301 ) } ) ; END WITH - WITH OBJECT MENUITEM():New( "OnLostFoc", NIL, "&On LostFocus", { || ActionMenu( 302 ) } ) ; END WITH + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&Events" ) + WITH OBJECT MENUPOPUP():New( NIL, NIL, "&On Change" )... [truncated message content] |
From: <ri...@us...> - 2011-12-22 21:15:39
|
Revision: 873 http://hmg.svn.sourceforge.net/hmg/?rev=873&view=rev Author: ricciz Date: 2011-12-22 21:15:33 +0000 (Thu, 22 Dec 2011) Log Message: ----------- Modified Paths: -------------- Changelog Modified: Changelog =================================================================== --- Changelog 2011-12-22 21:13:14 UTC (rev 872) +++ Changelog 2011-12-22 21:15:33 UTC (rev 873) @@ -16,7 +16,7 @@ The license applies to all entries newer than 2009-04-28. */ -2011-12-21 15:20 UTC+0100 Ricci Zepmeusel ( ricci at conzoft.de ) +2011-12-22 22:15 UTC+0100 Ricci Zepmeusel ( ricci at conzoft.de ) * samples/drag_and_drop/demo_1_cmd.prg ! source/combobox.prg - method OnDropDown This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ri...@us...> - 2011-12-22 21:13:21
|
Revision: 872 http://hmg.svn.sourceforge.net/hmg/?rev=872&view=rev Author: ricciz Date: 2011-12-22 21:13:14 +0000 (Thu, 22 Dec 2011) Log Message: ----------- Modified Paths: -------------- Changelog samples/drag_and_drop/demo_1_cmd.prg source/combobox.prg Modified: Changelog =================================================================== --- Changelog 2011-12-22 11:00:58 UTC (rev 871) +++ Changelog 2011-12-22 21:13:14 UTC (rev 872) @@ -16,6 +16,12 @@ The license applies to all entries newer than 2009-04-28. */ +2011-12-21 15:20 UTC+0100 Ricci Zepmeusel ( ricci at conzoft.de ) + * samples/drag_and_drop/demo_1_cmd.prg + ! source/combobox.prg + - method OnDropDown + ! now Combobox can function as a drop target + 2011-12-22 11:50 UTC+0100 Luigi Ferraris ( <luigi at l3w.it> ) ! include/hmg.ch ! source/hmgapp.prg Modified: samples/drag_and_drop/demo_1_cmd.prg =================================================================== --- samples/drag_and_drop/demo_1_cmd.prg 2011-12-22 11:00:58 UTC (rev 871) +++ samples/drag_and_drop/demo_1_cmd.prg 2011-12-22 21:13:14 UTC (rev 872) @@ -65,8 +65,7 @@ Col 10 Width 300 Height 100 - Value "Checkbox, Datepicker, Label and Textbox work well." + HB_EOL() + HB_EOL() ; - + "Combobox did not work as a target." + HB_EOL() + HB_EOL() ; + Value "Checkbox, Combobox, Datepicker, Label and Textbox work well." + HB_EOL() + HB_EOL() ; + "Editbox, Listbox and Tree do not call OnDropDown." OnDropDown { |oEvent| MyDropEvent(oEvent, "Editbox" ) } END EDITBOX @@ -128,7 +127,7 @@ LOCAL cFileNames := cControl + " received" + HB_EOL() oMimeData := oEvent:mimeData() - + IF oMimeData:hasUrls() oUrlList := oMimeData:urls() Modified: source/combobox.prg =================================================================== --- source/combobox.prg 2011-12-22 11:00:58 UTC (rev 871) +++ source/combobox.prg 2011-12-22 21:13:14 UTC (rev 872) @@ -52,7 +52,6 @@ DATA aRelatedValues INIT NIL PROTECTED DATA bOnCloseUp INIT NIL PROTECTED DATA bOnDisplayChange INIT NIL PROTECTED - DATA bOnDropDown INIT NIL PROTECTED DATA nValue INIT NIL PROTECTED DATA cValueSource INIT NIL PROTECTED @@ -76,7 +75,6 @@ METHOD OnCloseUp SETGET // TODO METHOD OnChange SETGET METHOD OnDisplayChange SETGET - METHOD OnDropDown SETGET // TODO METHOD Refresh METHOD RelatedValues SETGET METHOD Sort SETGET @@ -403,20 +401,6 @@ RETURN Self /*.............................................................................. - OnDropDown - TODO -..............................................................................*/ -METHOD OnDropDown( bArg1 ) CLASS COMBOBOX - - IF PCOUNT() == 0 - RETURN ::bOnDropDown - ELSEIF PCOUNT() == 1 .AND. hb_IsBlock( bArg1 ) - ::bOnDropDown := bArg1 - ENDIF - -RETURN Self - -/*.............................................................................. OnChange ..............................................................................*/ METHOD OnChange( bArg1 ) CLASS COMBOBOX This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <l3...@us...> - 2011-12-22 11:01:05
|
Revision: 871 http://hmg.svn.sourceforge.net/hmg/?rev=871&view=rev Author: l3wonsf Date: 2011-12-22 11:00:58 +0000 (Thu, 22 Dec 2011) Log Message: ----------- 2011-12-22 11:50 UTC+0100 Luigi Ferraris ( <luigi at l3w.it> ) ! include/hmg.ch ! source/hmgapp.prg ! samples/agoodstart/demo_1_cmd.prg ! samples/agoodstart/demo_1_oop.prg ! renamed TranslDir() method into TranslateDir() ! renamed SET TRANSLDIR TO... command into SET TRANSLATEDIR TO... ! Changelog ! wrong date previous commit Modified Paths: -------------- Changelog include/hmg.ch samples/agoodstart/demo_1_cmd.prg samples/agoodstart/demo_1_oop.prg source/hmgapp.prg Modified: Changelog =================================================================== --- Changelog 2011-12-22 10:28:39 UTC (rev 870) +++ Changelog 2011-12-22 11:00:58 UTC (rev 871) @@ -16,7 +16,18 @@ The license applies to all entries newer than 2009-04-28. */ -2011-12-21 18:30 UTC+0100 Luigi Ferraris ( <luigi at l3w.it> ) +2011-12-22 11:50 UTC+0100 Luigi Ferraris ( <luigi at l3w.it> ) + ! include/hmg.ch + ! source/hmgapp.prg + ! samples/agoodstart/demo_1_cmd.prg + ! samples/agoodstart/demo_1_oop.prg + ! renamed TranslDir() method into TranslateDir() + ! renamed SET TRANSLDIR TO... command into SET TRANSLATEDIR TO... + + ! Changelog + ! wrong date previous commit + +2011-12-22 10:50 UTC+0100 Luigi Ferraris ( <luigi at l3w.it> ) ! source/abstractbutton.prg ! problem with Checked() method. Re-activate internal ::lChecked var because with ToolButton, without this var, the Qt method doesn't returns Modified: include/hmg.ch =================================================================== --- include/hmg.ch 2011-12-22 10:28:39 UTC (rev 870) +++ include/hmg.ch 2011-12-22 11:00:58 UTC (rev 871) @@ -3583,7 +3583,7 @@ #xcommand ADDQTRESOURCE <cResource> => HMGAPP():RegisterResource( <cResource> ) #xcommand SET ONSHUTDOWN TO <bValue> => HMGAPP():OnShutDown( <{bValue}> ) #xcommand SET ONSTARTUP TO <bValue> => HMGAPP():OnStartUp( <{bValue}> ) - #xcommand SET TRANSLDIR TO <cValue> => HMGAPP():TranslDir( <cValue> ) + #xcommand SET TRANSLATEDIR TO <cValue> => HMGAPP():TranslateDir( <cValue> ) /*----------------------------------------------------------------------*/ Modified: samples/agoodstart/demo_1_cmd.prg =================================================================== --- samples/agoodstart/demo_1_cmd.prg 2011-12-22 10:28:39 UTC (rev 870) +++ samples/agoodstart/demo_1_cmd.prg 2011-12-22 11:00:58 UTC (rev 871) @@ -28,7 +28,7 @@ // SET QTLOCALE TO QLocale_German, QLocale_Germany // to change translations files folder; by default, QT search <programfolder>/translations - // SET TRANSLDIR TO "translations" + // SET TRANSLATEDIR TO "<otherPath>/translations" // after HMG is started but before any GUI, this block must be execute SET ONSTARTUP TO Prj_OnStartUp() Modified: samples/agoodstart/demo_1_oop.prg =================================================================== --- samples/agoodstart/demo_1_oop.prg 2011-12-22 10:28:39 UTC (rev 870) +++ samples/agoodstart/demo_1_oop.prg 2011-12-22 11:00:58 UTC (rev 871) @@ -28,7 +28,7 @@ // HMGAPP():Localized( QLocale_German, QLocale_Germany ) // to change translations files folder; by default, QT search <programfolder>/translations - // HMGAPP():TranslDir( "translations" ) + // HMGAPP():TranslateDir( "<otherPath>/translations" ) // after HMG is started but before any GUI, this block must be execute HMGAPP():OnStartUp( { || Prj_OnStartUp() } ) Modified: source/hmgapp.prg =================================================================== --- source/hmgapp.prg 2011-12-22 10:28:39 UTC (rev 870) +++ source/hmgapp.prg 2011-12-22 11:00:58 UTC (rev 871) @@ -104,7 +104,7 @@ METHOD ThisW SETGET METHOD ThisWdg SETGET METHOD ThisWin SETGET - METHOD TranslDir SETGET + METHOD TranslateDir SETGET METHOD TranslFile SETGET METHOD WindowsChildClosed @@ -655,9 +655,9 @@ RETURN Self /*.............................................................................. - TranslDir + TranslateDir ..............................................................................*/ -METHOD TranslDir( cArg1 ) CLASS HMG_HMGAPP +METHOD TranslateDir( cArg1 ) CLASS HMG_HMGAPP IF PCOUNT() == 0 RETURN ::cTranslDir This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <l3...@us...> - 2011-12-22 10:28:51
|
Revision: 870 http://hmg.svn.sourceforge.net/hmg/?rev=870&view=rev Author: l3wonsf Date: 2011-12-22 10:28:39 +0000 (Thu, 22 Dec 2011) Log Message: ----------- 2011-12-21 18:30 UTC+0100 Luigi Ferraris ( <luigi at l3w.it> ) ! source/abstractbutton.prg ! problem with Checked() method. Re-activate internal ::lChecked var because with ToolButton, without this var, the Qt method doesn't returns right value. * include/hmg.ch + SET TRANSLDIR TO <cValue> to be used in cmd style. This command is like HMGAPP():TranslDir( <cValue> ) - samples/agoodstart/demo_1.prg - samples/agoodstart/demo_1.hbp - samples/agoodstart/demo_1.qrc - samples/agoodstart/demo_2.prg - samples/agoodstart/demo_2.hbp - samples/agoodstart/demo_2.qrc - samples/agoodstart/demo_3.prg + samples/agoodstart/demo_1_oop.hbp + samples/agoodstart/demo_1_oop.prg + samples/agoodstart/demo_1_oop.qrc + samples/agoodstart/demo_1_cmd.hbp + samples/agoodstart/demo_1_cmd.prg + samples/agoodstart/demo_1_cmd.qrc * to show difference between OOp style and CMD style. Modified Paths: -------------- Changelog include/hmg.ch source/abstractbutton.prg Added Paths: ----------- samples/agoodstart/demo_1_cmd.hbp samples/agoodstart/demo_1_cmd.prg samples/agoodstart/demo_1_cmd.qrc samples/agoodstart/demo_1_oop.hbp samples/agoodstart/demo_1_oop.prg samples/agoodstart/demo_1_oop.qrc Removed Paths: ------------- samples/agoodstart/demo_1.hbp samples/agoodstart/demo_1.prg samples/agoodstart/demo_1.qrc samples/agoodstart/demo_2.hbp samples/agoodstart/demo_2.prg samples/agoodstart/demo_2.qrc samples/agoodstart/demo_3.prg Modified: Changelog =================================================================== --- Changelog 2011-12-21 20:10:32 UTC (rev 869) +++ Changelog 2011-12-22 10:28:39 UTC (rev 870) @@ -16,6 +16,31 @@ The license applies to all entries newer than 2009-04-28. */ +2011-12-21 18:30 UTC+0100 Luigi Ferraris ( <luigi at l3w.it> ) + ! source/abstractbutton.prg + ! problem with Checked() method. Re-activate internal ::lChecked var + because with ToolButton, without this var, the Qt method doesn't returns + right value. + + * include/hmg.ch + + SET TRANSLDIR TO <cValue> to be used in cmd style. This command is like + HMGAPP():TranslDir( <cValue> ) + + - samples/agoodstart/demo_1.prg + - samples/agoodstart/demo_1.hbp + - samples/agoodstart/demo_1.qrc + - samples/agoodstart/demo_2.prg + - samples/agoodstart/demo_2.hbp + - samples/agoodstart/demo_2.qrc + - samples/agoodstart/demo_3.prg + + samples/agoodstart/demo_1_oop.hbp + + samples/agoodstart/demo_1_oop.prg + + samples/agoodstart/demo_1_oop.qrc + + samples/agoodstart/demo_1_cmd.hbp + + samples/agoodstart/demo_1_cmd.prg + + samples/agoodstart/demo_1_cmd.qrc + * to show difference between OOp style and CMD style. + 2011-12-21 21:05 UTC+0100 Luigi Ferraris ( <luigi at l3w.it> ) - samples/checkbox/demo_1.prg - samples/checkbox/demo_2.prg Modified: include/hmg.ch =================================================================== --- include/hmg.ch 2011-12-21 20:10:32 UTC (rev 869) +++ include/hmg.ch 2011-12-22 10:28:39 UTC (rev 870) @@ -3583,6 +3583,7 @@ #xcommand ADDQTRESOURCE <cResource> => HMGAPP():RegisterResource( <cResource> ) #xcommand SET ONSHUTDOWN TO <bValue> => HMGAPP():OnShutDown( <{bValue}> ) #xcommand SET ONSTARTUP TO <bValue> => HMGAPP():OnStartUp( <{bValue}> ) + #xcommand SET TRANSLDIR TO <cValue> => HMGAPP():TranslDir( <cValue> ) /*----------------------------------------------------------------------*/ Deleted: samples/agoodstart/demo_1.hbp =================================================================== --- samples/agoodstart/demo_1.hbp 2011-12-21 20:10:32 UTC (rev 869) +++ samples/agoodstart/demo_1.hbp 2011-12-22 10:28:39 UTC (rev 870) @@ -1,7 +0,0 @@ -demo_1.prg - -demo_1.qrc -other_res1.qrc -other_res2.qrc -other_res3.qrc -other_res4.qrc Deleted: samples/agoodstart/demo_1.prg =================================================================== --- samples/agoodstart/demo_1.prg 2011-12-21 20:10:32 UTC (rev 869) +++ samples/agoodstart/demo_1.prg 2011-12-22 10:28:39 UTC (rev 870) @@ -1,114 +0,0 @@ -/* - * $Id$ -*/ - -/* - * HMG 4 demo - * (c) 2010 Roberto Lopez <mai...@gm...> -*/ - -#include "hmg.ch" -#include "hbqtcore.ch" -#include "hmg_qtlocale.ch" - -FUNCTION Main - - LOCAL MainForm - - HbQt_ErrorSys() - - // you don't need add demo_1 because <ProgramName>.qrc is added by default - HMGAPP():Resources := { "other_res1", "other_res2", "other_res3", "other_res4" } - - // change values to have different language and country - // OR comment line to have your local system - // From Qt docs: you must change these value before using GUI Application - HMGAPP():Localized( QLocale_English, QLocale_UnitedKingdom ) - - // after HMG is started but before any GUI, this block must be execute - HMGAPP():OnStartUp( { || Prj_OnStartUp() } ) - - // when HMGAPP:Quit() it's call, run this procedure - HMGAPP():OnShutDown( { || Prj_OnShutDown() } ) - - - WITH OBJECT MainForm := MAINWINDOW():New( "MainForm" ) - :Row := 10 - :Col := 10 - :Width := 400 - :Height := 400 - :Title := "A good start. OOP syntax" - :Icon := ":HMG_ICO" - :OnInit := { || MainForm:Center() } - - WITH OBJECT Button():New( "BtnLang" ) - :Row := 40 - :Col := 40 - :Height := 40 - :Width := 180 - :Caption := "Current Language" - :Picture := ":BTN_SAVE" - :OnClick := { || Bt1_OnClick() } - END WITH - - WITH OBJECT Button():New( "BtnCount" ) - :Row := 90 - :Col := 40 - :Height := 40 - :Width := 180 - :Caption := "Current Country" - :Picture := ":BTN_FIND" - :OnClick := { || Bt2_OnClick() } - END WITH - - WITH OBJECT Button():New( "BtnExit" ) - :Row := 190 - :Col := 40 - :Width := 180 - :Height := 40 - :Caption := "Click to Exit" - :Picture := ":BTN_EXIT" - :OnClick := { || MainForm:Release() } - END WITH - - END WITH - - MainForm:Activate() - -RETURN NIL - -/*............................................................................. - This show how to know current Language -.............................................................................*/ -STATIC FUNCTION Bt1_OnClick() - - MsgInfo( "Current Language is " + hb_ValToExp( HMGAPP():Language() ), "Language" ) - -RETURN NIL - -/*............................................................................. - This show how to know current Country -.............................................................................*/ -STATIC FUNCTION Bt2_OnClick() - - MsgInfo( "Current Country is " + hb_ValToExp( HMGAPP():Country() ), "Country" ) - -RETURN NIL - -/*............................................................................. - This is execute at startup -.............................................................................*/ -STATIC FUNCTION Prj_OnStartUp() - - MsgInfo( "Procedure at system StartUp", "StartUp" ) - -RETURN NIL - -/*............................................................................. - This is execute at shutdown -.............................................................................*/ -STATIC FUNCTION Prj_OnShutDown() - - MsgInfo( "Procedure at system ShutDown", "ShutDown" ) - -RETURN NIL Deleted: samples/agoodstart/demo_1.qrc =================================================================== --- samples/agoodstart/demo_1.qrc 2011-12-21 20:10:32 UTC (rev 869) +++ samples/agoodstart/demo_1.qrc 2011-12-22 10:28:39 UTC (rev 870) @@ -1,5 +0,0 @@ -<!DOCTYPE RCC><RCC version="1.0"> -<qresource> -<file alias="HMG_ICO">resource/hmg.png</file> -</qresource> -</RCC> \ No newline at end of file Added: samples/agoodstart/demo_1_cmd.hbp =================================================================== --- samples/agoodstart/demo_1_cmd.hbp (rev 0) +++ samples/agoodstart/demo_1_cmd.hbp 2011-12-22 10:28:39 UTC (rev 870) @@ -0,0 +1,7 @@ +demo_1_cmd.prg + +demo_1_cmd.qrc +other_res1.qrc +other_res2.qrc +other_res3.qrc +other_res4.qrc Added: samples/agoodstart/demo_1_cmd.prg =================================================================== --- samples/agoodstart/demo_1_cmd.prg (rev 0) +++ samples/agoodstart/demo_1_cmd.prg 2011-12-22 10:28:39 UTC (rev 870) @@ -0,0 +1,139 @@ +/* + * $Id$ +*/ + +/* + * HMG 4 demo + * (c) 2010 Roberto Lopez <mai...@gm...> +*/ + +#include "hmg.ch" +#include "hbqtcore.ch" +#include "hmg_qtlocale.ch" + +FUNCTION Main + + LOCAL MainForm + + HbQt_ErrorSys() + + // you don't need add demo_1 because <ProgramName>.qrc is added by default + SET RESOURCE TO { "other_res1", "other_res2", "other_res3", "other_res4" } + + // change values to have different language and country + // OR comment line to have your local system + // From Qt docs: you must change these value before using GUI Application + // SET QTLOCALE TO QLocale_English, QLocale_UnitedKingdom + SET QTLOCALE TO QLocale_Spanish, QLocale_Spain + // SET QTLOCALE TO QLocale_German, QLocale_Germany + + // to change translations files folder; by default, QT search <programfolder>/translations + // SET TRANSLDIR TO "translations" + + // after HMG is started but before any GUI, this block must be execute + SET ONSTARTUP TO Prj_OnStartUp() + + // when HMGAPP:Quit() it's call, run this procedure + SET ONSHUTDOWN TO Prj_OnShutDown() + + + DEFINE MAINWINDOW MainForm + ROW 10 + COL 10 + WIDTH 400 + HEIGHT 400 + TITLE "GOOD STARTING demo - (CMD style)" + ICON ":HMG_ICO" + ONINIT MainForm:Center() + + DEFINE BUTTON BtnLang + ROW 40 + COL 40 + HEIGHT 40 + WIDTH 200 + CAPTION "Current Language" + PICTURE ":BTN_SAVE" + ONCLICK Bt1_OnClick() + END BUTTON + + DEFINE BUTTON BtnCount + ROW 90 + COL 40 + HEIGHT 40 + WIDTH 200 + CAPTION "Current Country" + PICTURE ":BTN_FIND" + ONCLICK Bt2_OnClick() + END BUTTON + + DEFINE BUTTON BtnExit + ROW 140 + COL 40 + HEIGHT 40 + WIDTH 200 + CAPTION "Click to Exit" + PICTURE ":BTN_EXIT" + ONCLICK MainForm:Release() + END BUTTON + + DEFINE BUTTON BtnDialog + Row 190 + Col 40 + Height 40 + Width 200 + Caption "Open standard dialog in language" + OnClick Bt3_OnClick() + END WITH + + END WINDOW + + ACTIVATE WINDOW MainForm + +RETURN NIL + +/*............................................................................. + This show how to know current Language +.............................................................................*/ +PROCEDURE Bt1_OnClick() + + MsgInfo( "Current Language is " + hb_ValToExp( HMGAPP():Language() ), "Language" ) + +RETURN + +/*............................................................................. + This show how to know current Country +.............................................................................*/ +PROCEDURE Bt2_OnClick() + + MsgInfo( "Current Country is " + hb_ValToExp( HMGAPP():Country() ), "Country" ) + +RETURN + +/*............................................................................. + This show how standard dialog are translated +.............................................................................*/ +PROCEDURE Bt3_OnClick() + + LOCAL xValue := GetFolder( "Select Directory", GetProgramFilesFolder() ) + + HB_SYMBOL_UNUSED( xValue ) + +RETURN + +/*............................................................................. + This is execute at startup +.............................................................................*/ +PROCEDURE Prj_OnStartUp() + + MsgInfo( "Procedure at system StartUp", "StartUp" ) + +RETURN + +/*............................................................................. + This is execute at shutdown +.............................................................................*/ +PROCEDURE Prj_OnShutDown() + + MsgInfo( "Procedure at system ShutDown", "ShutDown" ) + +RETURN Property changes on: samples/agoodstart/demo_1_cmd.prg ___________________________________________________________________ Added: svn:keywords + Author Id Date Revision Added: svn:eol-style + native Added: samples/agoodstart/demo_1_cmd.qrc =================================================================== --- samples/agoodstart/demo_1_cmd.qrc (rev 0) +++ samples/agoodstart/demo_1_cmd.qrc 2011-12-22 10:28:39 UTC (rev 870) @@ -0,0 +1,5 @@ +<!DOCTYPE RCC><RCC version="1.0"> +<qresource> +<file alias="HMG_ICO">resource/hmg.png</file> +</qresource> +</RCC> \ No newline at end of file Added: samples/agoodstart/demo_1_oop.hbp =================================================================== --- samples/agoodstart/demo_1_oop.hbp (rev 0) +++ samples/agoodstart/demo_1_oop.hbp 2011-12-22 10:28:39 UTC (rev 870) @@ -0,0 +1,7 @@ +demo_1_oop.prg + +demo_1_oop.qrc +other_res1.qrc +other_res2.qrc +other_res3.qrc +other_res4.qrc Added: samples/agoodstart/demo_1_oop.prg =================================================================== --- samples/agoodstart/demo_1_oop.prg (rev 0) +++ samples/agoodstart/demo_1_oop.prg 2011-12-22 10:28:39 UTC (rev 870) @@ -0,0 +1,139 @@ +/* + * $Id$ +*/ + +/* + * HMG 4 demo + * (c) 2010 Roberto Lopez <mai...@gm...> +*/ + +#include "hmg.ch" +#include "hbqtcore.ch" +#include "hmg_qtlocale.ch" + +FUNCTION Main + + LOCAL MainForm + + HbQt_ErrorSys() + + // you don't need add demo_1 because <ProgramName>.qrc is added by default + HMGAPP():Resources := { "other_res1", "other_res2", "other_res3", "other_res4" } + + // change values to have different language and country + // OR comment line to have your local system + // From Qt docs: you must change these value before using GUI Application + // HMGAPP():Localized( QLocale_English, QLocale_UnitedKingdom ) + HMGAPP():Localized( QLocale_Spanish, QLocale_Spain ) + // HMGAPP():Localized( QLocale_German, QLocale_Germany ) + + // to change translations files folder; by default, QT search <programfolder>/translations + // HMGAPP():TranslDir( "translations" ) + + // after HMG is started but before any GUI, this block must be execute + HMGAPP():OnStartUp( { || Prj_OnStartUp() } ) + + // when HMGAPP:Quit() it's call, run this procedure + HMGAPP():OnShutDown( { || Prj_OnShutDown() } ) + + + WITH OBJECT MainForm := MAINWINDOW():New( "MainForm" ) + :Row := 10 + :Col := 10 + :Width := 400 + :Height := 400 + :Title := "GOOD STARTING demo - (OOP style)" + :Icon := ":HMG_ICO" + :OnInit := { || MainForm:Center() } + + WITH OBJECT Button():New( "BtnLang" ) + :Row := 40 + :Col := 40 + :Height := 40 + :Width := 200 + :Caption := "Current Language" + :Picture := ":BTN_SAVE" + :OnClick := { || Bt1_OnClick() } + END WITH + + WITH OBJECT Button():New( "BtnCount" ) + :Row := 90 + :Col := 40 + :Height := 40 + :Width := 200 + :Caption := "Current Country" + :Picture := ":BTN_FIND" + :OnClick := { || Bt2_OnClick() } + END WITH + + WITH OBJECT Button():New( "BtnExit" ) + :Row := 140 + :Col := 40 + :Width := 200 + :Height := 40 + :Caption := "Exit" + :Picture := ":BTN_EXIT" + :OnClick := { || MainForm:Release() } + END WITH + + WITH OBJECT Button():New( "BtnDialog" ) + :Row := 190 + :Col := 40 + :Height := 40 + :Width := 200 + :Caption := "Open standard dialog in language" + :OnClick := { || Bt3_OnClick() } + END WITH + + END WITH + + MainForm:Activate() + +RETURN NIL + +/*............................................................................. + This show how to know current Language +.............................................................................*/ +PROCEDURE Bt1_OnClick() + + MsgInfo( "Current Language is " + hb_ValToExp( HMGAPP():Language() ), "Language" ) + +RETURN + +/*............................................................................. + This show how to know current Country +.............................................................................*/ +PROCEDURE Bt2_OnClick() + + MsgInfo( "Current Country is " + hb_ValToExp( HMGAPP():Country() ), "Country" ) + +RETURN + +/*............................................................................. + This show how standard dialog are translated +.............................................................................*/ +PROCEDURE Bt3_OnClick() + + LOCAL xValue := GetFolder( "Select Directory", GetProgramFilesFolder() ) + + HB_SYMBOL_UNUSED( xValue ) + +RETURN + +/*............................................................................. + This is execute at startup +.............................................................................*/ +PROCEDURE Prj_OnStartUp() + + MsgInfo( "Procedure at system StartUp", "StartUp" ) + +RETURN + +/*............................................................................. + This is execute at shutdown +.............................................................................*/ +PROCEDURE Prj_OnShutDown() + + MsgInfo( "Procedure at system ShutDown", "ShutDown" ) + +RETURN Property changes on: samples/agoodstart/demo_1_oop.prg ___________________________________________________________________ Added: svn:keywords + Author Id Date Revision Added: svn:eol-style + native Added: samples/agoodstart/demo_1_oop.qrc =================================================================== --- samples/agoodstart/demo_1_oop.qrc (rev 0) +++ samples/agoodstart/demo_1_oop.qrc 2011-12-22 10:28:39 UTC (rev 870) @@ -0,0 +1,5 @@ +<!DOCTYPE RCC><RCC version="1.0"> +<qresource> +<file alias="HMG_ICO">resource/hmg.png</file> +</qresource> +</RCC> \ No newline at end of file Deleted: samples/agoodstart/demo_2.hbp =================================================================== --- samples/agoodstart/demo_2.hbp 2011-12-21 20:10:32 UTC (rev 869) +++ samples/agoodstart/demo_2.hbp 2011-12-22 10:28:39 UTC (rev 870) @@ -1,7 +0,0 @@ -demo_2.prg - -demo_2.qrc -other_res1.qrc -other_res2.qrc -other_res3.qrc -other_res4.qrc Deleted: samples/agoodstart/demo_2.prg =================================================================== --- samples/agoodstart/demo_2.prg 2011-12-21 20:10:32 UTC (rev 869) +++ samples/agoodstart/demo_2.prg 2011-12-22 10:28:39 UTC (rev 870) @@ -1,114 +0,0 @@ -/* - * $Id$ -*/ - -/* - * HMG 4 demo - * (c) 2010 Roberto Lopez <mai...@gm...> -*/ - -#include "hmg.ch" -#include "hbqtcore.ch" -#include "hmg_qtlocale.ch" - -FUNCTION Main - - LOCAL MainForm - - HbQt_ErrorSys() - - // you don't need add demo_1 because <ProgramName>.qrc is added by default - SET RESOURCE TO { "other_res1", "other_res2", "other_res3", "other_res4" } - - // change values to have different language and country - // OR comment line to have your local system - // From Qt docs: you must change these value before using GUI Application - SET QTLOCALE TO QLocale_English, QLocale_UnitedKingdom - - // after HMG is started but before any GUI, this block must be execute - SET ONSTARTUP TO Prj_OnStartUp() - - // when HMGAPP:Quit() it's call, run this procedure - SET ONSHUTDOWN TO Prj_OnShutDown() - - - DEFINE MAINWINDOW MainForm - ROW 10 - COL 10 - WIDTH 400 - HEIGHT 400 - TITLE "A good start. XBase syntax" - ICON ":HMG_ICO" - ONINIT MainForm:Center() - - DEFINE BUTTON BtnLang - ROW 40 - COL 40 - HEIGHT 40 - WIDTH 180 - CAPTION "Current Language" - PICTURE ":BTN_SAVE" - ONCLICK Bt1_OnClick() - END BUTTON - - DEFINE BUTTON BtnCount - ROW 90 - COL 40 - HEIGHT 40 - WIDTH 180 - CAPTION "Current Country" - PICTURE ":BTN_FIND" - ONCLICK Bt2_OnClick() - END BUTTON - - DEFINE BUTTON BtnExit - ROW 190 - COL 40 - HEIGHT 40 - WIDTH 180 - CAPTION "Click to Exit" - PICTURE ":BTN_EXIT" - ONCLICK MainForm:Release() - END BUTTON - - END WINDOW - - ACTIVATE WINDOW MainForm - -RETURN NIL - -/*............................................................................. - This show how to know current Language -.............................................................................*/ -STATIC FUNCTION Bt1_OnClick() - - MsgInfo( "Current Language is " + hb_ValToExp( QTLANGUAGE ), "Language" ) - -RETURN NIL - -/*............................................................................. - This show how to know current Country -.............................................................................*/ -STATIC FUNCTION Bt2_OnClick() - - MsgInfo( "Current Country is " + hb_ValToExp( QTCOUNTRY ), "Country" ) - -RETURN NIL - -/*............................................................................. - This is execute at startup -.............................................................................*/ -STATIC FUNCTION Prj_OnStartUp() - - MsgInfo( "Procedure at system StartUp", "StartUp" ) - -RETURN NIL - -/*............................................................................. - This is execute at shutdown -.............................................................................*/ -STATIC FUNCTION Prj_OnShutDown() - - MsgInfo( "Procedure at system ShutDown", "ShutDown" ) - -RETURN NIL Deleted: samples/agoodstart/demo_2.qrc =================================================================== --- samples/agoodstart/demo_2.qrc 2011-12-21 20:10:32 UTC (rev 869) +++ samples/agoodstart/demo_2.qrc 2011-12-22 10:28:39 UTC (rev 870) @@ -1,5 +0,0 @@ -<!DOCTYPE RCC><RCC version="1.0"> -<qresource> -<file alias="HMG_ICO">resource/hmg.png</file> -</qresource> -</RCC> \ No newline at end of file Deleted: samples/agoodstart/demo_3.prg =================================================================== --- samples/agoodstart/demo_3.prg 2011-12-21 20:10:32 UTC (rev 869) +++ samples/agoodstart/demo_3.prg 2011-12-22 10:28:39 UTC (rev 870) @@ -1,100 +0,0 @@ -/* - * $Id$ -*/ - -/* - * HMG 4 demo - * (c) 2010 Roberto Lopez <mai...@gm...> -*/ - -#include "hmg.ch" -#include "hmg_qtlocale.ch" - -FUNCTION Main - - LOCAL MainForm - - HbQt_ErrorSys() -// HMGAPP():Localized( QLocale_Spanish ) // you can play with one: enable or disable - HMGAPP():Localized( QLocale_German ) // you can play with one: enable or disable - HMGAPP():TranslDir( "translations" ) - - - WITH OBJECT MainForm := MAINWINDOW():New( "MainForm" ) - :Row := 10 - :Col := 10 - :Width := 400 - :Height := 400 - :Title := "Qtranslator demo: experimental" - :OnInit := { || MainForm:Center() } - - WITH OBJECT Button():New( "Btn1" ) - :Row := 40 - :Col := 40 - :Height := 30 - :Width := 180 - :Caption := "Current Language" - :OnClick := { || Bt1_OnClick() } - END WITH - - WITH OBJECT Button():New( "Btn2" ) - :Row := 80 - :Col := 40 - :Height := 30 - :Width := 180 - :Caption := "Current Translator File Name" - :OnClick := { || Bt2_OnClick() } - END WITH - - WITH OBJECT Button():New( "Btn3" ) - :Row := 120 - :Col := 40 - :Height := 30 - :Width := 180 - :Caption := "Open standard dialog" - :OnClick := { || Bt3_OnClick() } - END WITH - - WITH OBJECT Button():New( "BtnExit" ) - :Row := 340 - :Col := 40 - :Width := 180 - :Height := 30 - :Caption := "Click to Exit" - :OnClick := { || MainForm:Release() } - END WITH - - END WITH - - MainForm:Activate() - -RETURN NIL - -/*............................................................................. - This show how to know current Language -.............................................................................*/ -STATIC FUNCTION Bt1_OnClick() - - MsgInfo( "Current Language is " + hb_ValToExp( HMGAPP():Language() ), "Language" ) - -RETURN NIL - -/*............................................................................. - This show how to know current Translator File Name -.............................................................................*/ -STATIC FUNCTION Bt2_OnClick() - - MsgInfo( "Current Translator File Name is " + HMGAPP():TranslFile(), "Translator" ) - -RETURN NIL - -/*............................................................................. - This show how standard dialog are translated -.............................................................................*/ -STATIC FUNCTION Bt3_OnClick() - - LOCAL xValue := GetFolder( "Select Directory", GetProgramFilesFolder() ) - - HB_SYMBOL_UNUSED( xValue ) - -RETURN NIL Modified: source/abstractbutton.prg =================================================================== --- source/abstractbutton.prg 2011-12-21 20:10:32 UTC (rev 869) +++ source/abstractbutton.prg 2011-12-22 10:28:39 UTC (rev 870) @@ -107,10 +107,12 @@ METHOD Checked( lValue ) CLASS ABSTRACTBUTTON IF PCOUNT() == 0 - RETURN ::oQTObject:isChecked() +// RETURN ::oQTObject:isChecked() With ToolButton not works properly: we need usage of internal var + RETURN ::lChecked ELSEIF PCOUNT() == 1 .AND. hb_IsLogical( lValue ) ::oQTObject:setCheckable( .T. ) ::oQTObject:setChecked( lValue ) + ::lChecked := lValue ENDIF RETURN NIL This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <l3...@us...> - 2011-12-21 20:10:39
|
Revision: 869 http://hmg.svn.sourceforge.net/hmg/?rev=869&view=rev Author: l3wonsf Date: 2011-12-21 20:10:32 +0000 (Wed, 21 Dec 2011) Log Message: ----------- 2011-12-21 21:05 UTC+0100 Luigi Ferraris ( <luigi at l3w.it> ) - samples/checkbox/demo_1.prg - samples/checkbox/demo_2.prg - samples/checkbox/demo_3.prg + samples/checkbox/demo_1_oop.prg + samples/checkbox/demo_1_cmd.prg * to show usage of CHECKBOX using: OOp style and CMD style. - samples/checkbutton/demo_1.prg - samples/checkbutton/demo_2.prg - samples/checkbutton/demo_3.prg + samples/checkbutton/demo_1_oop.prg + samples/checkbutton/demo_1_cmd.prg * to show usage of CHECKBUTTON using: OOp style and CMD style. Modified Paths: -------------- Changelog Added Paths: ----------- samples/checkbox/demo_1_cmd.prg samples/checkbox/demo_1_oop.prg samples/checkbutton/demo_1_cmd.prg samples/checkbutton/demo_1_oop.prg Removed Paths: ------------- samples/checkbox/demo_1.prg samples/checkbox/demo_2.prg samples/checkbox/demo_3.prg samples/checkbutton/demo_1.prg samples/checkbutton/demo_2.prg samples/checkbutton/demo_3.prg Modified: Changelog =================================================================== --- Changelog 2011-12-21 17:38:37 UTC (rev 868) +++ Changelog 2011-12-21 20:10:32 UTC (rev 869) @@ -16,6 +16,21 @@ The license applies to all entries newer than 2009-04-28. */ +2011-12-21 21:05 UTC+0100 Luigi Ferraris ( <luigi at l3w.it> ) + - samples/checkbox/demo_1.prg + - samples/checkbox/demo_2.prg + - samples/checkbox/demo_3.prg + + samples/checkbox/demo_1_oop.prg + + samples/checkbox/demo_1_cmd.prg + * to show usage of CHECKBOX using: OOp style and CMD style. + + - samples/checkbutton/demo_1.prg + - samples/checkbutton/demo_2.prg + - samples/checkbutton/demo_3.prg + + samples/checkbutton/demo_1_oop.prg + + samples/checkbutton/demo_1_cmd.prg + * to show usage of CHECKBUTTON using: OOp style and CMD style. + 2011-12-21 18:30 UTC+0100 Luigi Ferraris ( <luigi at l3w.it> ) ! source/textbox.prg ! a bug related with DataType. Deleted: samples/checkbox/demo_1.prg =================================================================== --- samples/checkbox/demo_1.prg 2011-12-21 17:38:37 UTC (rev 868) +++ samples/checkbox/demo_1.prg 2011-12-21 20:10:32 UTC (rev 869) @@ -1,99 +0,0 @@ -/* - * $Id$ -*/ - -/* - * HMG 4 demo - * (c) 2010 Roberto Lopez <mai...@gm...> -*/ - -#include "hmg.ch" - -FUNCTION Main - - LOCAL oWindow, oLabel, oCheckBox, oCheckBox1, oCheckBox2, oButton2 - - HbQt_ErrorSys() - - WITH OBJECT oWindow := MAINWINDOW():New("oWindow") - :Row := 10 - :Col := 10 - :Width := 400 - :Height := 400 - :Title := 'Nice OOP Demo!!!' - :OnInit := { || oWindow:Center() } - - WITH OBJECT oLabel := Label():New("oLabel") - :Row := 10 - :Col := 10 - :Width := 300 - :Value := 'This is FOR status!' - END WITH - - WITH OBJECT oCheckBox := CheckBox():New("oCheckBox") - :Row := 40 - :Col := 10 - :Width := 100 - :Value := .F. - :Caption := 'Simple CheckBox!!!' - :OnChange := { || MsgInfo( "Simple CheckBox Value Changed!" ) } - END WITH - - WITH OBJECT oCheckBox1 := CheckBox():New("oCheckBox1") - :Row := 70 - :Col := 10 - :Width := 300 - :Height := 40 - :Value := .F. - :FontName := "Arial" - :FontSize := 12 - :FontBold := .T. - :FontItalic := .T. - :FontUnderline := .T. - :FontStrikeOut := .T. - :Caption := 'CheckBox WITH Font Properties' - END WITH - - WITH OBJECT oCheckBox2 := CheckBox():New("oCheckBox2") - :Row := 120 - :Col := 10 - :Width := 200 - :Value := .F. - :Caption := 'CheckBox WITH OnGot/LostFocus Events!!!' - :OnGotFocus := { || oLabel:Value := "oCheckBox GotFocus!" } - :OnLostFocus := { || oLabel:Value := "oCheckBox LostFocus!" } - END WITH - - /* - - WITH OBJECT oButton1 := Button():New("oButton1") - :Row := 190 - :Col := 40 - :Width := 220 - :Height := 28 - :Caption := 'Change Event Block!' - :OnClick := { || oCheckBox:OnChange := { ||MsgInfo( "Event Block OF On Change event OF checkbox dynamicallay Changed!" ) } } - END WITH - - */ - - WITH OBJECT oButton2 := Button():New("oButton2") - :Row := 230 - :Col := 40 - :Width := 220 - :Height := 28 - :Caption := 'oCheckBox:Value' - :OnClick := { || MsgInfo( IF ( oCheckBox:Value , '.T.' , '.F.' ) ) } - END WITH - - END WITH - - oWindow:Activate() - - HB_SYMBOL_UNUSED( oLabel ) - HB_SYMBOL_UNUSED( oCheckBox ) - HB_SYMBOL_UNUSED( oCheckBox1 ) - HB_SYMBOL_UNUSED( oCheckBox2 ) - HB_SYMBOL_UNUSED( oButton2 ) - -RETURN NIL Added: samples/checkbox/demo_1_cmd.prg =================================================================== --- samples/checkbox/demo_1_cmd.prg (rev 0) +++ samples/checkbox/demo_1_cmd.prg 2011-12-21 20:10:32 UTC (rev 869) @@ -0,0 +1,126 @@ +/* + * $Id$ +*/ + +/* + * HMG 4 demo + * (c) 2010 Roberto Lopez <mai...@gm...> +*/ + +#include "hmg.ch" + +MEMVAR oWindow + +FUNCTION Main() + + HbQt_ErrorSys() + + DEFINE MAINWINDOW oWindow + ROW 10 + COL 10 + WIDTH 400 + HEIGHT 400 + TITLE "CHECKBOX demo - (cmd style)" + ONINIT OnInit() + + DEFINE LABEL Label1 + ROW 10 + COL 10 + WIDTH 300 + VALUE "This is FOR status!" + END LABEL + + DEFINE CHECKBOX CheckBox1 + ROW 40 + COL 10 + WIDTH 100 + VALUE .F. + CAPTION "Simple CheckBox!!!" + ONCHANGE OnChange1() + END CHECKBOX + + DEFINE CHECKBOX CheckBox2 + ROW 70 + COL 10 + WIDTH 300 + HEIGHT 40 + VALUE .F. + FONTNAME "Arial" + FONTSIZE 12 + FONTBOLD .T. + FONTITALIC .T. + FONTUNDERLINE .T. + FONTSTRIKEOUT .T. + CAPTION "CheckBox WITH Font Properties" + ONCHANGE OnChange1() + END CHECKBOX + + DEFINE CHECKBOX CheckBox3 + ROW 120 + COL 10 + WIDTH 200 + VALUE .F. + CAPTION "CheckBox WITH OnGot/LostFocus Events!!!" + ONGOTFOCUS OnGotFocus1() + ONLOSTFOCUS OnLostFocus1() + END WITH + + DEFINE BUTTON Button1 + ROW 190 + COL 40 + WIDTH 220 + HEIGHT 28 + CAPTION "Change Event Block!" + ONCLICK OnClick1() + END BUTTON + + DEFINE BUTTON Button2 + ROW 230 + COL 40 + WIDTH 220 + HEIGHT 28 + CAPTION "oWindow:CheckBox1:Value" + ONCLICK OnClick2() + END BUTTON + + END WINDOW + + ACTIVATE WINDOW oWindow + +RETURN NIL + +PROCEDURE OnInit() + + oWindow:Center() + +RETURN + +PROCEDURE OnChange1() + + MsgInfo( "Simple CheckBox Value Changed!" ) + +RETURN + +PROCEDURE OnGotFocus1() + + oWindow:Label1:Value := "CheckBox3 GotFocus!" + +RETURN + +PROCEDURE OnLostFocus1() + + oWindow:Label1:Value := "CheckBox3 LostFocus!" + +RETURN + +PROCEDURE OnClick1() + + oWindow:CheckBox1:OnChange := { || MsgInfo( "Event Block OF On Change event OF checkbox dynamicallay Changed!" ) } + +RETURN + +PROCEDURE OnClick2() + + MsgInfo( IIF( oWindow:CheckBox1:Value , ".T." , ".F." ) ) + +RETURN Property changes on: samples/checkbox/demo_1_cmd.prg ___________________________________________________________________ Added: svn:keywords + Author Id Date Revision Added: svn:eol-style + native Added: samples/checkbox/demo_1_oop.prg =================================================================== --- samples/checkbox/demo_1_oop.prg (rev 0) +++ samples/checkbox/demo_1_oop.prg 2011-12-21 20:10:32 UTC (rev 869) @@ -0,0 +1,126 @@ +/* + * $Id$ +*/ + +/* + * HMG 4 demo + * (c) 2010 Roberto Lopez <mai...@gm...> +*/ + +#include "hmg.ch" + +MEMVAR oWindow + +FUNCTION Main() + + HbQt_ErrorSys() + + WITH OBJECT oWindow := MAINWINDOW():New() + :Row := 10 + :Col := 10 + :Width := 400 + :Height := 400 + :Title := "CHECKBOX demo - (oop style)" + :OnInit := {|| OnInit() } + + WITH OBJECT LABEL():New( "Label1" ) + :Row := 10 + :Col := 10 + :Width := 300 + :Value := "This is FOR status!" + END WITH + + WITH OBJECT CHECKBOX():New( "CheckBox1" ) + :Row := 40 + :Col := 10 + :Width := 100 + :Value := .F. + :Caption := "Simple CheckBox!!!" + :OnChange := { || OnChange1() } + END WITH + + WITH OBJECT CHECKBOX():New( "CheckBox2" ) + :Row := 70 + :Col := 10 + :Width := 300 + :Height := 40 + :Value := .F. + :FontName := "Arial" + :FontSize := 12 + :FontBold := .T. + :FontItalic := .T. + :FontUnderline := .T. + :FontStrikeOut := .T. + :Caption := "CheckBox WITH Font Properties" + :OnChange := { || OnChange1() } + END WITH + + WITH OBJECT CHECKBOX():New( "CheckBox3" ) + :Row := 120 + :Col := 10 + :Width := 200 + :Value := .F. + :Caption := "CheckBox WITH OnGot/LostFocus Events!!!" + :OnGotFocus := { || OnGotFocus1() } + :OnLostFocus := { || OnLostFocus1() } + END WITH + + WITH OBJECT BUTTON():New( "Button1" ) + :Row := 190 + :Col := 40 + :Width := 220 + :Height := 28 + :Caption := "Change Event Block!" + :OnClick := { || OnClick1() } + END WITH + + WITH OBJECT BUTTON():New( "Button2" ) + :Row := 230 + :Col := 40 + :Width := 220 + :Height := 28 + :Caption := "oWindow:CheckBox1:Value" + :OnClick := { || MsgInfo( IIF( oWindow:CheckBox1:Value , ".T." , ".F." ) ) } + END WITH + + END WITH + + oWindow:Activate() + +RETURN NIL + +PROCEDURE OnInit() + + oWindow:Center() + +RETURN + +PROCEDURE OnChange1() + + MsgInfo( "Simple CheckBox Value Changed!" ) + +RETURN + +PROCEDURE OnGotFocus1() + + oWindow:Label1:Value := "CheckBox3 GotFocus!" + +RETURN + +PROCEDURE OnLostFocus1() + + oWindow:Label1:Value := "CheckBox3 LostFocus!" + +RETURN + +PROCEDURE OnClick1() + + oWindow:CheckBox1:OnChange := { || MsgInfo( "Event Block OF On Change event OF checkbox dynamicallay Changed!" ) } + +RETURN + +PROCEDURE OnClick2() + + MsgInfo( IIF( oWindow:CheckBox1:Value , ".T." , ".F." ) ) + +RETURN Property changes on: samples/checkbox/demo_1_oop.prg ___________________________________________________________________ Added: svn:keywords + Author Id Date Revision Added: svn:eol-style + native Deleted: samples/checkbox/demo_2.prg =================================================================== --- samples/checkbox/demo_2.prg 2011-12-21 17:38:37 UTC (rev 868) +++ samples/checkbox/demo_2.prg 2011-12-21 20:10:32 UTC (rev 869) @@ -1,75 +0,0 @@ -/* - * $Id$ -*/ - -/* - * HMG 4 demo - * (c) 2010 Roberto Lopez <mai...@gm...> -*/ - -#include "hmg.ch" - -MEMVAR oWindow1 - -FUNCTION Main - - HbQt_ErrorSys() - - DEFINE MAINWINDOW oWindow1 - Row 10 - Col 10 - Width 400 - Height 400 - Title 'Nice OOP Demo!!!' - OnInit oWindow1:Center() - - @ 10,10 LABEL Label1; - Width 400 ; - Value 'This is FOR status!' - - @ 40,10 CHECKBOX CheckBox1 ; - Value .F. ; - Caption 'Simple CheckBox!!!' ; - On Change MsgInfo( "Check Box Value Changed!" ) - - @ 70,10 CHECKBOX CheckBox2 ; - Caption 'CheckBox WITH Font Properties!'; - Width 300 ; - Height 40 ; - Value .F. ; - Font "Arial" ; - Size 14 ; - Bold ; - Italic ; - Underline ; - Strikeout ; - On Change MsgInfo( "Check Box Value Changed!" ) - - @ 120,10 CHECKBOX CheckBox3 ; - Value .F. ; - Caption 'CheckBox WITH OnGot/LostFocus Events!!!' ; - Width 200 ; - ON GotFocus { || oWindow1:Label1:Value := "CheckBox GotFocus!" }; - ON LostFocus { || oWindow1:Label1:Value := "CheckBox LostFocus!" } - - /* Not ALLowed in current version - - @ 300,40 BUTTON Button1 ; - Width 150 ; - Height 28 ; - Caption 'Change Event Block!' ; - On Click oWindow1:CheckBox1:OnChange := { ||MsgInfo( "Event Block OF On Change event OF checkbox dynamicallay Changed!" ) } - - */ - - @ 350,40 BUTTON Button1 ; - Width 150 ; - Height 28 ; - Caption 'Win1:CheckBox1:Value' ; - On Click MsgInfo( IF ( oWindow1:CheckBox1:Value,'.T.','.F.' ) ) - - END WINDOW - - ACTIVATE WINDOW oWindow1 - -RETURN NIL Deleted: samples/checkbox/demo_3.prg =================================================================== --- samples/checkbox/demo_3.prg 2011-12-21 17:38:37 UTC (rev 868) +++ samples/checkbox/demo_3.prg 2011-12-21 20:10:32 UTC (rev 869) @@ -1,93 +0,0 @@ -/* - * $Id$ -*/ - -/* - * HMG 4 demo - * (c) 2010 Roberto Lopez <mai...@gm...> -*/ - -#include "hmg.ch" - -MEMVAR oWindow1 - -FUNCTION Main - - HbQt_ErrorSys() - - DEFINE MAINWINDOW oWindow1 - Row 10 - Col 10 - Width 400 - Height 400 - Title 'Nice OOP Demo!!!' - OnInit oWindow1:Center() - - DEFINE LABEL Label1 - Row 10 - Col 10 - Width 300 - Value 'This is FOR status!' - BackColor {200,200,200} - END LABEL - - DEFINE CHECKBOX Check1 - Row 40 - Col 10 - Value .F. - Caption 'Simple CheckBox!!!' - OnChange MsgInfo( "OOP CheckBox Value Changed!" ) - END CHECKBOX - - DEFINE CHECKBOX Check2 - Row 70 - Col 10 - Width 300 - Value .F. - Font "Arial" - Size 12 - Bold .T. - Italic .T. - Underline .T. - StrikeOut .T. - Caption 'CheckBox WITH Font Properties' - OnChange MsgInfo( "OOP CheckBox Value Changed!" ) - END CHECKBOX - - DEFINE CHECKBOX Check3 - Row 120 - Col 10 - Width 200 - Value .F. - Caption 'CheckBox WITH OnGot/LostFocus Events!!!' - OnGotFocus { || oWindow1:Label1:Value := "oCheckBox GotFocus!" } - OnLostFocus { || oWindow1:Label1:Value := "oCheckBox LostFocus!" } - END CHECKBOX - - /* Not ALLowed in current version - - DEFINE BUTTON Button2 - Row 150 - Col 40 - Width 140 - Height 28 - Caption 'Change Event Block!' - OnClick oWindow1:Check1:OnChange := { ||MsgInfo( "Event Block OF On Change event OF checkbox dynamicallay Changed!" ) } - END BUTTON - - */ - - DEFINE BUTTON Button1 - Row 180 - Col 40 - Width 140 - Height 28 - Caption 'Win1:Check1:Value' - OnClick MsgInfo( IF ( oWindow1:Check1:Value,'.T.','.F.' ) ) - END BUTTON - - END WINDOW - - ACTIVATE WINDOW oWindow1 - -RETURN NIL Deleted: samples/checkbutton/demo_1.prg =================================================================== --- samples/checkbutton/demo_1.prg 2011-12-21 17:38:37 UTC (rev 868) +++ samples/checkbutton/demo_1.prg 2011-12-21 20:10:32 UTC (rev 869) @@ -1,99 +0,0 @@ -/* - * $Id$ -*/ - -/* - * HMG 4 demo - * (c) 2010 Roberto Lopez <mai...@gm...> -*/ - -#include "hmg.ch" - -FUNCTION Main - - LOCAL oWindow , oCheckButton1 , oCheckButton2 - LOCAL oButton3, oButton4, oButton5, oButton6 - - HbQt_ErrorSys() - - WITH OBJECT oWindow := MAINWINDOW():New("oWindow") - :Row := 10 - :Col := 10 - :Width := 400 - :Height := 400 - :Title := 'Nice OOP Demo!!!' - :OnInit := { || oWindow:Center() } - - WITH OBJECT oCheckButton1 := CheckButton():New("oCheckButton1") - :Row := 40 - :Col := 40 - :Width := 180 - :Caption := 'Check Button!!!' - :OnClick := { || Button1Click( oCheckButton1 ) } - END WITH - - WITH OBJECT oCheckButton2 := CheckButton():New("oCheckButton2") - :Row := 70 - :Col := 40 - :Width := 180 - :Caption := 'Button WITH Left Image' - :Picture := 'help.bmp' - :Value := .T. - :PictAlignment := BTN_LEFT - END WITH - - WITH OBJECT oButton3 := CheckButton():New("oButton3") - :Row := 100 - :Col := 40 - :Width := 180 - :Caption := 'Button WITH Right Image' - :Picture := 'help.bmp' - :PictAlignment := BTN_RIGHT - END WITH - - WITH OBJECT oButton4 := CheckButton():New("oButton4") - :Row := 130 - :Col := 40 - :Width := 180 - :Flat := .T. - :Caption := 'oButton1:Flat := .T.' - END WITH - - WITH OBJECT oButton5 := CheckButton():New("oButton5") - :Row := 160 - :Col := 40 - :Width := 180 - :Caption := 'oButton1:Flat := .F.' - END WITH - - WITH OBJECT oButton6 := CheckButton():New("oButton6") - :Row := 190 - :Col := 40 - :Width := 180 - :Caption := '' - :Picture := 'help.bmp' - :PictAlignment := BTN_LEFT - :ToolTip := 'Image Only Button' - END WITH - - END WITH - - oWindow:Activate() - - HB_SYMBOL_UNUSED( oCheckbutton2 ) - HB_SYMBOL_UNUSED( oButton3 ) - HB_SYMBOL_UNUSED( oButton4 ) - HB_SYMBOL_UNUSED( oButton5 ) - HB_SYMBOL_UNUSED( oButton6 ) - -RETURN NIL - -/*----------------------------------------------------------------------*/ - -PROCEDURE Button1Click ( oButton1 ) - - oButton1:Caption := 'New Caption!' - - MsgInfo( oButton1:Caption , 'Standard Send Operator' ) - -RETURN Added: samples/checkbutton/demo_1_cmd.prg =================================================================== --- samples/checkbutton/demo_1_cmd.prg (rev 0) +++ samples/checkbutton/demo_1_cmd.prg 2011-12-21 20:10:32 UTC (rev 869) @@ -0,0 +1,102 @@ +/* + * $Id$ +*/ + +/* + * HMG 4 demo + * (c) 2010 Roberto Lopez <mai...@gm...> +*/ + +#include "hmg.ch" + +MEMVAR oWindow + +FUNCTION Main + + HbQt_ErrorSys() + + DEFINE MAINWINDOW oWindow + ROW 10 + COL 10 + WIDTH 400 + HEIGHT 400 + TITLE "CHECKBUTTON demo - (cmd style)" + ONINIT OnInit() + + DEFINE CHECKBUTTON CheckButton1 + ROW 40 + COL 40 + WIDTH 200 + CAPTION "Check Button!!!" + ONCLICK Button1Click() + END CHECKBUTTON + + DEFINE CHECKBUTTON CheckButton2 + ROW 70 + COL 40 + WIDTH 200 + CAPTION "Button WITH Left Image" + PICTURE "help.bmp" + VALUE .T. + PICTALIGNMENT LEFT + END CHECKBUTTON + + DEFINE CHECKBUTTON CheckButton3 + ROW 100 + COL 40 + WIDTH 200 + CAPTION "Button WITH Right Image" + PICTURE "help.bmp" + PICTALIGNMENT RIGHT + END CHECKBUTTON + + DEFINE CHECKBUTTON CheckButton4 + ROW 130 + COL 40 + WIDTH 200 + FLAT .T. + CAPTION "oWindow:CheckButton1:Flat .T." + ONCLICK OnClick1( .T. ) + END CHECKBUTTON + + DEFINE CHECKBUTTON CheckButton5 + ROW 160 + COL 40 + WIDTH 200 + CAPTION "oWindow:CheckButton1:Flat .F." + ONCLICK OnClick1( .F. ) + END CHECKBUTTON + + DEFINE CHECKBUTTON CheckButton6 + ROW 190 + COL 40 + WIDTH 200 + CAPTION "" + PICTURE "help.bmp" + PICTALIGNMENT LEFT + TOOLTIP "Image Only Button" + END CHECKBUTTON + + END WINDOW + + ACTIVATE WINDOW oWindow + +RETURN NIL + +PROCEDURE OnInit() + + oWindow:Center() + +RETURN + +PROCEDURE Button1Click() + + oWindow:CheckButton1:Caption := 'New Caption!' + +RETURN + +PROCEDURE OnClick1( lValue ) + + oWindow:CheckButton1:Flat := lValue + +RETURN Property changes on: samples/checkbutton/demo_1_cmd.prg ___________________________________________________________________ Added: svn:keywords + Author Id Date Revision Added: svn:eol-style + native Added: samples/checkbutton/demo_1_oop.prg =================================================================== --- samples/checkbutton/demo_1_oop.prg (rev 0) +++ samples/checkbutton/demo_1_oop.prg 2011-12-21 20:10:32 UTC (rev 869) @@ -0,0 +1,102 @@ +/* + * $Id$ +*/ + +/* + * HMG 4 demo + * (c) 2010 Roberto Lopez <mai...@gm...> +*/ + +#include "hmg.ch" + +MEMVAR oWindow + +FUNCTION Main + + HbQt_ErrorSys() + + WITH OBJECT oWindow := MAINWINDOW():New() + :Row := 10 + :Col := 10 + :Width := 400 + :Height := 400 + :Title := "CHECKBUTTON demo - (oop style)" + :OnInit := {|| OnInit() } + + WITH OBJECT CHECKBUTTON():New( "CheckButton1" ) + :Row := 40 + :Col := 40 + :Width := 200 + :Caption := "Check Button!!!" + :OnClick := { || Button1Click() } + END WITH + + WITH OBJECT CHECKBUTTON():New( "CheckButton2" ) + :Row := 70 + :Col := 40 + :Width := 200 + :Caption := "Button WITH Left Image" + :Picture := "help.bmp" + :Value := .T. + :PictAlignment := BTN_LEFT + END WITH + + WITH OBJECT CHECKBUTTON():New( "CheckButton3" ) + :Row := 100 + :Col := 40 + :Width := 200 + :Caption := "Button WITH Right Image" + :Picture := "help.bmp" + :PictAlignment := BTN_RIGHT + END WITH + + WITH OBJECT CHECKBUTTON():New( "CheckButton4") + :Row := 130 + :Col := 40 + :Width := 200 + :Flat := .T. + :Caption := "oWindow:CheckButton1:Flat := .T." + :OnClick := { || OnClick1( .T. ) } + END WITH + + WITH OBJECT CHECKBUTTON():New( "CheckButton5") + :Row := 160 + :Col := 40 + :Width := 200 + :Caption := "oWindow:CheckButton1:Flat := .F." + :OnClick := { || OnClick1( .F. ) } + END WITH + + WITH OBJECT CHECKBUTTON():New( "CheckButton6") + :Row := 190 + :Col := 40 + :Width := 200 + :Caption := "" + :Picture := "help.bmp" + :PictAlignment := BTN_LEFT + :ToolTip := "Image Only Button" + END WITH + + END WITH + + oWindow:Activate() + +RETURN NIL + +PROCEDURE OnInit() + + oWindow:Center() + +RETURN + +PROCEDURE Button1Click() + + oWindow:CheckButton1:Caption := 'New Caption!' + +RETURN + +PROCEDURE OnClick1( lValue ) + + oWindow:CheckButton1:Flat := lValue + +RETURN Property changes on: samples/checkbutton/demo_1_oop.prg ___________________________________________________________________ Added: svn:keywords + Author Id Date Revision Added: svn:eol-style + native Deleted: samples/checkbutton/demo_2.prg =================================================================== --- samples/checkbutton/demo_2.prg 2011-12-21 17:38:37 UTC (rev 868) +++ samples/checkbutton/demo_2.prg 2011-12-21 20:10:32 UTC (rev 869) @@ -1,63 +0,0 @@ -/* - * $Id$ -*/ - -/* - * HMG 4 demo - * (c) 2010 Roberto Lopez <mai...@gm...> -*/ - -#include "hmg.ch" - -MEMVAR oWindow1 - -FUNCTION Main - - PRIVATE oWindow1 - - HbQt_ErrorSys() - - DEFINE MAINWINDOW oWindow1 - Row 10 - Col 10 - Width 400 - Height 400 - Title 'Nice OOP Demo!!!' - OnInit oWindow1:Center() - - @ 40,10 CHECKBUTTON checkbutton1 ; - Caption 'Check Button!!!' ; - Picture 'help.bmp' ; - Value .T. ; - Flat ; - OnClick ButtonClick() - - @ 70,10 CHECKBUTTON checkbutton2 ; - Caption 'Check Button!!!' ; - Value .T. - - END WINDOW - - ACTIVATE WINDOW oWindow1 - - RETURN NIL - -/*----------------------------------------------------------------------*/ - -PROCEDURE ButtonClick() - - IF oWindow1.CheckButton1.Value - MsgInfo( "Checkbutton Checked!" ) - ELSE - MsgInfo( "Checkbutton Unchecked!" ) - ENDIF - - * SetProperty ( 'Win1' , 'Button1' , 'Caption' , 'New!' ) - * Or oWindow1:Button1:Caption := 'New!' - * Or oWindow1.Button1.Caption := 'New!' - - * MsgInfo( oWindow1:Button1:Caption , 'Standard Send Operator' ) - * MsgInfo( oWindow1.Button1.Caption , 'Alternate Send Operator' ) - * MsgInfo( GetProperty( 'Win1' , 'Button1' , 'Caption' ) , 'GetProperty()' ) - - RETURN Deleted: samples/checkbutton/demo_3.prg =================================================================== --- samples/checkbutton/demo_3.prg 2011-12-21 17:38:37 UTC (rev 868) +++ samples/checkbutton/demo_3.prg 2011-12-21 20:10:32 UTC (rev 869) @@ -1,71 +0,0 @@ -/* - * $Id$ -*/ - -/* - * HMG 4 demo - * (c) 2010 Roberto Lopez <mai...@gm...> -*/ - -#include "hmg.ch" - -MEMVAR oWindow1 - -FUNCTION Main - - PRIVATE oWindow1 - - HbQt_ErrorSys() - - DEFINE MAINWINDOW oWindow1 - Row 10 - Col 10 - Width 400 - Height 400 - Title 'Nice OOP Demo!!!' - OnInit oWindow1:Center() - - DEFINE CHECKBUTTON checkButton1 - Row 40 - Col 40 - Caption 'Check Button!!!' - Picture 'help.bmp' - Value .T. - Flat .T. - OnClick ButtonClick() - OnChange MsgInfo( "Changed" ) - END BUTTON - - DEFINE CHECKBUTTON checkButton2 - Row 70 - Col 40 - Caption 'Check Button!!!' - Value .T. - END BUTTON - - END WINDOW - - ACTIVATE WINDOW oWindow1 - - RETURN NIL - -/*----------------------------------------------------------------------*/ - -PROCEDURE ButtonClick() - - IF oWindow1.CheckButton1.Value - MsgInfo( "Checkbutton Checked!" ) - ELSE - MsgInfo( "Checkbutton Unchecked!" ) - ENDIF - - * SetProperty ( 'Win1' , 'Button1' , 'Caption' , 'New!' ) - * Or oWindow1:Button1:Caption := 'New!' - * Or oWindow1.Button1.Caption := 'New!' - - * MsgInfo( oWindow1:Button1:Caption , 'Standard Send Operator' ) - * MsgInfo( oWindow1.Button1.Caption , 'Alternate Send Operator' ) - * MsgInfo( GetProperty( 'Win1' , 'Button1' , 'Caption' ) , 'GetProperty()' ) - - RETURN - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <l3...@us...> - 2011-12-21 17:38:46
|
Revision: 868 http://hmg.svn.sourceforge.net/hmg/?rev=868&view=rev Author: l3wonsf Date: 2011-12-21 17:38:37 +0000 (Wed, 21 Dec 2011) Log Message: ----------- 2011-12-21 18:30 UTC+0100 Luigi Ferraris ( <luigi at l3w.it> ) ! source/textbox.prg ! a bug related with DataType. Modified Paths: -------------- Changelog source/textbox.prg Modified: Changelog =================================================================== --- Changelog 2011-12-21 17:31:35 UTC (rev 867) +++ Changelog 2011-12-21 17:38:37 UTC (rev 868) @@ -16,6 +16,10 @@ The license applies to all entries newer than 2009-04-28. */ +2011-12-21 18:30 UTC+0100 Luigi Ferraris ( <luigi at l3w.it> ) + ! source/textbox.prg + ! a bug related with DataType. + 2011-12-21 15:20 UTC+0100 Ricci Zepmeusel ( ricci at conzoft.de ) * samples/drag_and_drop/demo_1_cmd.prg Modified: source/textbox.prg =================================================================== --- source/textbox.prg 2011-12-21 17:31:35 UTC (rev 867) +++ source/textbox.prg 2011-12-21 17:38:37 UTC (rev 868) @@ -307,7 +307,7 @@ HMGAPP():quit() QUIT ENDIF - IF ! hb_IsNil( ::nDataType ) + IF ! hb_IsNil( ::nDataType ) .AND. nValue <> ::nDataType MsgQuit( "DataType can't be changed", "TEXTBOX class", NIL, "error within TEXTBOX class, DataType() method" ) HMGAPP():quit() QUIT This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |