You can subscribe to this list here.
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(3) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2012 |
Jan
(12) |
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
(24) |
Aug
(17) |
Sep
(31) |
Oct
(1) |
Nov
(9) |
Dec
(46) |
2013 |
Jan
(8) |
Feb
(13) |
Mar
(11) |
Apr
(13) |
May
(27) |
Jun
(64) |
Jul
(59) |
Aug
(2) |
Sep
(5) |
Oct
(5) |
Nov
(13) |
Dec
(5) |
2014 |
Jan
(8) |
Feb
(7) |
Mar
|
Apr
(25) |
May
(22) |
Jun
(9) |
Jul
(16) |
Aug
|
Sep
(2) |
Oct
(27) |
Nov
|
Dec
(75) |
2015 |
Jan
(21) |
Feb
(8) |
Mar
(1) |
Apr
(36) |
May
(42) |
Jun
(58) |
Jul
(26) |
Aug
(13) |
Sep
(5) |
Oct
|
Nov
(7) |
Dec
(15) |
2016 |
Jan
(20) |
Feb
(12) |
Mar
|
Apr
|
May
|
Jun
(10) |
Jul
(8) |
Aug
(29) |
Sep
(42) |
Oct
(11) |
Nov
(3) |
Dec
(1) |
2017 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
(5) |
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2018 |
Jan
(4) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(14) |
Sep
(13) |
Oct
(13) |
Nov
(32) |
Dec
(47) |
2019 |
Jan
(10) |
Feb
(9) |
Mar
|
Apr
(5) |
May
(2) |
Jun
(2) |
Jul
(1) |
Aug
|
Sep
(7) |
Oct
|
Nov
|
Dec
(7) |
2020 |
Jan
(2) |
Feb
|
Mar
(14) |
Apr
(12) |
May
(13) |
Jun
(10) |
Jul
(6) |
Aug
(11) |
Sep
(14) |
Oct
(9) |
Nov
(10) |
Dec
(14) |
2021 |
Jan
(11) |
Feb
(16) |
Mar
(15) |
Apr
(20) |
May
(13) |
Jun
(1) |
Jul
(1) |
Aug
(1) |
Sep
(3) |
Oct
(14) |
Nov
(4) |
Dec
(5) |
2022 |
Jan
(14) |
Feb
(12) |
Mar
(2) |
Apr
(2) |
May
(7) |
Jun
(16) |
Jul
(8) |
Aug
(12) |
Sep
(10) |
Oct
(14) |
Nov
(23) |
Dec
(17) |
2023 |
Jan
(9) |
Feb
|
Mar
|
Apr
(4) |
May
(8) |
Jun
|
Jul
(29) |
Aug
(43) |
Sep
(32) |
Oct
(28) |
Nov
(27) |
Dec
(27) |
2024 |
Jan
(5) |
Feb
(11) |
Mar
(2) |
Apr
|
May
(3) |
Jun
|
Jul
(3) |
Aug
(10) |
Sep
(7) |
Oct
(6) |
Nov
(10) |
Dec
(7) |
2025 |
Jan
(19) |
Feb
(14) |
Mar
(12) |
Apr
(21) |
May
(3) |
Jun
(7) |
Jul
(2) |
Aug
(8) |
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
|
|
1
|
2
(2) |
3
|
4
|
5
|
6
(1) |
7
|
8
(1) |
9
|
10
|
11
|
12
|
13
|
14
|
15
|
16
|
17
|
18
|
19
|
20
|
21
|
22
|
23
|
24
|
25
|
26
|
27
(5) |
28
(5) |
29
|
30
(3) |
31
|
|
From: <lf...@us...> - 2012-08-30 19:06:47
|
Revision: 1876 http://hwgui.svn.sourceforge.net/hwgui/?rev=1876&view=rev Author: lfbasso Date: 2012-08-30 19:06:41 +0000 (Thu, 30 Aug 2012) Log Message: ----------- Modified Paths: -------------- trunk/hwgui/Changelog trunk/hwgui/source/hhyper.prg Modified: trunk/hwgui/Changelog =================================================================== --- trunk/hwgui/Changelog 2012-08-30 15:50:49 UTC (rev 1875) +++ trunk/hwgui/Changelog 2012-08-30 19:06:41 UTC (rev 1876) @@ -8,6 +8,11 @@ 2002-12-01 23:12 UTC+0100 Foo Bar <fo...@fo...> */ +2012-08-30 16:50 UTC-0300 Luis Fernando Basso <lfbasso at via-rs.net> + * source/hhyper.prg + * METHOD NEW() + ! fix in parameter bClick + 2012-08-30 10:50 UTC-0300 Luis Fernando Basso <lfbasso at via-rs.net> * source/hcontrol.prg * CLASS HButton @@ -54,7 +59,7 @@ * source/hedit.prg * METHOD New() activate KILLFOCUS when ::bSetGet = Nil .and. bLostFocus = Nil - force the pass through function CHECKFOCUS to set PROPERTY lwhen + force the pass through function CHECKFOCUS to set PROPERTY lnowhen * METHOD onEvent() ! msg == WM_SETFOCUS changed condition ( ::lPicComplex ) to ( "R" $ ::cPicFunc ) * METHOD Value @@ -84,7 +89,7 @@ * METHOD onEvent() ! minor fix in Paint() * source/hsplit.prg - + DATA lScrolling + + DATA lScrolling * METHOD New() ! add two news parameters lTransp, lScrolling ) transparent and real scrolling * METHOD onEvent() Modified: trunk/hwgui/source/hhyper.prg =================================================================== --- trunk/hwgui/source/hhyper.prg 2012-08-30 15:50:49 UTC (rev 1875) +++ trunk/hwgui/source/hhyper.prg 2012-08-30 19:06:41 UTC (rev 1876) @@ -86,7 +86,7 @@ ::hbitmap := hbitmap Super:New( oWndParent, nId, nStyle, nLeft, nTop, nWidth, nHeight, cCaption, oFont, bInit, ; - bSize, bPaint, ctooltip, tcolor, bcolor, lTransp )//, bClick ) + bSize, bPaint, ctooltip, tcolor, bcolor, lTransp, bClick ) DEFAULT vColor TO RGB( 5, 34, 143 ) DEFAULT lColor TO RGB( 0, 0, 255 ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lf...@us...> - 2012-08-30 15:50:59
|
Revision: 1875 http://hwgui.svn.sourceforge.net/hwgui/?rev=1875&view=rev Author: lfbasso Date: 2012-08-30 15:50:49 +0000 (Thu, 30 Aug 2012) Log Message: ----------- Modified Paths: -------------- trunk/hwgui/source/hcontrol.prg Modified: trunk/hwgui/source/hcontrol.prg =================================================================== --- trunk/hwgui/source/hcontrol.prg 2012-08-30 13:09:07 UTC (rev 1874) +++ trunk/hwgui/source/hcontrol.prg 2012-08-30 15:50:49 UTC (rev 1875) @@ -575,7 +575,6 @@ RETURN Self METHOD Activate() CLASS HStatus - LOCAL aCoors IF ! Empty( ::oParent:handle ) ::handle := CreateStatusWindow( ::oParent:handle, ::id ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lf...@us...> - 2012-08-30 13:09:17
|
Revision: 1874 http://hwgui.svn.sourceforge.net/hwgui/?rev=1874&view=rev Author: lfbasso Date: 2012-08-30 13:09:07 +0000 (Thu, 30 Aug 2012) Log Message: ----------- 2012-08-30 10:50 UTC-0300 Luis Fernando Basso <lfbasso at via-rs.net> * source/hcontrol.prg * CLASS HButton * METHOD REDEFINE() * METHOD WHEN() * METHOD VALID() ! minor fix Modified Paths: -------------- trunk/hwgui/Changelog trunk/hwgui/source/hcontrol.prg Modified: trunk/hwgui/Changelog =================================================================== --- trunk/hwgui/Changelog 2012-08-28 13:08:29 UTC (rev 1873) +++ trunk/hwgui/Changelog 2012-08-30 13:09:07 UTC (rev 1874) @@ -8,6 +8,14 @@ 2002-12-01 23:12 UTC+0100 Foo Bar <fo...@fo...> */ +2012-08-30 10:50 UTC-0300 Luis Fernando Basso <lfbasso at via-rs.net> + * source/hcontrol.prg + * CLASS HButton + * METHOD REDEFINE() + * METHOD WHEN() + * METHOD VALID() + ! minor fix + 2012-08-28 10:50 UTC-0300 Luis Fernando Basso <lfbasso at via-rs.net> * samples/tools/hcalculator.prg ! fixed keyboard Modified: trunk/hwgui/source/hcontrol.prg =================================================================== --- trunk/hwgui/source/hcontrol.prg 2012-08-28 13:08:29 UTC (rev 1873) +++ trunk/hwgui/source/hcontrol.prg 2012-08-30 13:09:07 UTC (rev 1874) @@ -1011,7 +1011,7 @@ ::Activate() //IF bGFocus != NIL - ::bGetFocus := bGFocus + ::bGetFocus := bGFocus ::oParent:AddEvent( BN_SETFOCUS, Self, { || ::onGetFocus() } ) ::oParent:AddEvent( BN_KILLFOCUS, self, {|| ::onLostFocus()}) //ENDIF @@ -1047,10 +1047,10 @@ bSize, bPaint, cTooltip, tcolor, bColor ) ::title := cCaption - IF bGFocus != NIL - ::bGetFocus := bGFocus - ::oParent:AddEvent( BN_SETFOCUS, Self, { || ::onGetFocus() } ) - ENDIF + //IF bGFocus != NIL + ::bGetFocus := bGFocus + ::oParent:AddEvent( BN_SETFOCUS, Self, { || ::onGetFocus() } ) + //ENDIF ::oParent:AddEvent( BN_KILLFOCUS, self, {|| ::onLostFocus()}) ::bClick := bClick IF bClick != NIL @@ -1169,11 +1169,11 @@ METHOD onGetFocus() CLASS HButton LOCAL res := .t., nSkip - IF ::bGetFocus = Nil .OR. ! CheckFocus( Self, .f. ) + IF ! CheckFocus( Self, .f. ) .OR. ::bGetFocus = Nil RETURN .t. ENDIF - nSkip := IIf( GetKeyState( VK_UP ) < 0 .or. ( GetKeyState( VK_TAB ) < 0 .and. GetKeyState( VK_SHIFT ) < 0 ), - 1, 1 ) IF ::bGetFocus != Nil + nSkip := IIf( GetKeyState( VK_UP ) < 0 .or. ( GetKeyState( VK_TAB ) < 0 .and. GetKeyState( VK_SHIFT ) < 0 ), - 1, 1 ) ::oParent:lSuspendMsgsHandling := .t. res := Eval( ::bGetFocus, ::title, Self ) ::oParent:lSuspendMsgsHandling := .f. @@ -1192,7 +1192,8 @@ IF ::lflat InvalidateRect( ::oParent:Handle, 1 , ::nLeft, ::nTop, ::nLeft + ::nWidth, ::nTop + ::nHeight ) ENDIF - IF ::bLostFocus != Nil .AND. PtrtouLong( GetParent( GetFocus() ) ) = PtrtouLong( ::getparentform():Handle ) //CheckFocus( Self, .f. ) + ::lnoWhen := .F. + IF ::bLostFocus != Nil .AND. SelfFocus( GetParent( GetFocus() ), ::getparentform():Handle ) ::oparent:lSuspendMsgsHandling := .t. Eval( ::bLostFocus, ::title, Self) ::oparent:lSuspendMsgsHandling := .f. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lf...@us...> - 2012-08-28 13:08:36
|
Revision: 1873 http://hwgui.svn.sourceforge.net/hwgui/?rev=1873&view=rev Author: lfbasso Date: 2012-08-28 13:08:29 +0000 (Tue, 28 Aug 2012) Log Message: ----------- Modified Paths: -------------- trunk/hwgui/Changelog trunk/hwgui/samples/tools/hcalculator.prg Modified: trunk/hwgui/Changelog =================================================================== --- trunk/hwgui/Changelog 2012-08-28 04:49:44 UTC (rev 1872) +++ trunk/hwgui/Changelog 2012-08-28 13:08:29 UTC (rev 1873) @@ -8,6 +8,10 @@ 2002-12-01 23:12 UTC+0100 Foo Bar <fo...@fo...> */ +2012-08-28 10:50 UTC-0300 Luis Fernando Basso <lfbasso at via-rs.net> + * samples/tools/hcalculator.prg + ! fixed keyboard + 2012-08-28 01:50 UTC-0300 Luis Fernando Basso <lfbasso at via-rs.net> * samples + folder Tools Modified: trunk/hwgui/samples/tools/hcalculator.prg =================================================================== --- trunk/hwgui/samples/tools/hcalculator.prg 2012-08-28 04:49:44 UTC (rev 1872) +++ trunk/hwgui/samples/tools/hcalculator.prg 2012-08-28 13:08:29 UTC (rev 1873) @@ -216,6 +216,9 @@ Local nLen := Len( oForm:oVisor:Caption ), nCars Private nCalculo1 , ncalculo2 + IF IsCtrlShift( .F., .T. ) .AND. ( cNumero = "5" .OR. cNumero = "8" ) + cNumero := IIF( cNumero = "8", "*", IIF( cNumero = "5", "%", cNumero ) ) + ENDIF If cNumero $ "/*-+%=" nCars := oForm:oCalculo:nWidth / ::nFontSize oForm:oCalculo:Caption += oForm:oVisor:Caption + " "+cNumero+" " @@ -307,31 +310,19 @@ SETDLGKEY( ::oFormCalc ,,8,{|| ::Calculando( " ") }) SETDLGKEY( ::oFormCalc ,,46,{|| ::Calculando( "") }) - SETDLGKEY( ::oFormCalc ,,48,{|| ::Calculando( "0") }) - SETDLGKEY( ::oFormCalc ,,49,{|| ::Calculando( "1") }) - SETDLGKEY( ::oFormCalc ,,50,{|| ::Calculando( "2") }) - SETDLGKEY( ::oFormCalc ,,51,{|| ::Calculando( "3") }) - SETDLGKEY( ::oFormCalc ,,52,{|| ::Calculando( "4") }) - SETDLGKEY( ::oFormCalc ,,53,{|| ::Calculando( "5") }) - SETDLGKEY( ::oFormCalc ,,54,{|| ::Calculando( "6") }) - SETDLGKEY( ::oFormCalc ,,55,{|| ::Calculando( "7") }) - SETDLGKEY( ::oFormCalc ,,56,{|| ::Calculando( "8") }) - SETDLGKEY( ::oFormCalc ,,57,{|| ::Calculando( "9") }) - SETDLGKEY( ::oFormCalc ,VK_SHIFT,56,{|| ::Calculando( "*") }) SETDLGKEY( ::oFormCalc ,,110,{|| ::Calculando( ",") }) SETDLGKEY( ::oFormCalc ,,188,{|| ::Calculando( ",") }) SETDLGKEY( ::oFormCalc ,,190,{|| ::Calculando( ".") }) SETDLGKEY( ::oFormCalc ,,194,{|| ::Calculando( ".") }) SETDLGKEY( ::oFormCalc ,,106,{|| ::Calculando( "*") }) SETDLGKEY( ::oFormCalc ,,107,{|| ::Calculando( "+") }) + SETDLGKEY( ::oFormCalc ,FSHIFT,187,{|| ::Calculando( "+") }) SETDLGKEY( ::oFormCalc ,,109,{|| ::Calculando( "-") }) + SETDLGKEY( ::oFormCalc ,,189,{|| ::Calculando( "-") }) SETDLGKEY( ::oFormCalc ,,111,{|| ::Calculando( "/") }) - SETDLGKEY( ::oFormCalc ,,186,{|| ::Calculando( "*") }) + SETDLGKEY( ::oFormCalc ,,193,{|| ::Calculando( "/") }) SETDLGKEY( ::oFormCalc ,,187,{|| ::Calculando( "=") }) SETDLGKEY( ::oFormCalc ,,13,{|| ::Calculando( "=") }) - SETDLGKEY( ::oFormCalc ,VK_SHIFT,187,{|| ::Calculando( "+") }) - SETDLGKEY( ::oFormCalc ,,189,{|| ::Calculando( "-") }) - SETDLGKEY( ::oFormCalc ,,81,{|| ::Calculando( "/") }) ::lClear := .t. ::aOperando := { , , 0 } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lf...@us...> - 2012-08-28 04:49:50
|
Revision: 1872 http://hwgui.svn.sourceforge.net/hwgui/?rev=1872&view=rev Author: lfbasso Date: 2012-08-28 04:49:44 +0000 (Tue, 28 Aug 2012) Log Message: ----------- Modified Paths: -------------- trunk/hwgui/samples/tools/calculator.prg trunk/hwgui/samples/tools/hcalculator.prg Modified: trunk/hwgui/samples/tools/calculator.prg =================================================================== --- trunk/hwgui/samples/tools/calculator.prg 2012-08-28 04:45:59 UTC (rev 1871) +++ trunk/hwgui/samples/tools/calculator.prg 2012-08-28 04:49:44 UTC (rev 1872) @@ -1,10 +1,19 @@ +/* + * $Id: calculator.prg + * + * HWGUI - Harbour Win32 GUI library + * + * Sample + * +*/ + #Include "hwgui.ch" STATIC Thisform Function Main () - INIT WINDOW oMain MAIN TITLE "Calculato Sample" ; + INIT WINDOW oMain MAIN TITLE "Calculator Sample" ; AT 0,0 ; SIZE GetDesktopWidth() - 100, GetDesktopHeight() - 78 Modified: trunk/hwgui/samples/tools/hcalculator.prg =================================================================== --- trunk/hwgui/samples/tools/hcalculator.prg 2012-08-28 04:45:59 UTC (rev 1871) +++ trunk/hwgui/samples/tools/hcalculator.prg 2012-08-28 04:49:44 UTC (rev 1872) @@ -1,6 +1,6 @@ /* + * $Id: hcalculator.prg * - * * HWGUI - Harbour Win32 GUI library source code: * HCalculator class * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lf...@us...> - 2012-08-28 04:46:07
|
Revision: 1871 http://hwgui.svn.sourceforge.net/hwgui/?rev=1871&view=rev Author: lfbasso Date: 2012-08-28 04:45:59 +0000 (Tue, 28 Aug 2012) Log Message: ----------- 2012-08-28 01:50 UTC-0300 Luis Fernando Basso <lfbasso at via-rs.net> * samples + folder Tools + file class hcalculator.prg + file calculator.prg + file calculator.xml * source/hedit.prg * METHOD NEW() ! add event setfocus when bGetFocus = nil * METHOD VALID() * METHOD WHEN() ! fix when object is hupdown class * source/hupdown.prg * METHOD Refresh() ! minor fix Modified Paths: -------------- trunk/hwgui/Changelog trunk/hwgui/source/hedit.prg trunk/hwgui/source/hupdown.prg Added Paths: ----------- trunk/hwgui/samples/tools/ trunk/hwgui/samples/tools/calculator.prg trunk/hwgui/samples/tools/calculator.xml trunk/hwgui/samples/tools/hcalculator.prg Modified: trunk/hwgui/Changelog =================================================================== --- trunk/hwgui/Changelog 2012-08-28 02:12:18 UTC (rev 1870) +++ trunk/hwgui/Changelog 2012-08-28 04:45:59 UTC (rev 1871) @@ -8,6 +8,23 @@ 2002-12-01 23:12 UTC+0100 Foo Bar <fo...@fo...> */ +2012-08-28 01:50 UTC-0300 Luis Fernando Basso <lfbasso at via-rs.net> + * samples + + folder Tools + + file class hcalculator.prg + + file calculator.prg + + file calculator.xml + * source/hedit.prg + * METHOD NEW() + ! add event setfocus when bGetFocus = nil + * METHOD VALID() + * METHOD WHEN() + ! fix when object is hupdown class + * source/hupdown.prg + * METHOD Refresh() + ! minor fix + + 2012-08-27 22:50 UTC-0300 Luis Fernando Basso <lfbasso at via-rs.net> * include/window.ch ! constant moved from place Added: trunk/hwgui/samples/tools/calculator.prg =================================================================== --- trunk/hwgui/samples/tools/calculator.prg (rev 0) +++ trunk/hwgui/samples/tools/calculator.prg 2012-08-28 04:45:59 UTC (rev 1871) @@ -0,0 +1,74 @@ + +#Include "hwgui.ch" +STATIC Thisform + +Function Main () + + INIT WINDOW oMain MAIN TITLE "Calculato Sample" ; + AT 0,0 ; + SIZE GetDesktopWidth() - 100, GetDesktopHeight() - 78 + + MENU OF oMain + MENUITEM "&Exit" ACTION oMain:Close() + MENUITEM "&Demo" ACTION Calculator() + ENDMENU + + ACTIVATE WINDOW oMain + +Return Nil + +FUNCTION calculator( ) + + LOCAL oDlg, oGroup1, oBtn1, oOw1, oValue, oLabel1 + + LOCAL vValue := 0 + + + INIT DIALOG oDlg TITLE "Calculando" ; + AT 0, 0 SIZE 415,325 ; + FONT HFont():Add( 'Verdana',0,-13,400,,,) CLIPPER NOEXIT ; + STYLE WS_POPUP+WS_CAPTION+WS_SYSMENU+WS_SIZEBOX+DS_CENTER + Thisform := oDlg + + @ 272,63 OWNERBUTTON oOw1 SIZE 106,36 ; + TEXT 'Calculator' ; + COORDINATES 3, 0, 0, 0 ; + ON CLICK {|| oOw1_onClick( ) } + @ 72,102 SAY oLabel2 CAPTION "F2 - activate calculator" SIZE 235,26 ; + STYLE SS_CENTER +DT_VCENTER+DT_SINGLELINE+WS_DLGFRAME +WS_DISABLED + @ 119,71 GET UPDOWN oValue VAR vValue ; + RANGE -2147483647,2147483647 INCREMENT 1 SIZE 149,24 PICTURE '999,999.99' ; + VALID {|| thisform:oLabel2:disable( ) } ; + WHEN {|| thisform:oLabel2:Enable( ) } ; + ON KEYDOWN {|This, nKeyPress, nShiftAltCtrl| oValue_onKeyDown( This, nKeyPress, nShiftAltCtrl ) } + oValue:FontBold := .T. + @ 72,74 SAY oLabel1 CAPTION "Value:" SIZE 42,21 + + @ 22,30 GROUPBOX oGroup1 CAPTION "Calculator" SIZE 368,106 ; + STYLE BS_LEFT + @ 297,271 BUTTONEX oBtn1 CAPTION "OK" SIZE 100,42 ; + STYLE BS_CENTER +WS_TABSTOP ; + ON CLICK {|| thisform:Close( ) } + + ACTIVATE DIALOG oDlg + + +RETURN oDlg:lresult + +STATIC FUNCTION oOw1_onClick + LOCAL ocalc + oCalc := HCalculator():New('Calculator') + oCalc:Show() + RETURN .T. + + +STATIC FUNCTION oValue_onKeyDown( This, nKeyPress, nShiftAltCtrl ) + + LOCAL oCalc + IF nKeyPress = VK_F2 + oCalc := HCalculator():New() + oCalc:Show( This, .T. ) + ENDIF + RETURN .T. + + Added: trunk/hwgui/samples/tools/calculator.xml =================================================================== --- trunk/hwgui/samples/tools/calculator.xml (rev 0) +++ trunk/hwgui/samples/tools/calculator.xml 2012-08-28 04:45:59 UTC (rev 1871) @@ -0,0 +1,124 @@ +<?xml version="1.0" encoding="UTF-8"?> +<part class="form"> + <style> + <property name="Geometry">{16,0,415,325}</property> + <property name="Name">[]</property> + <property name="Caption">[Calculando]</property> + <property name="AlwaysOnTop">.F.</property> + <property name="AutoCenter">.T.</property> + <property name="Font"> + <font name="Verdana" width="0" height="-13" weight="400"/> + </property> + <property name="Icon">[]</property> + <property name="FormType">[dlgModal]</property> + <property name="Modal">.F.</property> + <property name="FromStyle">[Popup]</property> + <property name="ScopeCtrlObj">[Local]</property> + <property name="ScopeVarObj">[Local]</property> + <property name="lClipper">.T.</property> + <property name="lExitOnEnter">.T.</property> + <property name="lExitOnESC">.T.</property> + <property name="Clipsiblings">.F.</property> + <property name="Clipchildren">.F.</property> + <property name="TitleBar">.T.</property> + <property name="StyleBorder">[3 - Sizable (Default)]</property> + <property name="NoIcon">.F.</property> + <property name="SystemMenu">.T.</property> + <property name="Minimizebox">.F.</property> + <property name="Maximizebox">.F.</property> + <property name="Closable">.T.</property> + <property name="AbsAlignment">.T.</property> + <property name="WindowState">[1 - Normal (Default)]</property> + <property name="minHeight">-1</property> + <property name="maxHeight">-1</property> + <property name="minWidth">-1</property> + <property name="maxWidth">-1</property> + <property name="ScrollBars">[0 - None (Default)]</property> + <property name="DSControl">.F.</property> + </style> + <part class="group" inclass=""> + <style> + <property name="Geometry">{22,30,368,106}</property> + <property name="Name">[oGroup1]</property> + <property name="Caption">[Calculator]</property> + <property name="TabIndex">1</property> + </style> + <part class="ownerbutton"> + <style> + <property name="Geometry">{272,63,106,36}</property> + <property name="Name">[oOw1]</property> + <property name="Caption">[Calculator]</property> + <property name="TextLeft">3</property> + <property name="Bitmap">[..\image\calcular.bmp]</property> + <property name="BmpLeft">74</property> + <property name="TabIndex">3</property> + </style> + <method name="onClick" =""> + <![CDATA[LOCAL ocalc + +oCalc := HCalculator():New('Calculator') +oCalc:Show()]]> + </method> + </part> + <part class="label"> + <style> + <property name="Geometry">{72,102,235,26}</property> + <property name="Name">[oLabel2]</property> + <property name="Caption">[F2 - activate calculator]</property> + <property name="Justify">[Center]</property> + <property name="VAlignment">[Center]</property> + <property name="WordWrap">.F.</property> + <property name="3DLook">.T.</property> + <property name="Enabled">.F.</property> + <property name="TabIndex">3</property> + </style> + </part> + <part class="updown"> + <style> + <property name="Geometry">{119,71,149,24}</property> + <property name="Name">[oValue]</property> + <property name="varName">[vValue]</property> + <property name="nLower">-2147483647</property> + <property name="nUpper">2147483647</property> + <property name="FontBold">.T.</property> + <property name="cPicture">[999,999.99]</property> + <property name="TabIndex">4</property> + </style> + <method name="onLostFocus" =""> + <![CDATA[thisform:oLabel2:disable( )]]> + </method> + <method name="onGetFocus" =""> + <![CDATA[thisform:oLabel2:Enable( )]]> + </method> + <method name="onKeyDown" =""> + <![CDATA[Parameters This, nKeyPress, nShiftAltCtrl +LOCAL oCalc + +IF nKeyPress = VK_F2 + oCalc := HCalculator():New() + oCalc:Show( This, .T. ) +ENDIF +RETURN .T. ]]> + </method> + </part> + <part class="label"> + <style> + <property name="Geometry">{72,74,42,21}</property> + <property name="Name">[oLabel1]</property> + <property name="Caption">[Value:]</property> + <property name="TabIndex">5</property> + </style> + </part> + </part> + <part class="buttonex" inclass=""> + <style> + <property name="Geometry">{297,271,100,42}</property> + <property name="Name">[oBtn1]</property> + <property name="Caption">[OK]</property> + <property name="TabIndex">2</property> + </style> + <method name="onClick" =""> + <![CDATA[thisform:Close( )]]> + </method> + </part> +</part> Added: trunk/hwgui/samples/tools/hcalculator.prg =================================================================== --- trunk/hwgui/samples/tools/hcalculator.prg (rev 0) +++ trunk/hwgui/samples/tools/hcalculator.prg 2012-08-28 04:45:59 UTC (rev 1871) @@ -0,0 +1,369 @@ +/* + * + * + * HWGUI - Harbour Win32 GUI library source code: + * HCalculator class + * + * Copyright 2012 LuisFernandoBasso <lf...@vi...> + * +*/ + +#include "windows.ch" +#include "hbclass.ch" +#include "guilib.ch" + +CLASS HCalculator + + CLASS VAR Hwnd SHARED + DATA oFormCalc + DATA oCurrGet + DATA Title INIT "Calculadora" + DATA lDecimal + DATA nResultado + DATA cOperador + DATA aOperando + DATA lClear + DATA nMemory + DATA bColor INIT RGB( 255, 255, 255 ) + DATA nLeft INIT 0 + DATA nTop INIT 0 + DATA nWidth INIT 196 + DATA nHeight INIT 224 + DATA lCompacta INIT .F. + DATA Style, nFontSize + + METHOD New( cTitle, lCompacta, nLeft, nTop, nWidth, nHeight, bcolor ) + METHOD DefineStyle( lCompacta, nLeft, nTop, nWidth, nHeight, bcolor ) PROTECTED + METHOD INIT( oCurrGet ) + METHOD Show( oGet, lCompacta, nLeft, nTop, nWidth, nHeight, bcolor ) + METHOD Calculando( cNumero ) + METHOD GetRefresh( ) + METHOD End() INLINE ::GetRefresh(), IIf( ::lCompacta, PostMessage( ::oFormCalc:Handle, WM_CLOSE, 0, 0 ), ) +ENDCLASS + +METHOD New( cTitle, lCompacta, nLeft, nTop, nWidth, nHeight, bcolor ) CLASS HCalculator + + ::Title := IIF( cTitle == Nil, ::Title, cTitle ) + ::DefineStyle( lCompacta, nLeft, nTop, nWidth, nHeight, bcolor ) + + RETURN Self + +METHOD DefineStyle( lCompacta, nLeft, nTop, nWidth, nHeight, bcolor ) CLASS HCalculator + LOCAL nStyle + + ::bColor := IIf( bColor == Nil, ::bColor, bColor ) + ::lCompacta := IIf( lCompacta == Nil, ::lCompacta, lCompacta ) + ::nLeft := IIf( nLeft == Nil, ::nLeft, nLeft ) + ::nTop := IIf( nTop == Nil, ::nTop, nTop ) + + ::Style := WS_POPUP + IIf( EMPTY( lCompacta ), WS_CAPTION + WS_SYSMENU + WS_SIZEBOX + ; + IIf( ::nLeft + ::nTop = 0, DS_CENTER, 0 ), DS_CONTROL + DS_MODALFRAME ) + ::nWidth := IIf( nWidth == Nil, ::nWidth, nWidth ) + ::nHeight := IIf( nHeight == Nil, ::nHeight, nHeight ) + + RETURN Nil + +METHOD Show( oGet, lCompacta, nLeft, nTop, nWidth, nHeight, bcolor ) CLASS HCalculator + + LOCAL oCnt1, oCalculo, oVisor, oBtn4, oBtn18, oBtn19, oBtn20 ; + , oBtn9, oBtn16, oBtn17, oBtn15, oBtn8, oBtn12, oBtn13, oBtn14 ; + , oBtn11, oBtn21, oBtn22, oBtn3, oBtn5, oBtn6 ; + , oBtn7, oBtn10, obtnres, oBtn23, oMemory + + LOCAL hWin := GetActiveWindow() + ::oCurrGet := oGet + ::DefineStyle( lCompacta, nLeft, nTop, nWidth, nHeight, bcolor ) + + IF !::lCompacta .AND. ::Hwnd != Nil + SetWindowPos( ::Hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE + SWP_NOMOVE + SWP_FRAMECHANGED ) + RETURN Nil + ENDIF + INIT DIALOG ::oFormCalc TITLE ::Title ; + COLOR ::bColor ; //15852761 ; + AT ::nLeft, ::nTop SIZE ::nWidth, ::nHeight ; + FONT HFont():Add( 'Verdana',0,-13, 400,,,) NOEXIT ; + STYLE ::Style ; + ON INIT {|This| ::Init( This, oGet ) } ; + ON LOSTFOCUS {| | IIF( ::lCompacta, ::End(), .T. ) } ; + ON EXIT { | | ::Hwnd := Nil ,::GetRefresh( ) } + + ::oFormCalc:minHeight := 220 + ::oFormCalc:maxHeight := 258 + ::oFormCalc:minWidth := 150 + + @ 4,3 CONTAINER oCnt1 SIZE 190,58 ; + STYLE 2; + BACKCOLOR 16578289 ; + BACKSTYLE 2 + oCnt1:Anchor := 75 + @ 156,189 BUTTONEX obtnres CAPTION "=" SIZE 34,28 ; + STYLE BS_CENTER ; + FONT HFont():Add( 'Verdana',0,-16,700,,,) ; + ON CLICK {|| ::Calculando( "=") } + obtnres:FontBold := .T. + @ 119,189 BUTTONEX oBtn10 CAPTION "+" SIZE 34,28 ; + STYLE BS_CENTER ; + FONT HFont():Add( 'Verdana',0,-12,400,,,) ; + ON CLICK {|| ::Calculando( "+") } + @ 82,189 BUTTONEX oBtn7 CAPTION "," SIZE 34,28 ; + STYLE BS_CENTER ; + ON CLICK {|| ::Calculando( ",") } + @ 8,189 BUTTONEX oBtn6 CAPTION "&0" SIZE 72,28 ; + STYLE BS_CENTER ; + ON CLICK {|| ::Calculando( "0") } + @ 156,158 BUTTONEX oBtn11 CAPTION "%" SIZE 34,28 ; + STYLE BS_CENTER ; + FONT HFont():Add( 'Verdana',0,-12,400,,,) ; + ON CLICK {|| ::Calculando( "%") } + @ 119,158 BUTTONEX oBtn5 CAPTION "-" SIZE 34,28 ; + STYLE BS_CENTER ; + ON CLICK {|| ::Calculando( "-") } + @ 82,158 BUTTONEX oBtn3 CAPTION "&3" SIZE 34,28 ; + STYLE BS_CENTER ; + ON CLICK {|| ::Calculando( "3") } + @ 45,158 BUTTONEX oBtn2 CAPTION "&2" SIZE 34,28 ; + STYLE BS_CENTER ; + ON CLICK {|| ::Calculando( "2") } + @ 8,158 BUTTONEX oBtn1 CAPTION "&1" SIZE 34,28 ; + STYLE BS_CENTER ; + ON CLICK {|| ::Calculando( "1") } + @ 156,126 BUTTONEX oBtn23 CAPTION "&M+" SIZE 34,28 ; + STYLE BS_CENTER ; + FONT HFont():Add( 'Tahoma',0,-12,400,,,) ; + ON CLICK {|| ::Calculando( "M+") } + @ 119,127 BUTTONEX oBtn14 CAPTION "*" SIZE 34,28 ; + STYLE BS_CENTER ; + FONT HFont():Add( 'Symbol',0,-15,400,,,) ; + ON CLICK {|| ::Calculando( "*") } + @ 82,127 BUTTONEX oBtn13 CAPTION "&6" SIZE 34,28 ; + STYLE BS_CENTER ; + ON CLICK {|| ::Calculando( "6") } + @ 45,127 BUTTONEX oBtn12 CAPTION "&5" SIZE 34,28 ; + STYLE BS_CENTER ; + ON CLICK {|| ::Calculando( "5") } + @ 8,127 BUTTONEX oBtn8 CAPTION "&4" SIZE 34,28 ; + STYLE BS_CENTER ; + ON CLICK {|| ::Calculando( "4") } + @ 156,96 BUTTONEX oBtn22 CAPTION "M&R" SIZE 34,28 ; + STYLE BS_CENTER ; + FONT HFont():Add( 'Tahoma',0,-12,400,,,) ; + ON CLICK {|| ::Calculando( "MR") } + oBtn22:Anchor := 224 + @ 119,96 BUTTONEX oBtn15 CAPTION "/" SIZE 34,28 ; + STYLE BS_CENTER ; + FONT HFont():Add( 'Verdana',0,-12,400,,,) ; + ON CLICK {|| ::Calculando( "/") } + @ 82,96 BUTTONEX oBtn17 CAPTION "&9" SIZE 34,28 ; + STYLE BS_CENTER ; + ON CLICK {|| ::Calculando( "9") } + @ 45,96 BUTTONEX oBtn16 CAPTION "&8" SIZE 34,28 ; + STYLE BS_CENTER ; + ON CLICK {|| ::Calculando( "8") } + @ 8,96 BUTTONEX oBtn9 CAPTION "&7" SIZE 34,28 ; + STYLE BS_CENTER ; + ON CLICK {|| ::Calculando( "7") } + @ 156,65 BUTTONEX oBtn21 CAPTION "MC" SIZE 34,28 ; + STYLE BS_CENTER ; + FONT HFont():Add( 'Tahoma',0,-12,400,,,) ; + ON CLICK {|| ::Calculando( "MC") } + oBtn21:Anchor := 224 + @ 119,65 BUTTONEX oBtn20 CAPTION "&+" SIZE 34,28 ; + STYLE BS_MULTILINE+BS_CENTER ; + FONT HFont():Add( 'Tahoma',0,-12,400,,,) ; + ON CLICK {|| ::Calculando( "#") } + @ 82,65 BUTTONEX oBtn19 CAPTION "C" ID IDCANCEL SIZE 34,28 ; + STYLE BS_CENTER ; + FONT HFont():Add( 'Tahoma',0,-12,400,,,) ; + ON CLICK {|| ::Calculando( "") } + @ 45,65 BUTTONEX oBtn18 CAPTION "CE" SIZE 34,28 ; + STYLE BS_CENTER ; + FONT HFont():Add( 'Tahoma',0,-12,400,,,) ; + ON CLICK {|| ::Calculando( "C") } + @ 8,65 BUTTONEX oBtn4 CAPTION "<--" SIZE 34,28 ; + STYLE BS_CENTER ; + FONT HFont():Add( 'System',0,-16,700,,,) ; + ON CLICK {|| ::Calculando( " ") } + oBtn4:FontBold := .T. + @ 21,24 SAY oVisor CAPTION "0" SIZE 168,33 ; + STYLE SS_RIGHT +DT_VCENTER+DT_SINGLELINE; + BACKCOLOR 16578289 ; + FONT HFont():Add( 'Consolas',0,-24,400,,,) + oVisor:Anchor := 75 + @ 7,29 SAY oMemory CAPTION "" SIZE 15,26 ; + STYLE DT_VCENTER+DT_SINGLELINE; + COLOR 6250335 BACKCOLOR 16578289 ; + FONT HFont():Add( 'Arial',0,-13,700,,,) + oMemory:Anchor := 75 + oMemory:FontBold := .T. + @ 7,6 SAY oCalculo CAPTION "" SIZE 182,17 ; + STYLE SS_RIGHT ; + BACKCOLOR 16578289 ; + FONT HFont():Add( 'Consolas',0,-12,400,,,) + oCalculo:Anchor := 75 + + ACTIVATE DIALOG ::oFormCalc NOMODAL + + ::nFontSize := TxtRect( "9", ::oFormCalc, ::oFormCalc:oCalculo:oFont )[ 1 ] + ::Hwnd := ::oFormCalc:Handle + + RETURN 0 + + +METHOD Calculando( cNumero ) CLASS HCalculator + LOCAL oForm := ::oFormCalc + Local nDiv := 1 + Local cOperar := ::cOperador + Local nLen := Len( oForm:oVisor:Caption ), nCars + Private nCalculo1 , ncalculo2 + + If cNumero $ "/*-+%=" + nCars := oForm:oCalculo:nWidth / ::nFontSize + oForm:oCalculo:Caption += oForm:oVisor:Caption + " "+cNumero+" " + oForm:oCalculo:Caption := RIGHT( oForm:oCalculo:Caption, nCars ) + ::cOperador := IIF( cNumero != "=", cNumero, ::cOperador ) + cOperar := IIF( cOperar = Nil, cNumero, cOperar ) + If ::aOperando[ 1 ] = Nil .AND. !::lClear + ::aOperando[ 1 ] := Val( StrTran(oForm:oVisor:Caption,",",".") ) + ElseIf ::aOperando[ 2 ] = Nil .AND. ! ::lClear + ::aOperando[ 2 ] := Val( StrTran(oForm:oVisor:Caption,",",".") ) + EndIf + ::lClear := .T. + ElseIf cNumero == "#" + oForm:oVisor:Caption := iIf(oForm:oVisor:Caption = "-", SubStr(oForm:oVisor:Caption,2),"-"+oForm:oVisor:Caption) + ::cOperador := cNumero + If ::aOperando[ 2 ] != Nil + ::aOperando[ 2 ] := Val( StrTran(oForm:oVisor:Caption,",",".") ) + ElseIf ::aOperando[ 1 ] != Nil + ::aOperando[ 1 ] := Val( StrTran(oForm:oVisor:Caption,",",".") ) + EndIf + ::lClear := .t. + ElseIf cNumero == " " + If !::lClear + oForm:oVisor:Caption := Left( oForm:oVisor:Caption,nLen - 1 ) + EndIf + ElseIf cNumero == "C" + oForm:oVisor:Caption := "0" + ::lClear := .t. + ::aOperando[ 1 ] := IIf( ::aOperando[ 1 ] != Nil .and. ::aOperando[ 2 ] = nIL, ::aOperando[ 1 ], Nil ) + ::aOperando[ 2 ] := Nil //IIf( ::aOperando[ 2 ] = nIL, Nil, 0 ) + return nil + ElseIf Empty( cNumero ) + oForm:oVisor:Caption := "0" + oForm:oCalculo:Caption := "" + ::lClear := .t. + ::aOperando := {, , 0 } + If ::oCurrGet != Nil + ::End() + RETURN Nil + EndIf + ElseIf cNumero == "MC" + ::nMemory := 0 + oForm:oMemory:caption := " " + ElseIf cNumero == "MR" + oForm:oVisor:Caption := STR(::nMemory ) + ::lClear := .F. + ElseIf cNumero == "M+" + ::nMemory := Val( StrTran( oForm:oVisor:Caption,",",".") ) + oForm:oMemory:caption := "M" + Else + oForm:oVisor:Caption := IIf( ::lClear .OR. cOperar = "=","", oForm:oVisor:Caption ) + oForm:oVisor:Caption += cNumero + ::lClear := .f. + cOperar := "" + EndIf + + If cNumero == "=" .And. (! Empty( ::aOperando[ 1 ]) .And. Empty( ::aOperando[ 2 ]) ) + ::aOperando[ 2 ] := ::aOperando[ 3 ] + EndIf + If ! Empty( cOperar ) .And. (! Empty( ::aOperando[ 1 ]) .And. ! Empty( ::aOperando[ 2 ]) ) + If ::cOperador == "%" + ::aOperando[ 1 ] := (::aOperando[ 1 ] * ::aOperando[ 2 ] ) / 100 + Else + nCalculo1 := ::aOperando[ 1 ] + nCalculo2 := ::aOperando[ 2 ] + ::aOperando[ 1 ] := &( "nCalculo1" + cOperar + "nCalculo2" ) + EndIf + ::aOperando[ 1 ] := IIf( ::aOperando[ 1 ] - Int( ::aOperando[ 1 ] ) = 0 ,; + Int( ::aOperando[ 1 ]), ::aOperando[ 1 ] ) + oForm:oVisor:Caption := Ltrim( Str(::aOperando[ 1 ] ) ) + ::aOperando[ 3 ] := ::aOperando[ 2 ] + ::aOperando[ 2 ] := Nil + ::lClear := .T. + EndIf + If cNumero == "=" + oForm:oCalculo:Caption := "" + If ::oCurrGet != Nil + ::End() + RETURN Nil + EndIf + EndIf + oForm:oBtnRes:SetFocus( ) + + Return Nil + + +METHOD INIT( ) CLASS HCalculator + LOCAL aCoors + + SETDLGKEY( ::oFormCalc ,,8,{|| ::Calculando( " ") }) + SETDLGKEY( ::oFormCalc ,,46,{|| ::Calculando( "") }) + SETDLGKEY( ::oFormCalc ,,48,{|| ::Calculando( "0") }) + SETDLGKEY( ::oFormCalc ,,49,{|| ::Calculando( "1") }) + SETDLGKEY( ::oFormCalc ,,50,{|| ::Calculando( "2") }) + SETDLGKEY( ::oFormCalc ,,51,{|| ::Calculando( "3") }) + SETDLGKEY( ::oFormCalc ,,52,{|| ::Calculando( "4") }) + SETDLGKEY( ::oFormCalc ,,53,{|| ::Calculando( "5") }) + SETDLGKEY( ::oFormCalc ,,54,{|| ::Calculando( "6") }) + SETDLGKEY( ::oFormCalc ,,55,{|| ::Calculando( "7") }) + SETDLGKEY( ::oFormCalc ,,56,{|| ::Calculando( "8") }) + SETDLGKEY( ::oFormCalc ,,57,{|| ::Calculando( "9") }) + SETDLGKEY( ::oFormCalc ,VK_SHIFT,56,{|| ::Calculando( "*") }) + SETDLGKEY( ::oFormCalc ,,110,{|| ::Calculando( ",") }) + SETDLGKEY( ::oFormCalc ,,188,{|| ::Calculando( ",") }) + SETDLGKEY( ::oFormCalc ,,190,{|| ::Calculando( ".") }) + SETDLGKEY( ::oFormCalc ,,194,{|| ::Calculando( ".") }) + SETDLGKEY( ::oFormCalc ,,106,{|| ::Calculando( "*") }) + SETDLGKEY( ::oFormCalc ,,107,{|| ::Calculando( "+") }) + SETDLGKEY( ::oFormCalc ,,109,{|| ::Calculando( "-") }) + SETDLGKEY( ::oFormCalc ,,111,{|| ::Calculando( "/") }) + SETDLGKEY( ::oFormCalc ,,186,{|| ::Calculando( "*") }) + SETDLGKEY( ::oFormCalc ,,187,{|| ::Calculando( "=") }) + SETDLGKEY( ::oFormCalc ,,13,{|| ::Calculando( "=") }) + SETDLGKEY( ::oFormCalc ,VK_SHIFT,187,{|| ::Calculando( "+") }) + SETDLGKEY( ::oFormCalc ,,189,{|| ::Calculando( "-") }) + SETDLGKEY( ::oFormCalc ,,81,{|| ::Calculando( "/") }) + + ::lClear := .t. + ::aOperando := { , , 0 } + + ::oFormCalc:SetAll( "anchor", 240, , "hbuttonex" ) + // ::oFormCalc:setall( "lflat", ::lCompacta, , "hbuttonex" ) + + If ::oCurrGet != Nil + ::oFormCalc:oVisor:Caption := ALLTRIM( STR( ::oCurrGet:Value ) ) + ::lClear := ::oFormCalc:oVisor:Caption = "0" + IF ::oFormCalc:Type >= WND_DLG_RESOURCE + aCoors := GetWindowRect( ::oCurrGet:handle ) + ELSE + aCoors := { ::oCurrGet:oParent:nLeft + ::oCurrGet:nLeft + 8 , ; + ::oCurrGet:oParent:nTop + ::oCurrGet:nTop + GETSYSTEMMETRICS( SM_CYCAPTION ) + 8, 0,0 } + ENDIF + aCoors[ 3 ] := IIF( ::lCompacta, MAX( 130, ::oCurrGet:nWidth + 8 ), ::nWidth ) + ::oFormCalc:Move( aCoors[ 1 ] + 1, aCoors[ 2 ] + ::oCurrGet:nHeight + 1 , aCoors[ 3 ], 180, 0 ) + EndIf + ::oFormCalc:nInitFocus:= ::oFormCalc:oBtnRes + + RETURN Nil + +METHOD GetRefresh( ) CLASS HCalculator + LOCAL Value := ::aOperando[ 1 ] + + If ::oCurrGet != Nil + If Value != Nil + ::oCurrGet:Value := Value + //::oCurrGet:SetFocus() + EndIf + EndIf + RETURN .T. + +/* end */ \ No newline at end of file Modified: trunk/hwgui/source/hedit.prg =================================================================== --- trunk/hwgui/source/hedit.prg 2012-08-28 02:12:18 UTC (rev 1870) +++ trunk/hwgui/source/hedit.prg 2012-08-28 04:45:59 UTC (rev 1871) @@ -156,10 +156,8 @@ IF ::bSetGet != Nil ::bGetFocus := bGfocus ::bLostFocus := bLfocus - IF bGfocus != Nil - ::lnoValid := .T. - ::oParent:AddEvent( EN_SETFOCUS, Self, { | | ::When( ) },, "onGotFocus" ) - ENDIF + ::lnoValid := IIF( bGfocus != Nil, .T., .F. ) + ::oParent:AddEvent( EN_SETFOCUS, Self, { | | ::When( ) },, "onGotFocus" ) ::oParent:AddEvent( EN_KILLFOCUS, Self, { | | ::Valid( ) },, "onLostFocus" ) ::bValid := { | | ::Valid( ) } ELSE @@ -176,8 +174,8 @@ ::tColorOld := IIf( tcolor = Nil, 0, ::tcolor ) IF ::cType != "D" - SET( _SET_INSERT, ! ::lPicComplex ) - ENDIF + SET( _SET_INSERT, ! ::lPicComplex ) + ENDIF RETURN Self @@ -281,7 +279,7 @@ ! oParent:FindControl( IDCANCEL ):IsEnabled() SendMessage( oParent:handle, WM_COMMAND, makewparam( IDCANCEL, 0 ), ::handle ) ENDIF - IF ( oParent:Type < WND_DLG_RESOURCE .OR. ! oParent:lModal ) + IF ( oParent:Type < WND_DLG_RESOURCE .OR. ! oParent:lModal ) SETFOCUS( 0 ) ProcOkCancel( Self, VK_ESCAPE ) RETURN 0 @@ -383,7 +381,7 @@ IF "K" $ ::cPicFunc .AND. ::lFocu .AND. ! EMPTY( ::Title ) *- ::value := IIF( ::cType == "D", CTOD(""), IIF( ::cType == "N", 0, "" ) ) *- SendMessage( ::handle, EM_SETSEL, ::FirstEditable() - 1, ::FirstEditable() - 1 ) - ::Title := IIF( ::cType == "D", CTOD(""), IIF( ::cType == "N", 0, "" ) ) + ::Title := IIF( ::cType == "D", CTOD(""), IIF( ::cType == "N", 0, "" ) ) ENDIF ELSEIF msg == WM_LBUTTONDOWN @@ -424,7 +422,6 @@ IF lColorinFocus IF msg == WM_SETFOCUS // ::bColorOld := ::bcolor - ::nSelStart := IIF( Empty( ::title ), 0, ::nSelStart ) ::SetColor( tColorSelect, bColorSelect ) SendMessage( ::handle, EM_SETSEL, ::selStart, ::selStart ) // era -1 @@ -445,7 +442,7 @@ SendMessage( ::handle, EM_SETSEL, ::FirstEditable() - 1, ::FirstEditable() - 1 ) ENDIF //IF ( ::lPicComplex .OR. !Empty( ::cPicMask ) ) .AND. ::cType <> "N" .AND. ! ::lFirst - IF "R" $ ::cPicFunc .AND. ::cType <> "N" .AND. ! ::lFirst + IF ::lPicComplex .AND. ::cType <> "N" .AND. ! ::lFirst ::Title := Transform( ::Title, ::cPicFunc + " " + ::cPicMask ) ENDIF ENDIF @@ -558,6 +555,7 @@ IF bSetGet != Nil ::bGetFocus := bGfocus ::bLostFocus := bLfocus + ::lnoValid := IIF( bGfocus != Nil, .T., .F. ) ::oParent:AddEvent( EN_SETFOCUS, Self, { | | ::When( ) },, "onGotFocus" ) ::oParent:AddEvent( EN_KILLFOCUS, Self, { | | ::Valid( ) },, "onLostFocus" ) ::bValid := { | | ::Valid() } @@ -592,20 +590,20 @@ ELSEIF ::cType == "N" vari := Val( LTrim( vari ) ) ENDIF - RETURN vari + RETURN vari METHOD Refresh() CLASS HEdit LOCAL vari - IF ::bSetGet != Nil vari := Eval( ::bSetGet,, Self ) IF ! Empty( ::cPicFunc ) .OR. ! Empty( ::cPicMask ) vari := IIF( vari = Nil, "", Vari ) vari := Transform( vari, ::cPicFunc + IIf( Empty( ::cPicFunc ), "", " " ) + ::cPicMask ) ELSE - vari := IIf( ::cType == "D", DToC( vari ), IIf( ::cType == "N", Str( vari ), IIf( ::cType == "C" .and. ValType( vari ) == "C", Trim( vari ), "" ) ) ) + vari := IIf( ::cType == "D", DToC( vari ), IIf( ::cType == "N", Str( vari ), ; + IIf( ::cType == "C" .And. ValType( vari ) == "C", Trim( vari ), "" ) ) ) ENDIF - ::title := vari + ::Title := vari ENDIF SetDlgItemText( ::oParent:handle, ::id, ::title ) IF isWindowVisible( ::handle ) .AND. !Empty( GetWindowParent( ::handle ) ) //PtrtouLong( GetFocus() ) == PtrtouLong( ::handle ) @@ -629,7 +627,6 @@ //Super:SetText( ::title ) //SetWindowText( ::Handle, ::Title ) SetDlgItemText( ::oParent:handle, ::id, ::title ) - * msginfo(::title) IF ::bSetGet != Nil Eval( ::bSetGet, c, Self ) ENDIF @@ -700,6 +697,11 @@ ENDIF NEXT ENDIF + IF Eval( ::bSetGet,, Self ) != Nil + ::title := Transform( Eval( ::bSetGet,, Self ) , ::cPicFunc + IIf( Empty( ::cPicFunc ), "", " " ) + ::cPicMask ) + SetDlgItemText( ::oParent:handle, ::id, ::title ) + ENDIF + RETURN Nil METHOD IsEditable( nPos, lDel ) CLASS HEdit @@ -1035,9 +1037,7 @@ ::KeyRight( nPos ) //Added By Sandro Freire IF ::cType == "N" - IF ! Empty( ::cPicMask ) - nDecimals := Len( SubStr( ::cPicMask, At( ".", ::cPicMask ), Len( ::cPicMask ) ) ) IF nDecimals <= 0 @@ -1135,7 +1135,7 @@ vari := ::title ENDIF ::oParent:lSuspendMsgsHandling := .T. - res := Eval( ::bGetFocus, vari, Self ) + res := Eval( ::bGetFocus, vari, IIF( ::oUpDown = Nil, Self, ::oUpDown ) ) res := IIf( ValType( res ) == "L", res, .T. ) ::lnoValid := ! res ::oParent:lSuspendMsgsHandling := .F. @@ -1196,7 +1196,7 @@ ::oUpDown:nValue := vari ENDIF IF ::bLostFocus != Nil - res := Eval( ::bLostFocus, vari, Self ) + res := Eval( ::bLostFocus, vari, IIF( ::oUpDown = Nil, Self, ::oUpDown ) ) res := IIF( ValType( res ) == "L", res, .T. ) ENDIF IF res .AND. ::oUpDown != Nil // updown control Modified: trunk/hwgui/source/hupdown.prg =================================================================== --- trunk/hwgui/source/hupdown.prg 2012-08-28 02:12:18 UTC (rev 1870) +++ trunk/hwgui/source/hupdown.prg 2012-08-28 04:45:59 UTC (rev 1871) @@ -223,8 +223,8 @@ METHOD Refresh() CLASS HUpDown - IF ::bSetGet != Nil .AND. ::nValue != Nil - ::nValue := Eval( ::bSetGet ) + IF ::bSetGet != Nil //.AND. ::nValue != Nil + ::nValue := Eval( ::bSetGet, , Self ) IF Str(::nValue) != ::title //::title := Str( ::nValue ) //SetUpDown( ::hwndUpDown, ::nValue ) @@ -235,7 +235,7 @@ ENDIF ::oEditUpDown:Title := ::Title ::oEditUpDown:Refresh() - IF GetFocus() == ::handle + IF SelfFocus( ::handle ) InvalidateRect( ::hwndUpDown, 0 ) ENDIF @@ -330,7 +330,7 @@ METHOD Refresh() CLASS HeditUpDown LOCAL vari - vari := ::oUpDown:nValue + vari := ::Value IF ::bSetGet != Nil .AND. ::title != Nil ::Title := Transform( vari , ::cPicFunc + IIf( Empty( ::cPicFunc ), "", " " ) + ::cPicMask ) ENDIF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lf...@us...> - 2012-08-28 02:12:25
|
Revision: 1870 http://hwgui.svn.sourceforge.net/hwgui/?rev=1870&view=rev Author: lfbasso Date: 2012-08-28 02:12:18 +0000 (Tue, 28 Aug 2012) Log Message: ----------- Modified Paths: -------------- trunk/hwgui/Changelog trunk/hwgui/source/htool.prg Modified: trunk/hwgui/Changelog =================================================================== --- trunk/hwgui/Changelog 2012-08-28 01:34:37 UTC (rev 1869) +++ trunk/hwgui/Changelog 2012-08-28 02:12:18 UTC (rev 1870) @@ -15,6 +15,8 @@ ! commented two functions that are not being used STATIC FUNCTION FltRecNoRelative STATIC FUNCTION FltRecCount + * source/htool.prg + ! update source correct last commit 2012-08-27 14:59 UTC-0300 Luis Fernando Basso <lfbasso at via-rs.net> * source/hcwindow.prg Modified: trunk/hwgui/source/htool.prg =================================================================== --- trunk/hwgui/source/htool.prg 2012-08-28 01:34:37 UTC (rev 1869) +++ trunk/hwgui/source/htool.prg 2012-08-28 02:12:18 UTC (rev 1870) @@ -414,10 +414,10 @@ ::BtnHeight := MAX( HIWORD( SENDMESSAGE( ::handle, TB_GETBUTTONSIZE, 0, 0 ) ),; ::nHeight - ::nDrop - IIF( ! ::lnoThemes .AND. Hwg_BitAnd( ::Style, TBSTYLE_FLAT ) > 0, 0, 2 ) ) IF ! ::lVertical - SENDMESSAGE( ::handle, TB_SETBUTTONSIZE, 0, MAKELPARAM( ::BtnWidth , ::BtnHeight - 7 ) ) + SENDMESSAGE( ::handle, TB_SETBUTTONSIZE, 0, MAKELPARAM( ::BtnWidth , ::BtnHeight ) ) ELSE - SENDMESSAGE( ::handle, TB_SETBUTTONSIZE, 0, MAKELPARAM( ::nWidth - ::nDrop - 1, ::BtnWidth ) ) - ENDIF + SENDMESSAGE( ::handle, TB_SETBUTTONSIZE, 0, MAKELPARAM( ::nWidth - ::nDrop - 1, ::BtnWidth ) ) + ENDIF ENDIF ::BtnWidth := LOWORD( SENDMESSAGE( ::handle, TB_GETBUTTONSIZE, 0, 0 ) ) /* This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lf...@us...> - 2012-08-28 01:34:45
|
Revision: 1869 http://hwgui.svn.sourceforge.net/hwgui/?rev=1869&view=rev Author: lfbasso Date: 2012-08-28 01:34:37 +0000 (Tue, 28 Aug 2012) Log Message: ----------- 2012-08-27 22:50 UTC-0300 Luis Fernando Basso <lfbasso at via-rs.net> * include/window.ch ! constant moved from place * source/hbrowse.prg ! commented two functions that are not being used STATIC FUNCTION FltRecNoRelative STATIC FUNCTION FltRecCount Modified Paths: -------------- trunk/hwgui/Changelog trunk/hwgui/include/windows.ch trunk/hwgui/source/hbrowse.prg Modified: trunk/hwgui/Changelog =================================================================== --- trunk/hwgui/Changelog 2012-08-27 17:33:11 UTC (rev 1868) +++ trunk/hwgui/Changelog 2012-08-28 01:34:37 UTC (rev 1869) @@ -8,6 +8,13 @@ 2002-12-01 23:12 UTC+0100 Foo Bar <fo...@fo...> */ +2012-08-27 22:50 UTC-0300 Luis Fernando Basso <lfbasso at via-rs.net> + * include/window.ch + ! constant moved from place + * source/hbrowse.prg + ! commented two functions that are not being used + STATIC FUNCTION FltRecNoRelative + STATIC FUNCTION FltRecCount 2012-08-27 14:59 UTC-0300 Luis Fernando Basso <lfbasso at via-rs.net> * source/hcwindow.prg Modified: trunk/hwgui/include/windows.ch =================================================================== --- trunk/hwgui/include/windows.ch 2012-08-27 17:33:11 UTC (rev 1868) +++ trunk/hwgui/include/windows.ch 2012-08-28 01:34:37 UTC (rev 1869) @@ -80,9 +80,13 @@ #define WM_LBUTTONDBLCLK 515 // 0x0203 #define WM_RBUTTONDOWN 516 // 0x0204 #define WM_RBUTTONUP 517 // 0x0205 -#define WM_MBUTTONUP 520 // 0x0208 +#define WM_MBUTTONUP 520 // 0x0208 +#define WM_MOUSEWHEEL 522 // 0x020A #define WM_PARENTNOTIFY 528 // 0x0210 -#define WM_MOVING 534 // 0x0216, +#define WM_NEXTMENU 531 // 0x0213 +#define WM_SIZING 532 // 0x0214 +#define WM_CAPTURECHANGED 533 // 0x0215 +#define WM_MOVING 534 // 0x0216, #define WM_MDICREATE 544 // 0x0220 #define WM_MDIDESTROY 545 // 0x0221 #define WM_MDIACTIVATE 546 // 0x0222 @@ -97,8 +101,6 @@ #define WM_ENTERSIZEMOVE 561 // 0x0231 #define WM_EXITSIZEMOVE 562 // 0x0232 - - #define WM_CUT 768 // 0x0300 #define WM_COPY 769 // 0x0301 #define WM_PASTE 770 // 0x0302 @@ -1007,13 +1009,7 @@ // #define BS_NOTIFY 16384 // 0x00004000L // more messages -#define WM_NEXTMENU 0x0213 -#define WM_SIZING 0x0214 -#define WM_CAPTURECHANGED 0x0215 - -#define WM_MOUSEWHEEL 0x020A - #define TB_LINEUP 0 #define TB_LINEDOWN 1 #define TB_PAGEUP 2 Modified: trunk/hwgui/source/hbrowse.prg =================================================================== --- trunk/hwgui/source/hbrowse.prg 2012-08-27 17:33:11 UTC (rev 1868) +++ trunk/hwgui/source/hbrowse.prg 2012-08-28 01:34:37 UTC (rev 1869) @@ -3992,6 +3992,7 @@ ENDIF RETURN lRet + /* no used STATIC FUNCTION FltRecCount( oBrw ) LOCAL nRecord, nCount := 0 nRecord := FltRecNo( oBrw ) @@ -4008,7 +4009,8 @@ ENDDO FltGoTo( oBrw, nRecord ) RETURN nCount - + */ + STATIC FUNCTION FltGoTo( oBrw, nRecord ) HB_SYMBOL_UNUSED( oBrw ) RETURN ( oBrw:Alias )->( DBGoTo( nRecord ) ) @@ -4018,7 +4020,7 @@ RETURN ( oBrw:Alias )->( RecNo() ) //End Implementation by Luiz - +/* no used STATIC FUNCTION FltRecNoRelative( oBrw ) HB_SYMBOL_UNUSED( oBrw ) IF oBrw:lFilter .AND. EMPTY( oBrw:RelationalExpr ) @@ -4028,7 +4030,8 @@ RETURN oBrw:nRecords ENDIF RETURN ( oBrw:Alias )->( RecNo() ) - + */ + STATIC FUNCTION LenVal( xVal, cType, cPict ) LOCAL nLen This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lf...@us...> - 2012-08-27 17:33:18
|
Revision: 1868 http://hwgui.svn.sourceforge.net/hwgui/?rev=1868&view=rev Author: lfbasso Date: 2012-08-27 17:33:11 +0000 (Mon, 27 Aug 2012) Log Message: ----------- 2012-08-27 14:59 UTC-0300 Luis Fernando Basso <lfbasso at via-rs.net> * source/hcwindow.prg * STATIC FUNCTION onCommand ! minor fix * source/hedit.prg * METHOD New() activate KILLFOCUS when ::bSetGet = Nil .and. bLostFocus = Nil force the pass through function CHECKFOCUS to set PROPERTY lwhen * METHOD onEvent() ! msg == WM_SETFOCUS changed condition ( ::lPicComplex ) to ( "R" $ ::cPicFunc ) * METHOD Value ! returns the actual value in Editbox and not value in ::title * METHOD Valid( ) CLASS HEdit ! changed the order of comparison in the initial condition * FUNCTION CheckFocus( ) ! changed and added a new control for the methods WHEN objects * source/hradio.prg * METHOD New() * METHOD Redefine() + ::oParent:AddEvent( BN_KILLFOCUS, Self, { || CheckFocus( Self, .T. ) } ) force the pass through function CHECKFOCUS to set PROPERTY lwhen Modified Paths: -------------- trunk/hwgui/Changelog trunk/hwgui/source/hcwindow.prg trunk/hwgui/source/hedit.prg trunk/hwgui/source/hradio.prg Modified: trunk/hwgui/Changelog =================================================================== --- trunk/hwgui/Changelog 2012-08-27 16:34:40 UTC (rev 1867) +++ trunk/hwgui/Changelog 2012-08-27 17:33:11 UTC (rev 1868) @@ -8,6 +8,29 @@ 2002-12-01 23:12 UTC+0100 Foo Bar <fo...@fo...> */ + +2012-08-27 14:59 UTC-0300 Luis Fernando Basso <lfbasso at via-rs.net> + * source/hcwindow.prg + * STATIC FUNCTION onCommand + ! minor fix + * source/hedit.prg + * METHOD New() + activate KILLFOCUS when ::bSetGet = Nil .and. bLostFocus = Nil + force the pass through function CHECKFOCUS to set PROPERTY lwhen + * METHOD onEvent() + ! msg == WM_SETFOCUS changed condition ( ::lPicComplex ) to ( "R" $ ::cPicFunc ) + * METHOD Value + ! returns the actual value in Editbox and not value in ::title + * METHOD Valid( ) CLASS HEdit + ! changed the order of comparison in the initial condition + * FUNCTION CheckFocus( ) + ! changed and added a new control for the methods WHEN objects + * source/hradio.prg + * METHOD New() + * METHOD Redefine() + + ::oParent:AddEvent( BN_KILLFOCUS, Self, { || CheckFocus( Self, .T. ) } ) + force the pass through function CHECKFOCUS to set PROPERTY lwhen + 2012-08-27 12:59 UTC-0300 Luis Fernando Basso <lfbasso at via-rs.net> * include/guilib.ch ! fix in <oShape> := HShape():New = [ <oShape> := ] HShape():New @@ -56,9 +79,9 @@ * source/hwindow.prg * FUNCTION onSize ! minor fix - * CLASS HMDIChildWindow - * METHOD Activate - ! moved bactivate to end + * CLASS HMDIChildWindow + * METHOD Activate + ! moved bactivate to end 2012-08-27 10:50 UTC-0300 Luis Fernando Basso <lfbasso at via-rs.net> * source/hcontrol.prg Modified: trunk/hwgui/source/hcwindow.prg =================================================================== --- trunk/hwgui/source/hcwindow.prg 2012-08-27 16:34:40 UTC (rev 1867) +++ trunk/hwgui/source/hcwindow.prg 2012-08-27 17:33:11 UTC (rev 1868) @@ -830,7 +830,9 @@ a[ 2 ] == iParLow } ) ) > 0 IF oForm:Type < WND_DLG_RESOURCE - oForm:nFocus := GetFocus() //lParam + IF SelfFocus( GetParent( GetFocus() ) , oForm:Handle ) + oForm:nFocus := GetFocus() //lParam + ENDIF ENDIF Eval( oWnd:aEvents[ iItem, 3 ], oWnd, iParLow ) ENDIF @@ -870,11 +872,6 @@ oWnd:Anchor( oWnd, nw1, nh1, oWnd:nWidth, oWnd:nHeight) ENDIF ENDIF - IF oWnd:nScrollBars > - 1 .AND. oWnd:lAutoScroll .AND. ! EMPTY( oWnd:Type ) - onMove( oWnd ) - oWnd:ResetScrollbars() - oWnd:SetupScrollbars() - ENDIF FOR EACH oItem IN aControls IF oItem:bSize != NIL Modified: trunk/hwgui/source/hedit.prg =================================================================== --- trunk/hwgui/source/hedit.prg 2012-08-27 16:34:40 UTC (rev 1867) +++ trunk/hwgui/source/hedit.prg 2012-08-27 17:33:11 UTC (rev 1868) @@ -50,7 +50,6 @@ DATA cSelText INIT "" HIDDEN DATA nSelLength INIT 0 HIDDEN - METHOD New( oWndParent, nId, vari, bSetGet, nStyle, nLeft, nTop, nWidth, nHeight, ; oFont, bInit, bSize, bPaint, bGfocus, bLfocus, ctooltip, tcolor, bcolor, cPicture, ; lNoBorder, nMaxLength, lPassword, bKeyDown, bChange, bOther ) @@ -142,7 +141,8 @@ // ::nMaxLength := nMaxLength //ENDIF ::ParsePict( cPicture, vari ) - + * ::SetText( vari ) + ::Activate() ::DisableBackColor := bDisablecolor @@ -166,17 +166,17 @@ IF bGfocus != Nil ::oParent:AddEvent( EN_SETFOCUS, Self, { | | ::When( ) },, "onGotFocus" ) ENDIF - IF bLfocus != Nil + //IF bLfocus != Nil ::oParent:AddEvent( EN_KILLFOCUS, Self, { | | ::Valid( ) },, "onLostFocus" ) ::bValid := { | | ::Valid( ) } - ENDIF + //ENDIF ENDIF ::bColorOld := ::bcolor ::tColorOld := IIf( tcolor = Nil, 0, ::tcolor ) IF ::cType != "D" - SET( _SET_INSERT, .T. ) + SET( _SET_INSERT, ! ::lPicComplex ) ENDIF RETURN Self @@ -201,6 +201,7 @@ *IF ::bChange != Nil .OR. ::lMultiLine ::oParent:AddEvent( EN_CHANGE, Self, { | | ::onChange( ) },, "onChange" ) *ENDIF + ENDIF RETURN Nil @@ -214,6 +215,7 @@ RETURN 0 ENDIF ENDIF + //HWG_WRITELOG(STR(MSG)+::TITLE+CHR(13)) IF ! ::lMultiLine IF ::bSetGet != Nil @@ -441,9 +443,9 @@ SendMessage( ::handle, EM_SETSEL, 0, - 1 ) ELSEIF ::selstart = 0 .AND. "R" $ ::cPicFunc //.AND. ::lPicComplex SendMessage( ::handle, EM_SETSEL, ::FirstEditable() - 1, ::FirstEditable() - 1 ) - ENDIF - IF ::lPicComplex .AND. ::cType <> "N" + //IF ( ::lPicComplex .OR. !Empty( ::cPicMask ) ) .AND. ::cType <> "N" .AND. ! ::lFirst + IF "R" $ ::cPicFunc .AND. ::cType <> "N" .AND. ! ::lFirst ::Title := Transform( ::Title, ::cPicFunc + " " + ::cPicMask ) ENDIF ENDIF @@ -582,13 +584,15 @@ ::SetText( Value ) ::Refresh() ENDIF - vari := ::UnTransform( ::Title ) + //vari := ::UnTransform( ::Title ) + vari := ::UnTransform( GetEditText( ::oParent:handle, ::id ) ) + IF ::cType == "D" vari := CToD( vari ) ELSEIF ::cType == "N" vari := Val( LTrim( vari ) ) ENDIF - RETURN vari + RETURN vari METHOD Refresh() CLASS HEdit LOCAL vari @@ -618,12 +622,14 @@ ENDIF IF ! Empty( ::cPicFunc ) .OR. ! Empty( ::cPicMask ) ::title := Transform( c, ::cPicFunc + IIf( Empty( ::cPicFunc ), "", " " ) + ::cPicMask ) + // ::Title := Transform( ::Title, ::cPicFunc + " " + ::cPicMask ) ELSE ::title := c ENDIF //Super:SetText( ::title ) //SetWindowText( ::Handle, ::Title ) SetDlgItemText( ::oParent:handle, ::id, ::title ) + * msginfo(::title) IF ::bSetGet != Nil Eval( ::bSetGet, c, Self ) ENDIF @@ -791,6 +797,7 @@ ELSE nPosEnd += 1 ENDIF + // msginfo(STR(NPOSEND)+STR(NPOSSTART)+::TITLE) /* NEW */ IF nPosEnd - nPosStart - 1 > 1 .AND.::lPicComplex .AND. ::cType <> "N" //.AND. NPOSEND < nGetLen lBack := .T. @@ -935,7 +942,6 @@ IF HIWORD( x ) != LOWORD( x ) ::DeleteChar( .f. ) ENDIF - ::title := GetEditText( ::oParent:handle, ::id ) IF ::cType == "N" .and. cKey $ ".," .AND. ; ( nPos := At( ".", ::cPicMask ) ) != 0 @@ -1144,7 +1150,7 @@ */ WhenSetFocus( Self, nSkip ) ELSE - ::setfocus() + ::SetFocus() ENDIF ENDIF RETURN res @@ -1152,7 +1158,8 @@ METHOD Valid( ) CLASS HEdit LOCAL res := .T., vari, oDlg - IF ::bLostFocus != Nil .AND. ( ::lNoValid .OR. ! CheckFocus( Self, .T. ) ) + //IF ::bLostFocus != Nil .AND. ( ::lNoValid .OR. ! CheckFocus( Self, .T. ) ) + IF ( ! CheckFocus( Self, .T. ) .OR. ::lNoValid ) .AND. ::bLostFocus != Nil RETURN .t. ENDIF IF ::bSetGet != Nil @@ -1214,12 +1221,12 @@ ENDIF ELSE IF ::lMultiLine - ::title := ::GetText() + ::title := ::GetText() ENDIF - IF ::bLostFocus != Nil .OR. ::oUpDown != Nil + IF ::bLostFocus != Nil .OR. ::oUpDown != Nil ::oparent:lSuspendMsgsHandling := .T. IF ::bLostFocus != Nil - res := Eval( ::bLostFocus, vari, Self ) + res := Eval( ::bLostFocus, vari, Self ) res := IIF( ValType(res) == "L", res, .T. ) ENDIF IF res .AND. ::oUpDown != Nil // updown control @@ -1710,22 +1717,27 @@ ELSEIF ! lInside .AND. ! EMPTY( oParent:nInitFocus ) // SetFocus( oParent:handle ) RETURN .T. - ENDIF + ENDIF RETURN .F. + ELSEIF ! lInside .AND. ! oCtrl:lNoWhen + oCtrl:lNoWhen := .T. + ELSEIF ! lInside + RETURN .F. ENDIF - IF oParent != Nil .AND. lInside - lModal := oParent:lModal .AND. oParent:Type > WND_DLG_RESOURCE - IF ( ( ! Empty( hGetFocus ) .AND. lModal .AND. ! SELFFOCUS( GetWindowParent( hGetFocus ), oParent:Handle ) ) .OR. ; - ( SELFFOCUS( hGetFocus, oCtrl:oParent:Handle ) ) ) .AND. SELFFOCUS( oParent:handle, oCtrl:oParent:Handle ) - RETURN .F. - ENDIF - ELSE - oCtrl:oParent:lGetSkipLostFocus := .F. - ENDIF + IF oParent != Nil .AND. lInside // valid + lModal := oParent:lModal .AND. oParent:Type > WND_DLG_RESOURCE + IF ( ( ! Empty( hGetFocus ) .AND. lModal .AND. ! SELFFOCUS( GetWindowParent( hGetFocus ), oParent:Handle ) ) .OR. ; + ( SELFFOCUS( hGetFocus, oCtrl:oParent:Handle ) ) ) .AND. SELFFOCUS( oParent:handle, oCtrl:oParent:Handle ) + RETURN .F. + ENDIF + oCtrl:lNoWhen := .F. + ELSE + oCtrl:oParent:lGetSkipLostFocus := .F. + ENDIF - RETURN .T. + RETURN .T. -FUNCTION WhenSetFocus( oCtrl, nSkip ) +FUNCTION WhenSetFocus( oCtrl, nSkip ) IF SelfFocus( oCtrl:Handle ) .OR. EMPTY( GetFocus() ) GetSkip( oCtrl:oParent, oCtrl:handle, , nSkip ) Modified: trunk/hwgui/source/hradio.prg =================================================================== --- trunk/hwgui/source/hradio.prg 2012-08-27 16:34:40 UTC (rev 1867) +++ trunk/hwgui/source/hradio.prg 2012-08-27 17:33:11 UTC (rev 1868) @@ -254,7 +254,7 @@ ::lnoValid := .T. ENDIF - //::oParent:AddEvent( BN_KILLFOCUS, Self, { || ::Notify( WM_KEYDOWN ) } ) + ::oParent:AddEvent( BN_KILLFOCUS, Self, { || CheckFocus( Self, .T. ) } ) IF ::oGroup != Nil AAdd( ::oGroup:aButtons, Self ) @@ -318,6 +318,7 @@ ::lnoValid := .T. ENDIF //::oParent:AddEvent( BN_KILLFOCUS, Self, { || ::Notify( WM_KEYDOWN ) } ) + ::oParent:AddEvent( BN_KILLFOCUS, Self, { || CheckFocus( Self, .T. ) } ) IF ::oGroup != Nil AAdd( ::oGroup:aButtons, Self ) // IF ::oGroup:bSetGet != Nil This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lf...@us...> - 2012-08-27 16:34:51
|
Revision: 1867 http://hwgui.svn.sourceforge.net/hwgui/?rev=1867&view=rev Author: lfbasso Date: 2012-08-27 16:34:40 +0000 (Mon, 27 Aug 2012) Log Message: ----------- Modified Paths: -------------- trunk/hwgui/Changelog trunk/hwgui/source/htool.prg Modified: trunk/hwgui/Changelog =================================================================== --- trunk/hwgui/Changelog 2012-08-27 16:23:17 UTC (rev 1866) +++ trunk/hwgui/Changelog 2012-08-27 16:34:40 UTC (rev 1867) @@ -44,7 +44,7 @@ ! fixed! * source/htool.prg - DATA nSize - + DATA nwSize, nHSize + + DATA nwSize, nHSize, BtnHeight * METHOD New() ! add news parameters nWSize,nHSize ( height and width bitmap ) and remove parameter size (width bitmap ) * METHOD CREATETOOL() Modified: trunk/hwgui/source/htool.prg =================================================================== --- trunk/hwgui/source/htool.prg 2012-08-27 16:23:17 UTC (rev 1866) +++ trunk/hwgui/source/htool.prg 2012-08-27 16:34:40 UTC (rev 1867) @@ -130,7 +130,7 @@ DATA lCreate INIT .F. HIDDEN DATA lResource INIT .F. HIDDEN DATA nOrder - DATA BtnWidth // + DATA BtnWidth, BtnHeight DATA nIDB DATA aButtons INIT {} DATA aSeparators INIT {} @@ -167,7 +167,7 @@ DEFAULT aitem TO { } //nStyle := Hwg_BitOr( IIf( nStyle == NIL, 0, nStyle ), TBSTYLE_FLAT ) - nStyle := Hwg_BitOr( IIf( nStyle == NIL, 0, nStyle ), 0 ) + nStyle := Hwg_BitOr( IIf( nStyle == NIL, 0, nStyle ), IIF( Hwg_BitAnd( nStyle, WS_DLGFRAME + WS_BORDER ) > 0, CCS_NODIVIDER , 0 ) ) nHeight += IIF( Hwg_BitAnd( nStyle, WS_DLGFRAME + WS_BORDER ) > 0, 1, 0 ) nWidth -= IIF( Hwg_BitAnd( nStyle, WS_DLGFRAME + WS_BORDER ) > 0, 2, 0 ) @@ -410,11 +410,11 @@ ELSEIF Hwg_BitAnd( ::Style, TBSTYLE_FLAT ) > 0 nMax := 2 ENDIF - ::ndrop := nMax + IIF( ! ::WindowsManifest ,0, nDrop ) + ::ndrop := nMax + IIF( ! ::WindowsManifest , 0, nDrop ) ::BtnHeight := MAX( HIWORD( SENDMESSAGE( ::handle, TB_GETBUTTONSIZE, 0, 0 ) ),; ::nHeight - ::nDrop - IIF( ! ::lnoThemes .AND. Hwg_BitAnd( ::Style, TBSTYLE_FLAT ) > 0, 0, 2 ) ) IF ! ::lVertical - SENDMESSAGE( ::handle, TB_SETBUTTONSIZE, 0, MAKELPARAM( ::BtnWidth , ::BtnHeight ) ) + SENDMESSAGE( ::handle, TB_SETBUTTONSIZE, 0, MAKELPARAM( ::BtnWidth , ::BtnHeight - 7 ) ) ELSE SENDMESSAGE( ::handle, TB_SETBUTTONSIZE, 0, MAKELPARAM( ::nWidth - ::nDrop - 1, ::BtnWidth ) ) ENDIF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lf...@us...> - 2012-08-27 16:23:25
|
Revision: 1866 http://hwgui.svn.sourceforge.net/hwgui/?rev=1866&view=rev Author: lfbasso Date: 2012-08-27 16:23:17 +0000 (Mon, 27 Aug 2012) Log Message: ----------- 2012-08-27 12:59 UTC-0300 Luis Fernando Basso <lfbasso at via-rs.net> * include/guilib.ch ! fix in <oShape> := HShape():New = [ <oShape> := ] HShape():New * #xcommand @ <x>,<y> TOOLBAR [ <oTool> ] ; ! changed[ BITMAPSIZE <bmpwidth> [, <bmpheight> ] ] ; * #xcommand @ <x>,<y> SPLITTER [ <oSplit> ] ; ! add [ <lTransp: TRANSPARENT>] ; [ <lScroll: SCROLLING> ] ; * include/window.ch + #define TB_GETBUTTONSIZE (WM_USER + 58) + #define BTNS_WHOLEDROPDOWN 0x0080 * source/hpanel.prg * METHOD onEvent() ! minor fix in Paint() * source/hsplit.prg + DATA lScrolling * METHOD New() ! add two news parameters lTransp, lScrolling ) transparent and real scrolling * METHOD onEvent() * METHOD Paint() * METHOD Drag() * METHOD DragAll() ! code need for new features * source/htimer.prg * METHOD END() ! minor fix. * source/hownbtn.prg * METHOD onEvent() * METHOD Paint(0 ! minor fix * source/hhyper.prg * METHOD OnClicked() * METHOD Resize() ! fixed! * source/htool.prg - DATA nSize + DATA nwSize, nHSize * METHOD New() ! add news parameters nWSize,nHSize ( height and width bitmap ) and remove parameter size (width bitmap ) * METHOD CREATETOOL() ! fix news parameters * METHOD REFRESH() ! changed to VIRTUAL * METHOD Resize() ! fixed! * source/hwindow.prg * FUNCTION onSize ! minor fix * CLASS HMDIChildWindow * METHOD Activate ! moved bactivate to end Modified Paths: -------------- trunk/hwgui/Changelog trunk/hwgui/include/guilib.ch trunk/hwgui/include/windows.ch trunk/hwgui/source/hhyper.prg trunk/hwgui/source/hownbtn.prg trunk/hwgui/source/hpanel.prg trunk/hwgui/source/hsplit.prg trunk/hwgui/source/htimer.prg trunk/hwgui/source/htool.prg trunk/hwgui/source/hwindow.prg Modified: trunk/hwgui/Changelog =================================================================== --- trunk/hwgui/Changelog 2012-08-27 14:06:34 UTC (rev 1865) +++ trunk/hwgui/Changelog 2012-08-27 16:23:17 UTC (rev 1866) @@ -8,6 +8,57 @@ 2002-12-01 23:12 UTC+0100 Foo Bar <fo...@fo...> */ +2012-08-27 12:59 UTC-0300 Luis Fernando Basso <lfbasso at via-rs.net> + * include/guilib.ch + ! fix in <oShape> := HShape():New = [ <oShape> := ] HShape():New + * #xcommand @ <x>,<y> TOOLBAR [ <oTool> ] ; + ! changed[ BITMAPSIZE <bmpwidth> [, <bmpheight> ] ] ; + * #xcommand @ <x>,<y> SPLITTER [ <oSplit> ] ; + ! add [ <lTransp: TRANSPARENT>] ; + [ <lScroll: SCROLLING> ] ; + * include/window.ch + + #define TB_GETBUTTONSIZE (WM_USER + 58) + + #define BTNS_WHOLEDROPDOWN 0x0080 + * source/hpanel.prg + * METHOD onEvent() + ! minor fix in Paint() + * source/hsplit.prg + + DATA lScrolling + * METHOD New() + ! add two news parameters lTransp, lScrolling ) transparent and real scrolling + * METHOD onEvent() + * METHOD Paint() + * METHOD Drag() + * METHOD DragAll() + ! code need for new features + * source/htimer.prg + * METHOD END() + ! minor fix. + * source/hownbtn.prg + * METHOD onEvent() + * METHOD Paint(0 + ! minor fix + * source/hhyper.prg + * METHOD OnClicked() + * METHOD Resize() + ! fixed! + * source/htool.prg + - DATA nSize + + DATA nwSize, nHSize + * METHOD New() + ! add news parameters nWSize,nHSize ( height and width bitmap ) and remove parameter size (width bitmap ) + * METHOD CREATETOOL() + ! fix news parameters + * METHOD REFRESH() + ! changed to VIRTUAL + * METHOD Resize() + ! fixed! + * source/hwindow.prg + * FUNCTION onSize + ! minor fix + * CLASS HMDIChildWindow + * METHOD Activate + ! moved bactivate to end 2012-08-27 10:50 UTC-0300 Luis Fernando Basso <lfbasso at via-rs.net> * source/hcontrol.prg @@ -23,6 +74,8 @@ * CLASS HBUTTONEx * METHOD onEvent ! add event bOther + * METHOD PAINT() + ! draw focus only style WS_TABSTOP 2012-08-27 09:50 UTC-0300 Luis Fernando Basso <lfbasso at via-rs.net> * source/hbrowse.prg @@ -190,8 +243,8 @@ * Method Notify() * add Notify TVN_KEYDOWN handling keyDown event passing three parameters ; ::oItem, nKeyDown, Self * source/hsplit.prg - * METHOD Paint() - * METHOD DragAll() + * METHOD Paint() + * METHOD DragAll() ! fix in redraw * source/hpanel.prg + METHOD ResizeOffSet( nMode , lRelease ) Modified: trunk/hwgui/include/guilib.ch =================================================================== --- trunk/hwgui/include/guilib.ch 2012-08-27 14:06:34 UTC (rev 1865) +++ trunk/hwgui/include/guilib.ch 2012-08-27 16:23:17 UTC (rev 1866) @@ -918,8 +918,8 @@ [ WHEN <bWhen> ] ; [ ON CLICK <bClick> ] ; [ ITEMS <aItem> ] ; - [ COLORBLOCK <bClrBlck> ] ; - [ BHEADCLICK <bHeadClick> ] ; + [ [ON] COLORBLOCK <bClrBlck> ] ; + [ [ON] BHEADCLICK <bHeadClick> ] ; => ; <oBrw>:AddColumn( HColumn():New( <cHeader>,<block>,<cType>,<nLen>,<nDec>,<.lEdit.>,; <nJusHead>, <nJusLine>, <cPict>, <{bValid}>, <{bWhen}>, <aItem>, <{bClrBlck}>, <{bHeadClick}>, <color>, <bcolor>, <bClick> ) ) @@ -1113,12 +1113,14 @@ [ SIZE <width>, <height> ] ; [ COLOR <color> ] ; [ BACKCOLOR <bcolor> ] ; + [ <lTransp: TRANSPARENT>] ; + [ <lScroll: SCROLLING> ] ; [ ON SIZE <bSize> ] ; [ ON PAINT <bDraw> ] ; [ DIVIDE <aLeft> FROM <aRight> ] ; => ; [<oSplit> :=] HSplitter():New( <oWnd>,<nId>,<x>,<y>,<width>,<height>,<bSize>,<bDraw>,; - <color>,<bcolor>,<aLeft>,<aRight> );; + <color>,<bcolor>,<aLeft>,<aRight>, <lTransp>, <lScroll> );; [ <oSplit>:name := <(oSplit)> ] #xcommand PREPARE FONT <oFont> ; @@ -1349,7 +1351,9 @@ /* Menu system */ -#xcommand MENU [ OF <oWnd> ] [ ID <nId> ] [ TITLE <cTitle> ] [ COLOR <bcolor> ] [ BMPSIZE <nWidthBmp>, <nHeighBmp> ] ; +#xcommand MENU [ OF <oWnd> ] [ ID <nId> ] [ TITLE <cTitle> ] ; + [[ BACKCOLOR <bcolor> ][ COLOR <bcolor> ]] ; + [ BMPSIZE <nWidthBmp>, <nHeighBmp> ] ; => ; Hwg_BeginMenu( <oWnd>, <nId>, <cTitle>, <bcolor>, <nWidthBmp>,<nHeighBmp> ) @@ -1711,8 +1715,8 @@ [ SIZE <width>, <height> ] ; [ BUTTONWIDTH <btnwidth> ] ; [ INDENT <nIndent> ] ; - [ BITMAPSIZE <nSize> ] ; - [ FONT <oFont> ] ; + [ BITMAPSIZE <bmpwidth> [, <bmpheight> ] ] ; + [ FONT <oFont> ] ; [ ON INIT <bInit> ] ; [ ON SIZE <bSize> ] ; [<lTransp: TRANSPARENT>] ; @@ -1722,7 +1726,7 @@ [ ITEMS <aItems> ] ; => ; [<oTool> := ] Htoolbar():New( <oWnd>,<nId>,<nStyle>,<x>,<y>,<width>, <height>,<btnwidth>,<oFont>,; - <bInit>,<bSize>,,,,,<.lTransp.>,<.lVertical.>,<aItems>,<nSize>,<nIndent>,<nIDB>) ;; + <bInit>,<bSize>,,,,,<.lTransp.>,<.lVertical.>,<aItems>,<bmpwidth>,<bmpheight>,<nIndent>,<nIDB>) ;; [ <oTool>:name := <(oTool)> ] #xcommand REDEFINE TOOLBAR <oSay> ; @@ -1975,7 +1979,7 @@ [ ON INIT <bInit> ] ; [ ON SIZE <bSize> ] ; => ; - <oShape> := HShape():New(<oWnd>, <nId>, <x>, <y>, <width>, <height>, ; + [ <oShape> := ] HShape():New(<oWnd>, <nId>, <x>, <y>, <width>, <height>, ; <nBorder>, <nCurvature>, <nbStyle>,<nfStyle>, <tcolor>, <bcolor>, <bSize>,<bInit>,<nbackStyle>);; [ <oShape>:name := <(oShape)> ] Modified: trunk/hwgui/include/windows.ch =================================================================== --- trunk/hwgui/include/windows.ch 2012-08-27 14:06:34 UTC (rev 1865) +++ trunk/hwgui/include/windows.ch 2012-08-27 16:23:17 UTC (rev 1866) @@ -1100,6 +1100,7 @@ #define BTNS_CHECK TBSTYLE_CHECK // 0x0002 #define BTNS_GROUP TBSTYLE_GROUP // 0x0004 #define BTNS_CHECKGROUP TBSTYLE_CHECKGROUP // (TBSTYLE_GROUP | TBSTYLE_CHECK) +#define BTNS_WHOLEDROPDOWN 0x0080 #define TB_ENABLEBUTTON (WM_USER + 1) #define TB_HIDEBUTTON (WM_USER + 4) @@ -1110,6 +1111,7 @@ #define TB_GETSTATE (WM_USER + 18) #define TB_SETBITMAPSIZE (WM_USER + 32) #define TB_SETINDENT (WM_USER + 47) +#define TB_GETBUTTONSIZE (WM_USER + 58) #define TB_SETBUTTONWIDTH (WM_USER + 59) #define TTN_FIRST -520 Modified: trunk/hwgui/source/hhyper.prg =================================================================== --- trunk/hwgui/source/hhyper.prg 2012-08-27 14:06:34 UTC (rev 1865) +++ trunk/hwgui/source/hhyper.prg 2012-08-27 16:23:17 UTC (rev 1866) @@ -72,7 +72,7 @@ METHOD SetLinkColor( sLinkColor ) METHOD PAint( lpDis ) METHOD OnMouseMove( nFlags, lParam ) - METHOD Resize( ) + METHOD Resize( x, y ) ENDCLASS @@ -80,13 +80,13 @@ bSize, bPaint, ctooltip, tcolor, bcolor, lTransp, cLink, vColor, lColor, hColor, hbitmap, bClick ) CLASS HStaticLink LOCAL oPrevFont - nStyle := Hwg_BitOR( nStyle, SS_NOTIFY + SS_RIGHT ) + nStyle := Hwg_BitOR( nStyle, SS_NOTIFY + SS_RIGHT ) ::lAllUnderline := IIF( EMPTY( cLink ), .F., ::lAllUnderline ) ::title := IIF(cCaption != Nil,cCaption ,"HWGUI HomePage") ::hbitmap := hbitmap Super:New( oWndParent, nId, nStyle, nLeft, nTop, nWidth, nHeight, cCaption, oFont, bInit, ; - bSize, bPaint, ctooltip, tcolor, bcolor, lTransp, bClick ) + bSize, bPaint, ctooltip, tcolor, bcolor, lTransp )//, bClick ) DEFAULT vColor TO RGB( 5, 34, 143 ) DEFAULT lColor TO RGB( 0, 0, 255 ) @@ -116,7 +116,7 @@ ENDIF ENDIF ::oFontUnder := HFONT():Add( ::oFont:Name, 0, ::oFont:Height, , , , 1 ) - + ::nWidthOver := nWidth IF lTransp != NIL .AND. lTransp //::extStyle += WS_EX_TRANSPARENT ::backstyle := TRANSPARENT @@ -169,37 +169,53 @@ METHOD INIT() CLASS HStaticLink IF ! ::lInit - ::Resize( ) + /* - IF ::GetParentForm():Type <= WND_MDICHILD + IF ::GetParentForm():Type <= WND_MDICHILD .OR. ::TYPE = NIL ::nHolder := 1 SetWindowObject( ::handle, Self ) - Hwg_InitWinCtrl( ::handle ) + * Hwg_InitWinCtrl( ::handle ) + HWG_INITSTATICPROC( ::handle ) ENDIF */ + ::Resize( ) Super:init() IF ::Title != NIL SETWINDOWTEXT( ::handle, ::title ) ENDIF + ENDIF RETURN NIL METHOD onEvent( msg, wParam, lParam ) CLASS HStaticLink - IF msg == WM_PAINT //::PAint( ) ELSEIF msg == WM_MOUSEMOVE - // hwg_SetCursor( ::m_hHyperCursor ) - ::OnMouseMove( wParam, lParam ) + hwg_SetCursor( ::m_hHyperCursor ) + ::OnMouseMove( wParam, lParam ) + /* + IF ::state != LBL_MOUSEOVER + //::allMouseOver := .T. + * ::state := LBL_MOUSEOVER + TRACKMOUSEVENT( ::handle ) + ELSE + TRACKMOUSEVENT( ::handle, TME_HOVER + TME_LEAVE ) + ENDIF + */ + ELSEIF ( msg = WM_MOUSELEAVE .OR. msg = WM_NCMOUSELEAVE ) + ::state := LBL_NORMAL + ELSEIF msg = WM_MOUSEHOVER ELSEIF msg == WM_SETCURSOR ::OnSetCursor( msg, wParam, lParam ) - TRACKMOUSEVENT( ::handle ) + ELSEIF msg == WM_LBUTTONDOWN hwg_SetCursor( ::m_hHyperCursor ) ::OnClicked() + ELSEIF msg == WM_SIZE + ENDIF RETURN - 1 @@ -247,15 +263,16 @@ METHOD OnClicked() CLASS HStaticLink LOCAL nCtrlID - IF ! ISBLOCK( ::bClick ) + IF ISBLOCK( ::bClick ) + ::state := LBL_NORMAL + + ELSEIF !EMPTY( ::m_csUrl) IF ( ::m_bFireChild ) nCtrlID := ::id ::SendMessage( ::oparent:Handle, _HYPERLINK_EVENT, nCtrlID, 0 ) - //::PostMessage(pParent->m_hWnd, __EVENT_ID_, (WPARAM)nCtrlID, 0) ELSE ::GoToLinkUrl( ::m_csUrl ) ENDIF - ::m_bVisited := .T. ENDIF ::state := LBL_NORMAL @@ -271,7 +288,7 @@ HB_SYMBOL_UNUSED( nHitTest ) HB_SYMBOL_UNUSED( message ) - // hwg_SetCursor( ::m_hHyperCursor ) + hwg_SetCursor( ::m_hHyperCursor ) RETURN .t. @@ -303,7 +320,7 @@ res := .T. ELSE hwg_SetCursor( ::m_hHyperCursor ) - IF ( ! PtInRect( { 3, 3, ::nWidthover - 3, ::nHeight - 3 }, { xPos, yPos } ) ) + IF ( ! PtInRect( { 4, 4, ::nWidthover - 6, ::nHeight - 6 }, { xPos, yPos } ) ) //ReleaseCapture() res := .T. ENDIF @@ -317,7 +334,7 @@ ( ::state == LBL_NORMAL .AND. ! res .and. ::m_bVisited ) ::state := LBL_MOUSEOVER InvalidateRect( ::handle, 0 ) - RedrawWindow( ::oParent:Handle, RDW_ERASE + RDW_INVALIDATE + RDW_INTERNALPAINT , ::nLeft, ::nTop, ::nWidth, ::nHeight ) + RedrawWindow( ::oParent:Handle, RDW_ERASE + RDW_INVALIDATE + RDW_INTERNALPAINT , ::nLeft, ::nTop, ::nWidth, ::nHeight ) //SetCapture( ::handle ) ENDIF @@ -340,10 +357,7 @@ LOCAL itemRect := copyrect( { drawInfo[ 4 ], drawInfo[ 5 ], drawInfo[ 6 ], drawInfo[ 7 ] } ) LOCAL captionRect := { drawInfo[ 4 ] , drawInfo[ 5 ], drawInfo[ 6 ] , drawInfo[ 7 ] } LOCAL bmpRect - - IF EMPTY( ::oParent:handle ) - RETURN Nil - ENDIF + IF ::state == LBL_INIT ::State := LBL_NORMAL ENDIF @@ -399,12 +413,19 @@ RETURN NIL -METHOD Resize( ) CLASS HStaticLink +METHOD Resize( x, y ) CLASS HStaticLink //LOCAL aCoors := GetClientRect( ::handle ) LOCAL aBmpSize, aTxtSize + LOCAL nHeight := ::nHeight + + IF x != Nil .AND. x + y = 0 + RETURN Nil + ENDIF + x := iif( x == Nil, 0, x - ::nWidth + 1 ) aBmpSize := IIF( ! EMPTY( ::hbitmap ), GetBitmapSize( ::hbitmap ), { 0,0 } ) aBmpSize[ 1 ] += IIF( aBmpSize[ 1 ] > 0, 6, 0 ) + ::Move( , , ::nWidth + x , , 0 ) aTxtSize := TxtRect( ::Title, Self ) aTxtSize[ 2 ] += IIF( ::lAllUnderline, 0, 3 ) IF aTxtSize[ 1 ] + 1 < ::nWidth - aBmpSize[ 1 ] //tava 20 @@ -415,6 +436,10 @@ ::nWidthOver := MIN( aTxtSize[ 1 ] + 1 + aBmpSize[ 1 ], ::nWidth ) ::nHeight := MAX( ::nHeight, aTxtSize[ 2 ] ) ::nHeight := MAX( ::nHeight, aBmpSize[ 2 ] + 4 ) - ::Move( , , , ::nHeight, 0 ) - + + IF nHeight != ::nHeight + ::Move( , , , ::nHeight , 0 ) + Invalidaterect( ::Handle, 0 ) + ENDIF + RETURN Nil Modified: trunk/hwgui/source/hownbtn.prg =================================================================== --- trunk/hwgui/source/hownbtn.prg 2012-08-27 14:06:34 UTC (rev 1865) +++ trunk/hwgui/source/hownbtn.prg 2012-08-27 16:23:17 UTC (rev 1866) @@ -193,7 +193,7 @@ ::onLostFocus() ELSEIF msg = WM_CHAR .OR. msg = WM_KEYDOWN .OR. msg = WM_KEYUP IF wParam = VK_SPACE - ::Press() + ::Press() ::onClick() ::Release() ENDIF @@ -317,7 +317,7 @@ ENDIF ELSE IF ::state == OBTN_NORMAL - IF ::handle != GetFocus() + IF ! SelfFocus( ::handle, GetFocus() ) // NORM DrawButton( hDC, 0, 0, aCoors[ 3 ], aCoors[ 4 ], 0 ) ELSE @@ -332,7 +332,7 @@ ELSE IF ::Themed //SetBkMode( hdc, TRANSPARENT ) - IF ::handle = getfocus() .AND. ::lCheck + IF SelfFocus( ::handle, GetFocus() ) .AND. ::lCheck hb_DrawThemeBackground( ::hTheme, hdc, BP_PUSHBUTTON, PBS_PRESSED, aCoors, Nil ) ELSE //IF ::state != OBTN_NORMAL hb_DrawThemeBackground( ::hTheme, hdc, BP_PUSHBUTTON, state, aCoors, Nil ) Modified: trunk/hwgui/source/hpanel.prg =================================================================== --- trunk/hwgui/source/hpanel.prg 2012-08-27 14:06:34 UTC (rev 1865) +++ trunk/hwgui/source/hpanel.prg 2012-08-27 16:23:17 UTC (rev 1866) @@ -145,8 +145,8 @@ LOCAL nret IF msg == WM_PAINT + InvalidateRect( ::handle, 0 ) ::Paint() - *-RedrawWindow( ::handle, RDW_NOERASE + RDW_FRAME + RDW_INVALIDATE ) ELSEIF msg == WM_NCPAINT *- RedrawWindow( ::handle, RDW_NOERASE + RDW_FRAME + RDW_INVALIDATE + RDW_INTERNALPAINT ) ELSEIF msg == WM_ERASEBKGND @@ -246,8 +246,7 @@ FillRect( hDC, aCoors[ 1 ], aCoors[ 2 ], aCoors[ 3 ], aCoors[ 4 ], ::brush:handle ) ENDIF ELSE - * FillRect( hDC, aCoors[ 1 ], aCoors[ 2 ], aCoors[ 3 ], aCoors[ 4 ], COLOR_3DFACE + 1 ) - Gradient( hDC, aCoors[ 1 ], aCoors[ 2 ], aCoors[ 3 ], aCoors[ 4 ], RGB( 230, 240, 255 ), RGB( 255, 255, 2555 ), 0 ) + FillRect( hDC, aCoors[ 1 ], aCoors[ 2 ], aCoors[ 3 ], aCoors[ 4 ], COLOR_3DFACE + 1 ) ENDIF ENDIF nrePaint := -1 @@ -384,7 +383,8 @@ */ ::nWidth := aCoors[ 3 ] - aCoors[ 1 ] ::nHeight := aCoors[ 4 ] - aCoors[ 2 ] - RedrawWindow( ::handle, RDW_ERASE + RDW_INVALIDATE + RDW_FRAME + RDW_INTERNALPAINT + RDW_UPDATENOW ) // Force a complete redraw + // RedrawWindow( ::handle, RDW_ERASE + RDW_INVALIDATE + RDW_FRAME + RDW_INTERNALPAINT + RDW_UPDATENOW ) // Force a complete redraw + RETURN Nil /* nMode => nMode = 0 INIT / nMode = 1 RESIZE / nMode = 2 SHOW / nMode = 3 HIDE */ Modified: trunk/hwgui/source/hsplit.prg =================================================================== --- trunk/hwgui/source/hsplit.prg 2012-08-27 14:06:34 UTC (rev 1865) +++ trunk/hwgui/source/hsplit.prg 2012-08-27 16:23:17 UTC (rev 1866) @@ -13,6 +13,8 @@ #include "guilib.ch" #include "common.ch" +#define TRANSPARENT 1 + CLASS HSplitter INHERIT HControl CLASS VAR winclass INIT "STATIC" @@ -24,29 +26,35 @@ DATA lCaptured INIT .F. DATA lMoved INIT .F. DATA bEndDrag + DATA lScrolling METHOD New( oWndParent, nId, nLeft, nTop, nWidth, nHeight, ; - bSize, bDraw, color, bcolor, aLeft, aRight ) + bSize, bDraw, color, bcolor, aLeft, aRight, lTransp, lScrolling ) METHOD Activate() METHOD onEvent( msg, wParam, lParam ) METHOD Init() METHOD Paint() METHOD Drag( lParam ) - METHOD DragAll() + METHOD DragAll( lScroll ) ENDCLASS METHOD New( oWndParent, nId, nLeft, nTop, nWidth, nHeight, ; - bSize, bDraw, color, bcolor, aLeft, aRight ) CLASS HSplitter - - Super:New( oWndParent, nId, WS_CHILD + WS_VISIBLE + SS_OWNERDRAW, nLeft, nTop, nWidth, nHeight,,, ; + bSize, bDraw, color, bcolor, aLeft, aRight, lTransp, lScrolling ) CLASS HSplitter + //+ WS_CLIPCHILDREN + Super:New( oWndParent, nId, WS_VISIBLE + SS_OWNERDRAW , nLeft, nTop, nWidth, nHeight,,, ; bSize, bDraw,, color, bcolor ) ::title := "" + ::aLeft := IIf( aLeft == Nil, { }, aLeft ) ::aRight := IIf( aRight == Nil, { }, aRight ) ::lVertical := ( ::nHeight > ::nWidth ) - + ::lScrolling := Iif( lScrolling == Nil, .F., lScrolling ) + IF ( lTransp != NIL .AND. lTransp ) + ::BackStyle := TRANSPARENT + ::extStyle += WS_EX_TRANSPARENT + ENDIF ::Activate() RETURN Self @@ -54,11 +62,22 @@ METHOD Activate() CLASS HSplitter IF ! Empty( ::oParent:handle ) ::handle := CreateStatic( ::oParent:handle, ::id, ; - ::style, ::nLeft, ::nTop, ::nWidth, ::nHeight ) + ::style, ::nLeft, ::nTop, ::nWidth, ::nHeight, ::extStyle ) ::Init() ENDIF RETURN Nil +METHOD Init() CLASS HSplitter + + IF ! ::lInit + Super:Init() + ::nHolder := 1 + SetWindowObject( ::handle, Self ) + Hwg_InitWinCtrl( ::handle ) + ENDIF + + RETURN Nil + METHOD onEvent( msg, wParam, lParam ) CLASS HSplitter HB_SYMBOL_UNUSED( wParam ) @@ -70,9 +89,14 @@ Hwg_SetCursor( ::hCursor ) IF ::lCaptured ::Drag( lParam ) + IF ::lScrolling + ::DragAll( .T. ) + ENDIF ENDIF ELSEIF msg == WM_PAINT ::Paint() + ELSEIF msg == WM_ERASEBKGND + ELSEIF msg == WM_LBUTTONDOWN Hwg_SetCursor( ::hCursor ) SetCapture( ::handle ) @@ -80,10 +104,11 @@ InvalidateRect( ::handle, 1 ) ELSEIF msg == WM_LBUTTONUP ReleaseCapture() - ::DragAll() ::lCaptured := .F. + ::lMoved := .F. + ::DragAll( .F. ) IF ::bEndDrag != Nil - Eval( ::bEndDrag, Self ) + // Eval( ::bEndDrag, Self ) ENDIF ELSEIF msg == WM_DESTROY ::END() @@ -91,17 +116,7 @@ RETURN - 1 -METHOD Init() CLASS HSplitter - IF ! ::lInit - Super:Init() - ::nHolder := 1 - SetWindowObject( ::handle, Self ) - Hwg_InitWinCtrl( ::handle ) - ENDIF - - RETURN Nil - METHOD Paint() CLASS HSplitter LOCAL pps, hDC, aCoors, x1, y1, x2, y2, oBrushFill @@ -109,21 +124,26 @@ pps := DefinePaintStru() hDC := BeginPaint( ::handle, pps ) aCoors := GetClientRect( ::handle ) - x1 := aCoors[ 1 ] + IIf( ::lVertical, 1, 2 ) - y1 := aCoors[ 2 ] + IIf( ::lVertical, 2, 1 ) - x2 := aCoors[ 3 ] - IIf( ::lVertical, 0, 3 ) - y2 := aCoors[ 4 ] - IIf( ::lVertical, 3, 0 ) + + x1 := aCoors[ 1 ] //+ IIf( ::lVertical, 1, 2 ) + y1 := aCoors[ 2 ] //+ IIf( ::lVertical, 2, 1 ) + x2 := aCoors[ 3 ] //- IIf( ::lVertical, 0, 3 ) + y2 := aCoors[ 4 ] //- IIf( ::lVertical, 3, 0 ) + SetBkMode( hDC, ::backStyle ) IF ::bPaint != Nil Eval( ::bPaint, Self ) - ELSE + ELSEIF ! ::lScrolling IF ::lCaptured + oBrushFill := HBrush():Add( RGB( 156, 156, 156 ) ) + SelectObject( hDC, oBrushFill:handle ) DrawEdge( hDC, x1, y1, x2, y2, EDGE_ETCHED, Iif( ::lVertical,BF_RECT,BF_TOP ) + BF_MIDDLE ) - oBrushFill := HBrush():Add( RGB( 160,160,160 ) ) - FillRect( hDC, x1 + 1, y1 + 1, x2 - 1, y2 - 1, oBrushFill:handle ) - ELSE + FillRect( hDC, x1, y1, x2, y2, oBrushFill:handle ) + ELSEIF ::BackStyle = OPAQUE DrawEdge( hDC, x1, y1, x2, y2, EDGE_ETCHED, IIf( ::lVertical, BF_LEFT, BF_TOP ) ) ENDIF + ELSEIF !::lMoved .AND. ::BackStyle = OPAQUE + DrawEdge( hDC, x1, y1, x2, y2, EDGE_ETCHED, Iif( ::lVertical,BF_RECT,BF_TOP ) ) //+ BF_MIDDLE ) ENDIF EndPaint( ::handle, pps ) @@ -137,20 +157,25 @@ xPos -= 65535 ENDIF ::nLeft += xPos + yPos := 0 ELSE IF yPos > 32000 yPos -= 65535 ENDIF ::nTop += yPos + xPos := 0 ENDIF - MoveWindow( ::handle, ::nLeft, ::nTop, ::nWidth, ::nHeight ) + ::Move( ::nLeft + xPos, ::nTop + yPos, ::nWidth, ::nHeight ) //, ! ::lScrolling ) + InvalidateRect( ::oParent:handle, 1, ::nLeft, ::nTop, ::nleft + ::nWidth , ::nTop + ::nHeight ) ::lMoved := .T. RETURN Nil -METHOD DragAll() CLASS HSplitter +METHOD DragAll( lScroll ) CLASS HSplitter LOCAL i, oCtrl, xDiff := 0, yDiff := 0 + lScroll := IIF( Len( ::aLeft ) = 0 .OR. Len( ::aRight ) = 0, .F., lScroll ) + FOR i := 1 TO Len( ::aRight ) oCtrl := ::aRight[ i ] IF ::lVertical @@ -162,8 +187,12 @@ //oCtrl:nTop += nDiff //oCtrl:nHeight -= nDiff ENDIF - oCtrl:Move( oCtrl:nLeft + xDiff, oCtrl:nTop + yDiff, oCtrl:nWidth - xDiff, oCtrl:nHeight - yDiff ) - InvalidateRect( oCtrl:oParent:Handle, 1, oCtrl:nLeft, oCtrl:nTop, oCtrl:nleft + oCtrl:nWidth, oCtrl:nTop + oCtrl:nHeight ) + oCtrl:Move( oCtrl:nLeft + xDiff, oCtrl:nTop + yDiff, oCtrl:nWidth - xDiff ,oCtrl:nHeight - yDiff, ! lScroll ) + //InvalidateRect( oCtrl:oParent:Handle, 1, oCtrl:nLeft, oCtrl:nTop, oCtrl:nleft + oCtrl:nWidth, oCtrl:nTop + oCtrl:nHeight ) + IF oCtrl:winclass == "STATIC" + InvalidateRect( oCtrl:Handle, 1 ) + ENDIF + NEXT FOR i := 1 TO Len( ::aLeft ) oCtrl := ::aLeft[ i ] @@ -171,14 +200,24 @@ xDiff := ::nLeft - ( oCtrl:nLeft + oCtrl:nWidth ) //oCtrl:nWidth += nDiff ELSE + yDiff := ::nTop - ( oCtrl:nTop + oCtrl:nHeight ) // oCtrl:nHeight += nDiff ENDIF - oCtrl:Move( oCtrl:nLeft, oCtrl:nTop, oCtrl:nWidth + xDiff, oCtrl:nHeight + yDiff ) - InvalidateRect( oCtrl:oParent:Handle, 1, oCtrl:nLeft, oCtrl:nTop, oCtrl:nleft + oCtrl:nWidth, oCtrl:nTop+oCtrl:nHeight ) + oCtrl:Move( oCtrl:nLeft, oCtrl:nTop, oCtrl:nWidth + xDiff, oCtrl:nHeight + yDiff , ! lScroll ) + IF oCtrl:winclass == "STATIC" + InvalidateRect( oCtrl:Handle, 1 ) + ENDIF + + //InvalidateRect( oCtrl:oParent:Handle, 1, oCtrl:nLeft, oCtrl:nTop, oCtrl:nleft + oCtrl:nWidth, oCtrl:nTop+oCtrl:nHeight ) NEXT - ::lMoved := .F. - InvalidateRect( ::oParent:handle, 1, ::nleft,::ntop, ::nleft + ::nwidth, ::nTop + ::nHeight ) + //::lMoved := .F. + IF ! lScroll + InvalidateRect( ::oParent:handle, 1, ::nleft, ::ntop, ::nleft + ::nwidth, ::nTop + ::nHeight ) + ENDIF + IF ::bEndDrag != Nil + Eval( ::bEndDrag,Self ) + ENDIF RETURN Nil Modified: trunk/hwgui/source/htimer.prg =================================================================== --- trunk/hwgui/source/htimer.prg 2012-08-27 14:06:34 UTC (rev 1865) +++ trunk/hwgui/source/htimer.prg 2012-08-27 16:23:17 UTC (rev 1866) @@ -75,7 +75,9 @@ METHOD END() CLASS HTimer LOCAL i - KillTimer( ::oParent:handle, ::id ) + IF ::oParent != Nil + KillTimer( ::oParent:handle, ::id ) + ENDIF IF ( i := AScan( ::aTimers, { | o | o:id == ::id } ) ) > 0 ADel( ::aTimers, i ) ASize( ::aTimers, Len( ::aTimers ) - 1 ) Modified: trunk/hwgui/source/htool.prg =================================================================== --- trunk/hwgui/source/htool.prg 2012-08-27 14:06:34 UTC (rev 1865) +++ trunk/hwgui/source/htool.prg 2012-08-27 16:23:17 UTC (rev 1866) @@ -137,32 +137,32 @@ Data aItem INIT {} DATA Line DATA nIndent - DATA nSize - data nDrop + DATA nwSize, nHSize + DATA nDrop METHOD New( oWndParent,nId,nStyle,nLeft,nTop,nWidth,nHeight,btnWidth,oFont,bInit, ; - bSize,bPaint,ctooltip,tcolor,bcolor,lTransp, lVertical ,aItem, nSize,nIndent, nIDB ) + bSize,bPaint,ctooltip,tcolor,bcolor,lTransp, lVertical ,aItem, nWSize,nHSize, nIndent, nIDB ) METHOD Redefine( oWndParent, nId, cCaption, oFont, bInit, ; bSize, bPaint, ctooltip, tcolor, bcolor, lTransp, aItem ) METHOD Activate() METHOD INIT() METHOD CreateTool() - METHOD AddButton( nBitIp,nId,bState,bStyle,cText,bClick,c,aMenu, cName ) + METHOD AddButton( nBitIp, nId, bState, bStyle, cText, bClick, c, aMenu, cName, nIndex ) METHOD Notify( lParam ) METHOD EnableButton( idButton, lEnable ) INLINE SENDMESSAGE( ::handle, TB_ENABLEBUTTON, INT( idButton ), MAKELONG( IIF( lEnable, 1, 0 ), 0) ) METHOD ShowButton( idButton ) INLINE SENDMESSAGE( ::handle, TB_HIDEBUTTON, INT( idButton ), MAKELONG( 0, 0 ) ) METHOD HideButton( idButton ) INLINE SENDMESSAGE( ::handle, TB_HIDEBUTTON, INT( idButton ), MAKELONG( 1, 0 ) ) - METHOD REFRESH() - METHOD Resize( xIncrSize ) + METHOD REFRESH() VIRTUAL + METHOD RESIZE( xIncrSize, lWidth, lHeight ) ENDCLASS -METHOD New( oWndParent,nId,nStyle,nLeft,nTop,nWidth,nHeight,btnWidth,oFont,bInit, ; - bSize,bPaint,ctooltip,tcolor,bcolor,lTransp, lVertical ,aItem, nSize,nIndent, nIDB ) CLASS hToolBar +METHOD New( oWndParent, nId, nStyle, nLeft, nTop, nWidth, nHeight, btnWidth, oFont, bInit, ; + bSize, bPaint, ctooltip, tcolor, bcolor, lTransp, lVertical ,aItem, nWSize,nHSize, nIndent, nIDB ) CLASS hToolBar //HB_SYMBOL_UNUSED( cCaption ) - HB_SYMBOL_UNUSED( lTransp ) + //HB_SYMBOL_UNUSED( lTransp ) DEFAULT aitem TO { } @@ -186,7 +186,8 @@ ::nIDB := nIDB ::aItem := aItem ::nIndent := IIF( nIndent != NIL , nIndent, 1 ) - ::nSize := IIF( nSize != NIL .AND. nSize > 11 , nSize, Nil ) + ::nwSize := IIF( nwSize != NIL .AND. nwSize > 11 , nwSize, 16 ) + ::nhSize := IIF( nhSize != NIL .AND. nhSize > 11 , nhSize, ::nwSize - 1 ) ::lnoThemes := ! ISTHEMEACTIVE() .OR. ! ::WindowsManifest IF Hwg_BitAnd( ::Style, WS_DLGFRAME + WS_BORDER ) = 0 IF ! ::lVertical @@ -195,7 +196,7 @@ ::Line := HLine():New(oWndParent,,::lVertical,nLeft + nWidth + 1 ,nTop,nHeight) ENDIF ENDIF - IF __ObjHasMsg( ::oParent,"AOFFSET" ) .AND. ::oParent:type == WND_MDI.AND.; + IF __ObjHasMsg( ::oParent,"AOFFSET" ) .AND. ::oParent:type == WND_MDI .AND. ; ::oParent:aOffset[ 2 ] + ::oParent:aOffset[ 3 ] = 0 IF ::nWidth > ::nHeight .OR. ::nWidth == 0 ::oParent:aOffset[ 2 ] := ::nHeight @@ -262,25 +263,25 @@ Local n,n1 Local aTemp Local aButton :={} - Local oButton Local aBmpSize, hIm, nPos + Local nMax := 0 Local hImage, img, nlistimg, ndrop := 0 IF ! ::lResource IF Empty( ::handle ) RETURN Nil - ENDIF - IF !::lCreate - DESTROYWINDOW( ::Handle ) - ::activate() - //IF !EMPTY( ::oFont ) + ENDIF + IF !::lCreate + DESTROYWINDOW( ::Handle ) + ::Activate() + //IF !EMPTY( ::oFont ) ::SetFont( ::oFont ) - //ENDIF - ENDIF + //ENDIF + ENDIF ELSE - FOR n = 1 TO Len( ::aitem ) - oButton := ::AddButton(::aitem[ n, 1 ],::aitem[ n, 2 ],::aitem[ n, 3 ],::aitem[ n, 4 ],::aitem[ n, 6 ], ::aitem[ n, 7 ], ::aitem[ n, 8 ], ::aitem[ n, 9 ] ) - ::aItem[n, 11] := oButton + FOR n = 1 TO Len( ::aitem ) + ::AddButton(::aitem[ n, 1 ],::aitem[ n, 2 ],::aitem[ n, 3 ],::aitem[ n, 4 ],::aitem[ n, 6 ], ::aitem[ n, 7 ], ::aitem[ n, 8 ], ::aitem[ n, 9 ], , n ) + //::aItem[n, 11] := oButton NEXT ENDIF /* @@ -289,69 +290,62 @@ SendMessage( ::handle, TB_SETSTYLE, 0, nStyle ) ENDIF */ - nlistimg := 0 - IF ::nIDB != Nil .AND. ::nIDB >= 0 - nlistimg := TOOLBAR_LOADSTANDARTIMAGE( ::handle, ::nIDB ) - ENDIF - IF Hwg_BitAnd( ::Style, TBSTYLE_LIST ) > 0 .AND. ::nSize = Nil - ::nSize := MAX( 16, ( ::nHeight - 16 ) ) - ENDIF - IF ::nSize != Nil - SendMessage( ::HANDLE ,TB_SETBITMAPSIZE,0, MAKELONG ( ::nSize, ::nSize ) ) - ENDIF + nlistimg := 0 + IF ::nIDB != Nil .AND. ::nIDB >= 0 + nlistimg := TOOLBAR_LOADSTANDARTIMAGE( ::handle, ::nIDB ) + ENDIF + IF Hwg_BitAnd( ::Style, TBSTYLE_LIST ) > 0 .AND. ::nwSize = Nil + ::nwSize := MAX( 16, ( ::nHeight - 16 ) ) + ENDIF + IF ::nwSize != Nil + SendMessage( ::HANDLE ,TB_SETBITMAPSIZE,0, MAKELONG ( ::nwSize, ::nhSize ) ) + ENDIF - FOR n := 1 TO Len( ::aItem ) - IF ::aItem[ n, 4 ] = BTNS_SEP - LOOP - ENDIF - IF ValType( ::aItem[ n, 7 ] ) == "B" + FOR n := 1 TO Len( ::aItem ) + IF ValType( ::aItem[ n, 7 ] ) == "B" + //::oParent:AddEvent( BN_CLICKED, ::aItem[ n, 2 ], ::aItem[ n , 7 ] ) + ENDIF + IF ValType( ::aItem[ n, 9 ] ) == "A" + ::aItem[ n, 10 ] := hwg__CreatePopupMenu() + ::aItem[ n, 11 ]:hMenu := ::aItem[ n, 10 ] + aTemp := ::aItem[ n, 9 ] - //::oParent:AddEvent( BN_CLICKED, ::aItem[ n, 2 ], ::aItem[ n , 7 ] ) - - ENDIF - - IF ValType( ::aItem[ n, 9 ] ) == "A" - - - ::aItem[ n, 10 ] := hwg__CreatePopupMenu() - ::aItem[ n, 11 ]:hMenu := ::aItem[ n, 10 ] - aTemp := ::aItem[ n, 9 ] - - FOR n1 := 1 TO Len( aTemp ) - aTemp[ n1, 1 ] := IIF( aTemp[ n1, 1 ] = "-", NIL, aTemp[ n1, 1 ] ) - hwg__AddMenuItem( ::aItem[ n, 10 ], aTemp[ n1, 1 ], - 1, .F., aTemp[ n1, 2 ], , .F. ) - ::oParent:AddEvent( BN_CLICKED, aTemp[ n1, 2 ], aTemp[ n1, 3 ] ) - NEXT - - ENDIF - - IF ::aItem[ n, 4 ] = BTNS_SEP - LOOP - ENDIF - - nDrop := IIF( nDrop = 8, nDrop, IIF( Hwg_Bitand(::aItem[ n, 4 ], BTNS_DROPDOWN ) != 0 .AND.::aItem[ n, 4 ] < 128, 8, 1 ) ) + FOR n1 := 1 TO Len( aTemp ) + aTemp[ n1, 1 ] := IIF( aTemp[ n1, 1 ] = "-", NIL, aTemp[ n1, 1 ] ) + hwg__AddMenuItem( ::aItem[ n, 10 ], aTemp[ n1, 1 ], - 1, .F., aTemp[ n1, 2 ], , .F. ) + ::oParent:AddEvent( BN_CLICKED, aTemp[ n1, 2 ], aTemp[ n1, 3 ] ) + NEXT + ENDIF + IF ::aItem[ n, 4 ] = BTNS_SEP + LOOP + ENDIF + nDrop := Max( nDrop, IIF( Hwg_Bitand(::aItem[ n, 4 ], BTNS_WHOLEDROPDOWN ) != 0, 0, ; + IIF( Hwg_Bitand(::aItem[ n, 4 ], BTNS_DROPDOWN ) != 0, 8,0 ) ) ) /* IF ::nSize != Nil SendMessage( ::HANDLE ,TB_SETBITMAPSIZE,0, MAKELONG ( ::nSize, ::nSize ) ) ENDIF */ - IF ValType( ::aItem[ n, 1 ] ) == "C" .OR. ::aItem[ n, 1 ] > 1 - IF ValType( ::aItem[ n, 1 ] ) == "C" .AND. At(".", ::aitem[ n, 1 ] ) != 0 - //AAdd( aButton, LoadImage( , ::aitem[ n, 1 ] , IMAGE_BITMAP, 0, 0, LR_DEFAULTSIZE + LR_CREATEDIBSECTION+ LR_LOADFROMFILE ) ) - hImage := HBITMAP():AddFile( ::aitem[ n, 1 ], , .T., ::nSize, ::nSize ):handle - ELSE - // AAdd( aButton, HBitmap():AddResource( ::aitem[ n, 1 ] ):handle ) - hImage := HBitmap():AddResource( ::aitem[ n, 1 ], LR_LOADTRANSPARENT + LR_LOADMAP3DCOLORS, ,::nSize,::nSize ):handle + IF ValType( ::aItem[ n, 1 ] ) == "C" .OR. ::aItem[ n, 1 ] > 1 + IF ValType( ::aItem[ n, 1 ] ) == "C" .AND. At(".", ::aitem[ n, 1 ] ) != 0 + IF !File( ::aitem[ n, 1 ] ) + Loop ENDIF - IF ( img := Ascan( aButton, hImage )) = 0 - AAdd( aButton, hImage ) - img := Len( aButton ) - ENDIF - ::aItem[n ,1 ] := img + nlistimg //n - IF ! ::lResource - TOOLBAR_LOADIMAGE( ::Handle, aButton[ img ]) - ENDIF + //AAdd( aButton, LoadImage( , ::aitem[ n, 1 ] , IMAGE_BITMAP, 0, 0, LR_DEFAULTSIZE + LR_CREATEDIBSECTION+ LR_LOADFROMFILE ) ) + hImage := HBITMAP():AddFile( ::aitem[ n, 1 ], , .T., ::nwSize, ::nhSize ):handle ELSE + // AAdd( aButton, HBitmap():AddResource( ::aitem[ n, 1 ] ):handle ) + hImage := HBitmap():AddResource( ::aitem[ n, 1 ], LR_LOADTRANSPARENT + LR_LOADMAP3DCOLORS, ,::nwSize,::nhSize ):handle + ENDIF + IF ( img := Ascan( aButton, hImage )) = 0 + AAdd( aButton, hImage ) + img := Len( aButton ) + ENDIF + ::aItem[ n ,1 ] := img + nlistimg //n + IF ! ::lResource + TOOLBAR_LOADIMAGE( ::Handle, aButton[ img ]) + ENDIF + ELSE /* IF ::aItem[ n, 1 ] > 1 hImage := HBitmap():AddResource( ::aitem[ n, 1 ], LR_LOADTRANSPARENT + LR_LOADMAP3DCOLORS,,::nSize,::nSize ):handle @@ -359,11 +353,10 @@ */ // AAdd( aButton, LoadImage( , ::aitem[ n, 1 ] , IMAGE_BITMAP, 0, 0, LR_DEFAULTSIZE + LR_CREATEDIBSECTION ) ) // hImage := HBitmap():AddResource( ::aitem[ n, 1 ], LR_LOADTRANSPARENT + LR_LOADMAP3DCOLORS + LR_SHARED,,::nSize,::nSize ):handle - ENDIF - NEXT - IF Len( aButton ) > 0 //.AND. ::lResource - - aBmpSize := GetBitmapSize( aButton[ 1 ] ) + ENDIF + NEXT + IF Len( aButton ) > 0 //.AND. ::lResource + aBmpSize := GetBitmapSize( aButton[ 1 ] ) /* nmax := aBmpSize[ 3 ] @@ -383,8 +376,8 @@ hIm := CreateImageList( { } , aBmpSize[ 1 ], aBmpSize[ 2 ], 1, ILC_COLORDDB + ILC_MASK ) ENDIF */ - hIm := CreateImageList( {} ,aBmpSize[ 1 ], aBmpSize[ 2 ], 1, ILC_COLORDDB + ILC_MASK ) - FOR nPos := 1 TO Len( aButton ) + hIm := CreateImageList( {} ,aBmpSize[ 1 ], aBmpSize[ 2 ], 1, ILC_COLORDDB + ILC_MASK ) + FOR nPos := 1 TO Len( aButton ) // aBmpSize := GetBitmapSize( aButton[ nPos ] ) /* @@ -395,30 +388,38 @@ Imagelist_Add( hIm, aButton[ nPos ] ) ENDIF */ - Imagelist_Add( hIm, aButton[ nPos ] ) - NEXT - SendMessage( ::Handle, TB_SETIMAGELIST, 0, hIm ) - ELSEIF Len(aButton ) = 0 - SendMessage( ::HANDLE ,TB_SETBITMAPSIZE,0, MAKELONG ( 0, 0 ) ) + Imagelist_Add( hIm, aButton[ nPos ] ) + NEXT + SendMessage( ::Handle, TB_SETIMAGELIST, 0, hIm ) + ELSEIF Len(aButton ) = 0 + SendMessage( ::HANDLE ,TB_SETBITMAPSIZE,0, MAKELONG ( 0, 0 ) ) //SendMessage( ::handle, TB_SETDRAWTEXTFLAGS, DT_CENTER+DT_VCENTER, DT_CENTER+DT_VCENTER ) + ENDIF + SENDMESSAGE( ::Handle, TB_SETINDENT, ::nIndent, 0) + IF !Empty( ::BtnWidth ) + SENDMESSAGE( ::Handle, TB_SETBUTTONWIDTH, 0, MAKELPARAM( ::BtnWidth -1, ::BtnWidth + 1 ) ) + //SENDMESSAGE( ::Handle, TB_SETBUTTONWIDTH, MAKELPARAM( ::BtnWidth, ::BtnWidth ) ) + ENDIF + IF Len( ::aItem ) > 0 + TOOLBARADDBUTTONS( ::handle, ::aItem, Len( ::aItem ) ) + SendMessage( ::handle, TB_SETEXTENDEDSTYLE, 0, TBSTYLE_EX_DRAWDDARROWS ) + ENDIF + IF ::BtnWidth != Nil + IF Hwg_BitAnd( ::Style, CCS_NODIVIDER ) > 0 + nMax := IIF( Hwg_BitAnd( ::Style, WS_DLGFRAME + WS_BORDER ) > 0 , 4, 2 ) + ELSEIF Hwg_BitAnd( ::Style, TBSTYLE_FLAT ) > 0 + nMax := 2 ENDIF - - SENDMESSAGE( ::Handle, TB_SETINDENT, ::nIndent, 0) - SENDMESSAGE( ::Handle, TB_SETBUTTONWIDTH, MAKELPARAM( ::BtnWidth, ::BtnWidth ) ) - IF Len( ::aItem ) > 0 - TOOLBARADDBUTTONS( ::handle, ::aItem, Len( ::aItem ) ) - SendMessage( ::handle, TB_SETEXTENDEDSTYLE, 0, TBSTYLE_EX_DRAWDDARROWS ) - ENDIF - - IF ::BtnWidth != Nil - nDrop += IIF( Hwg_BitAnd( ::Style, WS_DLGFRAME + WS_BORDER ) > 0, 5, 0 ) - ::nDrop := nDrop - IF ! ::lVertical // -2 s n\xC6o tiver menu - 9 se tiver menu tipo 8 - SENDMESSAGE( ::handle, TB_SETBUTTONSIZE, 0, MAKELPARAM( ::BtnWidth, ::nHeight - nDrop - IIF( !::lnoThemes .AND. Hwg_BitAnd( ::Style, TBSTYLE_FLAT ) > 0, 1, 2 ) ) ) - ELSE - SENDMESSAGE( ::handle, TB_SETBUTTONSIZE, 0, MAKELPARAM( ::nWidth - nDrop - 1, ::BtnWidth ) ) - ENDIF - ENDIF + ::ndrop := nMax + IIF( ! ::WindowsManifest ,0, nDrop ) + ::BtnHeight := MAX( HIWORD( SENDMESSAGE( ::handle, TB_GETBUTTONSIZE, 0, 0 ) ),; + ::nHeight - ::nDrop - IIF( ! ::lnoThemes .AND. Hwg_BitAnd( ::Style, TBSTYLE_FLAT ) > 0, 0, 2 ) ) + IF ! ::lVertical + SENDMESSAGE( ::handle, TB_SETBUTTONSIZE, 0, MAKELPARAM( ::BtnWidth , ::BtnHeight ) ) + ELSE + SENDMESSAGE( ::handle, TB_SETBUTTONSIZE, 0, MAKELPARAM( ::nWidth - ::nDrop - 1, ::BtnWidth ) ) + ENDIF + ENDIF + ::BtnWidth := LOWORD( SENDMESSAGE( ::handle, TB_GETBUTTONSIZE, 0, 0 ) ) /* IF ::lTransp nStyle := SendMessage( ::handle, TB_GETSTYLE, 0, 0 ) + TBSTYLE_TRANSPARENT @@ -468,16 +469,7 @@ RETURN 0 -METHOD REFRESH() CLASS htoolbar - /* - IF ::lInit - ::lInit := .f. - ENDIF - ::init() - */ - RETURN nil - -METHOD AddButton(nBitIp,nId,bState,bStyle,cText,bClick,c,aMenu, cName) CLASS hToolBar +METHOD AddButton( nBitIp, nId, bState, bStyle, cText, bClick, c, aMenu, cName, nIndex ) CLASS hToolBar Local hMenu := Nil, oButton DEFAULT nBitIp to -1 @@ -505,29 +497,34 @@ oButton := HToolButton():New(Self,cName,nBitIp,nId,bState,bStyle,cText,bClick, c ,aMenu) IF ! ::lResource AAdd( ::aItem ,{ nBitIp, nId, bState, bStyle, 0, cText, bClick, c, aMenu, hMenu, oButton } ) + ELSE + ::aItem[ nIndex ] := { nBitIp, nId, bState, bStyle, 0, cText, bClick, c, aMenu, hMenu, oButton } Endif RETURN oButton -METHOD Resize( xIncrSize ) CLASS hToolBar - - IF ::Anchor = 0 +METHOD RESIZE( xIncrSize, lWidth, lHeight ) CLASS hToolBar + LOCAL nSize + + IF ::Anchor = 0 .OR. ( ! lWidth .AND. ! lHeight ) RETURN Nil ENDIF - ::BtnWidth := Round( (::BtnWidth ) * xIncrSize , 0) - 2 - - SENDMESSAGE( ::Handle, TB_SETBUTTONWIDTH, MAKELPARAM( ::BtnWidth - 1, ::BtnWidth + 1 ) ) - - IF ::BtnWidth != Nil - IF ! ::lVertical // -2 s n\xC6o tiver menu - 9 se tiver menu tipo 8 - SENDMESSAGE( ::handle, TB_SETBUTTONSIZE, 0, MAKELPARAM( ::BtnWidth, ::nHeight - ::nDrop - ; - IIF( !::lnoThemes .AND. Hwg_BitAnd( ::Style, TBSTYLE_FLAT ) > 0, 1, 2 ) ) ) - ELSE - SENDMESSAGE( ::handle, TB_SETBUTTONSIZE, 0, MAKELPARAM( ::nWidth - ::nDrop - 1, ::BtnWidth ) ) - ENDIF - ENDIF + nSize := SENDMESSAGE( ::handle, TB_GETBUTTONSIZE, 0, 0 ) IF xIncrSize != 1 - ::Move( ::nLeft, ::nTop, ::nWidth + 1, ::nHeight, 0 ) + ::Move( ::nLeft, ::nTop, ::nWidth, ::nHeight, 0 ) ENDIF + IF xIncrSize < 1 .OR. LOWORD( nSize) <= ::BtnWidth + ::BtnWidth := ::BtnWidth * xIncrSize + ELSE + ::BtnWidth := LOWORD( nSize) * xIncrSize + ENDIF + SENDMESSAGE( ::Handle, TB_SETBUTTONWIDTH, MAKELPARAM( ::BtnWidth - 1, ::BtnWidth + 1 ) ) + IF ::BtnWidth != Nil + IF ! ::lVertical + SENDMESSAGE( ::handle, TB_SETBUTTONSIZE, 0, MAKELPARAM( ::BtnWidth, ::BtnHeight )) + ELSE + SENDMESSAGE( ::handle, TB_SETBUTTONSIZE, 0, MAKELPARAM( ::nWidth - ::nDrop - 1, ::BtnWidth ) ) + ENDIF + ENDIF RETURN NIL Modified: trunk/hwgui/source/hwindow.prg =================================================================== --- trunk/hwgui/source/hwindow.prg 2012-08-27 14:06:34 UTC (rev 1865) +++ trunk/hwgui/source/hwindow.prg 2012-08-27 16:23:17 UTC (rev 1866) @@ -37,7 +37,7 @@ aCoors := GetClientRect( oWnd:handle ) //MoveWindow( HWindow():aWindows[ 2 ]:handle, oWnd:aOffset[ 1 ], oWnd:aOffset[ 2 ], aCoors[ 3 ] - oWnd:aOffset[ 1 ] - oWnd:aOffset[ 3 ], aCoors[ 4 ] - oWnd:aOffset[ 2 ] - oWnd:aOffset[ 4 ] ) //aCoors := GetClientRect(HWindow():aWindows[ 2 ]:handle ) - SetWindowPos( HWindow():aWindows[ 2 ]:handle, Nil, oWnd:aOffset[ 1 ], oWnd:aOffset[ 2 ], aCoors[ 3 ] - oWnd:aOffset[ 1 ] - oWnd:aOffset[ 3 ], aCoors[ 4 ] - oWnd:aOffset[ 2 ] - oWnd:aOffset[ 4 ] , SWP_NOZORDER) + SetWindowPos( HWindow():aWindows[ 2 ]:handle, Nil, oWnd:aOffset[ 1 ], oWnd:aOffset[ 2 ], aCoors[ 3 ] - oWnd:aOffset[ 1 ] - oWnd:aOffset[ 3 ], aCoors[ 4 ] - oWnd:aOffset[ 2 ] - oWnd:aOffset[ 4 ] , SWP_NOZORDER + SWP_NOACTIVATE ) aCoors := GetWindowRect( HWindow():aWindows[ 2 ]:handle ) HWindow():aWindows[ 2 ]:nWidth := aCoors[ 3 ] - aCoors[ 1 ] HWindow():aWindows[ 2 ]:nHeight := aCoors[ 4 ] - aCoors[ 2 ] @@ -45,12 +45,13 @@ IF !Empty( oWnd:Screen ) oWnd:Screen:nWidth := aCoors[ 3 ] - aCoors[ 1 ] oWnd:Screen:nHeight := aCoors[ 4 ] - aCoors[ 2 ] - InvalidateRect( oWnd:screen:handle, 0 ) - SetWindowPos( oWnd:screen:handle, Nil, 0, 0, oWnd:Screen:nWidth, oWnd:Screen:nHeight, SWP_NOACTIVATE + SWP_NOZORDER) + //InvalidateRect( oWnd:Screen:handle, 1 ) // flick in screen in resize window + SetWindowPos( oWnd:screen:handle, Nil, 0, 0, oWnd:Screen:nWidth, oWnd:Screen:nHeight, SWP_NOACTIVATE + SWP_NOSENDCHANGING + SWP_NOZORDER ) + InvalidateRect( oWnd:Screen:handle, 1 ) ENDIF - IF ! SELFFOCUS( oWnd:Screen:Handle, oWnd:handle ) .AND. ! Empty( oWnd := oWnd:GetMdiActive() ) .AND.oWnd:Type = WND_MDICHILD .AND. oWnd:lmaximized .AND.; - ( oWnd:lModal .OR. oWnd:lChild ) - oWnd:lmaximized := .F. + IF ! Empty( oWnd := oWnd:GetMdiActive() ) .AND.oWnd:type = WND_MDICHILD .AND. oWnd:lMaximized .AND.; + ( oWnd:lModal .OR. oWnd:lChild ) + oWnd:lMaximized := .F. *-SENDMESSAGE( oWnd:handle, WM_SYSCOMMAND, SC_MAXIMIZE, 0 ) ENDIF // @@ -315,8 +316,8 @@ // ADDED screen to backgroup to MDI MAIN ::Screen := HMdiChildWindow():New(, ::tcolor, WS_CHILD + MB_USERICON + WS_MAXIMIZE + WS_DISABLED,; - 0, 0, ::nWidth * 1, ::nheight * 1, ; //- GETSYSTEMMETRICS( SM_CYSMCAPTION ) - GETSYSTEMMETRICS( SM_CYSMCAPTION ) , ; - -1 ,,,,,,,,,,,::oBmp,,,,,, .T.) + 0, 0, ::nWidth * 1, ::nheight * 1 - GETSYSTEMMETRICS( SM_CYSMCAPTION ) - GETSYSTEMMETRICS( SM_CYSMCAPTION ) , ; + -1 ,,,,,,,,,,,::oBmp,,,,,, ) ::Screen:lExitOnEsc := .F. //::Screen:lClipper := .F. ::Screen:Activate( .T., .T. ) @@ -334,33 +335,29 @@ RETURN Nil ENDIF ENDIF - - ::Screen:lBmpCenter := ::lBmpCenter - *-EnableWindow( ::Screen:Handle, .T. ) - ::Screen:Maximize() - SetWindowPos( ::Screen:Handle, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOREDRAW + SWP_NOACTIVATE + SWP_NOMOVE + SWP_NOSIZE + SWP_NOZORDER +; + IF ::Screen != Nil + ::Screen:lBmpCenter := ::lBmpCenter + ::Screen:Maximize() + SetWindowPos( ::Screen:Handle, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOREDRAW + SWP_NOACTIVATE + SWP_NOMOVE + SWP_NOSIZE + SWP_NOZORDER +; SWP_NOOWNERZORDER + SWP_FRAMECHANGED ) - ::Screen:Restore() + ::Screen:Restore() + ENDIF IF lMaximized ::maximize() ELSEIF lMinimized ::minimize() ELSEIF lCentered ::center() - ELSE - ENDIF IF ( bActivate != NIL ) Eval( bActivate, Self ) ENDIF - + AddToolTip( ::handle, ::handle, "" ) Hwg_ActivateMdiWindow( ( lShow == Nil .OR. lShow ), ::hAccel, lMaximized, lMinimized ) ELSEIF ::Type == WND_MAIN - InitControls( Self ) - IF ::bInit != Nil lres := Eval( ::bInit, Self ) IF ValType( lres ) = "L" .AND. ! lres @@ -569,10 +566,6 @@ ENDIF */ - IF bActivate != NIL - Eval( bActivate, Self ) - ENDIF - IF ( ValType( ::nInitFocus ) = "O" .OR. ::nInitFocus > 0 ) ::nInitFocus := IIf( ValType( ::nInitFocus ) = "O", ::nInitFocus:Handle, ::nInitFocus ) SETFOCUS( ::nInitFocus ) @@ -580,12 +573,17 @@ ELSEIF PtrtoUlong( GETFOCUS() ) = PtrtoUlong( ::handle ) .AND. Len( ::acontrols ) > 0 ::nFocus := ASCAN( ::aControls,{|o| Hwg_BitaND( HWG_GETWINDOWSTYLE( o:handle ), WS_TABSTOP ) != 0 .AND. ; Hwg_BitaND( HWG_GETWINDOWSTYLE( o:handle ), WS_DISABLED ) = 0 } ) - IF ::nFocus > 0 + IF ::nFocus > 0 SETFOCUS( ::acontrols[ ::nFocus ]:handle ) ::nFocus := GetFocus() //get::acontrols[1]:handle ENDIF ENDIF + + IF bActivate != NIL + Eval( bActivate, Self ) + ENDIF + RETURN Nil METHOD onEvent( msg, wParam, lParam ) CLASS HMDIChildWindow @@ -898,7 +896,7 @@ FillRect( wParam, aCoors[ 1 ], aCoors[ 2 ], aCoors[ 3 ] + 1, aCoors[ 4 ] + 1, oWnd:brush:handle ) IF !Empty( oWnd:Screen ) .AND. SELFFOCUS( oWnd:handle, oWnd:Screen:Handle ) SetWindowPos( oWnd:Handle, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOACTIVATE + SWP_NOMOVE + SWP_NOSIZE + SWP_NOZORDER +; - SWP_NOOWNERZORDER + SWP_FRAMECHANGED) + SWP_NOOWNERZORDER ) ENDIF RETURN 1 ENDIF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lf...@us...> - 2012-08-27 14:06:45
|
Revision: 1865 http://hwgui.svn.sourceforge.net/hwgui/?rev=1865&view=rev Author: lfbasso Date: 2012-08-27 14:06:34 +0000 (Mon, 27 Aug 2012) Log Message: ----------- 2012-08-27 10:50 UTC-0300 Luis Fernando Basso <lfbasso at via-rs.net> * source/hcontrol.prg + DATA lnoWhen INIT .F. necessary to avoid recursion WHEN the event without losing focus of the object * CLASS HStatic * METHOD NEW() * METHOD PAINT() ! fixed style DISABLED * CLASS HStatus * METHOD StatusHeight( nHeight ) ! fixed! * CLASS HBUTTONEx * METHOD onEvent ! add event bOther Modified Paths: -------------- trunk/hwgui/Changelog trunk/hwgui/source/hcontrol.prg Modified: trunk/hwgui/Changelog =================================================================== --- trunk/hwgui/Changelog 2012-08-27 13:14:25 UTC (rev 1864) +++ trunk/hwgui/Changelog 2012-08-27 14:06:34 UTC (rev 1865) @@ -8,6 +8,22 @@ 2002-12-01 23:12 UTC+0100 Foo Bar <fo...@fo...> */ + +2012-08-27 10:50 UTC-0300 Luis Fernando Basso <lfbasso at via-rs.net> + * source/hcontrol.prg + + DATA lnoWhen INIT .F. + necessary to avoid recursion WHEN the event without losing focus of the object + * CLASS HStatic + * METHOD NEW() + * METHOD PAINT() + ! fixed style DISABLED + * CLASS HStatus + * METHOD StatusHeight( nHeight ) + ! fixed! + * CLASS HBUTTONEx + * METHOD onEvent + ! add event bOther + 2012-08-27 09:50 UTC-0300 Luis Fernando Basso <lfbasso at via-rs.net> * source/hbrowse.prg * CLASS HBrowse @@ -21,6 +37,9 @@ * METHOD PAINT() * METHOD LineOut() * METHOD SetColumn() + * METHOD RefreshLine() + * METHOD When() + * METHOD Valid() * FUNCTION LINELEFT() * FUNCTION LINERIGHT() ! code need for new features Modified: trunk/hwgui/source/hcontrol.prg =================================================================== --- trunk/hwgui/source/hcontrol.prg 2012-08-27 13:14:25 UTC (rev 1864) +++ trunk/hwgui/source/hcontrol.prg 2012-08-27 14:06:34 UTC (rev 1865) @@ -47,6 +47,7 @@ DATA tooltip DATA lInit INIT .F. DATA lnoValid INIT .F. + DATA lnoWhen INIT .F. DATA nGetSkip INIT 0 DATA Anchor INIT 0 DATA BackStyle INIT OPAQUE @@ -373,8 +374,8 @@ METHOD onAnchor( x, y, w, h ) CLASS HControl LOCAL nAnchor, nXincRelative, nYincRelative, nXincAbsolute, nYincAbsolute LOCAL x1, y1, w1, h1, x9, y9, w9, h9 - LOCAL nCxv := IIF( HWG_BITAND( ::style, WS_VSCROLL ) != 0, GetSystemMetrics( SM_CXVSCROLL ) + 3 , 3 ) - LOCAL nCyh := IIF( HWG_BITAND( ::style, WS_HSCROLL ) != 0, GetSystemMetrics( SM_CYHSCROLL ) + 3 , 3 ) + LOCAL nCxv := IIF( HWG_BITAND( ::style, WS_VSCROLL ) != 0, GetSystemMetrics( SM_CXVSCROLL ) + 1 , 3 ) + LOCAL nCyh := IIF( HWG_BITAND( ::style, WS_HSCROLL ) != 0, GetSystemMetrics( SM_CYHSCROLL ) + 1 , 3 ) nAnchor := ::anchor @@ -401,38 +402,38 @@ IF nAnchor >= ANCHOR_VERTFIX *- vertical fixed center nAnchor := nAnchor - ANCHOR_VERTFIX - y1 := y9 + Round( ( h - y ) * ( ( y9 + h9 / 2 ) / y ), 0 ) + y1 := y9 + Round( ( h - y ) * ( ( y9 + h9 / 2 ) / y ), 2 ) ENDIF IF nAnchor >= ANCHOR_HORFIX *- horizontal fixed center nAnchor := nAnchor - ANCHOR_HORFIX - x1 := x9 + Round( ( w - x ) * ( ( x9 + w9 / 2 ) / x ), 0 ) + x1 := x9 + Round( ( w - x ) * ( ( x9 + w9 / 2 ) / x ), 2 ) ENDIF IF nAnchor >= ANCHOR_RIGHTREL && relative - RIGHT RELATIVE nAnchor := nAnchor - ANCHOR_RIGHTREL - x1 := w - Round( ( x - x9 - w9 ) * nXincRelative, 0 ) - w9 + x1 := w - Round( ( x - x9 - w9 ) * nXincRelative, 2 ) - w9 ENDIF IF nAnchor >= ANCHOR_BOTTOMREL && relative - BOTTOM RELATIVE nAnchor := nAnchor - ANCHOR_BOTTOMREL - y1 := h - Round( ( y - y9 - h9 ) * nYincRelative, 0 ) - h9 + y1 := h - Round( ( y - y9 - h9 ) * nYincRelative, 2 ) - h9 ENDIF IF nAnchor >= ANCHOR_LEFTREL && relative - LEFT RELATIVE nAnchor := nAnchor - ANCHOR_LEFTREL IF x1 != x9 - w1 := x1 - ( Round( x9 * nXincRelative, 0 ) ) + w9 + w1 := x1 - ( Round( x9 * nXincRelative, 2 ) ) + w9 ENDIF - x1 := Round( x9 * nXincRelative, 0 ) + x1 := Round( x9 * nXincRelative, 2 ) ENDIF IF nAnchor >= ANCHOR_TOPREL && relative - TOP RELATIVE nAnchor := nAnchor - ANCHOR_TOPREL IF y1 != y9 - h1 := y1 - ( Round( y9 * nYincRelative, 0 ) ) + h9 + h1 := y1 - ( Round( y9 * nYincRelative, 2 ) ) + h9 ENDIF - y1 := Round( y9 * nYincRelative, 0 ) + y1 := Round( y9 * nYincRelative, 2 ) ENDIF IF nAnchor >= ANCHOR_RIGHTABS && Absolute - RIGHT ABSOLUTE @@ -477,54 +478,53 @@ // REDRAW AND INVALIDATE SCREEN IF ( x1 != X9 .OR. y1 != y9 .OR. w1 != w9 .OR. h1 != h9 ) IF isWindowVisible( ::handle ) - IF HWG_BITAND( ::Style, WS_CLIPCHILDREN ) = 0 .AND. ( w1 > w9 .OR. h1 > H9 ) - IF ( x1 != x9 .or. y1 != y9 ) .AND. x9 < ::oParent:nWidth + IF ( x1 != x9 .or. y1 != y9 ) .AND. x9 < ::oParent:nWidth InvalidateRect( ::oParent:handle, 1, MAX( x9 - 1, 0 ), MAX( y9 - 1, 0 ), ; x9 + w9 + nCxv, y9 + h9 + nCyh ) - ELSE + ELSE IF w1 < w9 - InvalidateRect( ::oParent:handle, 1, x1 + w1 - nCxv, MAX( y1 - 2, 0 ), ; - x1 + w9 + 2 , y9 + h9 + 2 ) + InvalidateRect( ::oParent:handle, 1, x1 + w1 - nCxv - 1, MAX( y1 - 2, 0 ), ; + x1 + w9 + 2 , y9 + h9 + nCxv + 1) + ENDIF IF h1 < h9 - InvalidateRect( ::oParent:handle, 0, MAX( x1 - 5, 0 ) , y1 + h1 - nCyh, ; - x1 + w9 + 2 , y1 + h9 + 2 ) + InvalidateRect( ::oParent:handle, 1, MAX( x1 - 5, 0 ) , y1 + h1 - nCyh - 1, ; + x1 + w9 + 2 , y1 + h9 + nCYh ) ENDIF - ENDIF + ENDIF +* ::Move( x1, y1, w1, h1, HWG_BITAND( ::Style, WS_CLIPSIBLINGS + WS_CLIPCHILDREN ) = 0 ) - ::Move( x1, y1, w1, h1, 0 ) //HWG_BITAND( ::Style, WS_CLIPCHILDREN ) ) - - IF ( ( x1 != x9 .OR. y1 != y9 ) .AND. ( ISBLOCK( ::bPaint ) .OR. ; + IF ( ( x1 != x9 .OR. y1 != y9 ) .AND. ( ISBLOCK( ::bPaint ) .OR. ; x9 + w9 > ::oParent:nWidth ) ) .OR. ( ::backstyle = TRANSPARENT .AND. ; ( ::Title != Nil .AND. ! Empty( ::Title ) ) ) .OR. __ObjHasMsg( Self,"oImage" ) IF __ObjHasMsg( Self, "oImage" ) .OR. ::backstyle = TRANSPARENT //.OR. w9 != w1 - InvalidateRect( ::oParent:handle, 0, MAX( x1 - 1, 0 ), MAX( y1 - 1, 0 ), x1 + w1 + 1 , y1 + h1 + 1 ) + InvalidateRect( ::oParent:handle, 1, MAX( x1 - 1, 0 ), MAX( y1 - 1, 0 ), x1 + w1 + 1 , y1 + h1 + 1 ) ELSE RedrawWindow( ::handle, RDW_NOERASE + RDW_INVALIDATE + RDW_INTERNALPAINT ) ENDIF - ELSE + ELSE IF LEN( ::aControls ) = 0 .AND. ::Title != Nil InvalidateRect( ::handle, 0 ) ENDIF IF w1 > w9 - InvalidateRect( ::oParent:handle, 0 , MAX( x1 + w9 - ( w1 - w9 + nCxv ), 0 ) ,; - MAX( y1 , 0 ) , x1 + w1 + 1 , y1 + h1 ) + InvalidateRect( ::oParent:handle, 1 , MAX( x1 + w9 - nCxv - 1, 0 ) ,; + MAX( y1 , 0 ) , x1 + w1 + nCxv , y1 + h1 + 2 ) ENDIF IF h1 > h9 - InvalidateRect( ::oParent:handle, 1 , MAX( x1 , 0) , ; - MAX( y1 + h9 - ( h1 - h9 + nCyh ), 0 ) , x1 + w1 + 1 , y1 + h1 ) + InvalidateRect( ::oParent:handle, 1 , MAX( x1 , 0 ) , ; + MAX( y1 + h9 - nCyh - 1 , 1 ) , x1 + w1 + 2 , y1 + h1 + nCyh ) ENDIF - ENDIF - ELSE - ::Move( x1, y1, w1, h1, 1 ) ENDIF + // redefine new position e new size + ::Move( x1, y1, w1, h1, HWG_BITAND( ::Style, WS_CLIPSIBLINGS + WS_CLIPCHILDREN ) = 0 ) + IF ( ::winClass == "ToolbarWindow32" .OR. ::winClass == "msctls_statusbar32" ) - ::Resize( nXincRelative, 1 ) + ::Resize( nXincRelative, w1 != w9, h1 != h9 ) ENDIF ELSE ::Move( x1, y1, w1, h1, 0 ) IF ( ::winClass == "ToolbarWindow32" .OR. ::winClass == "msctls_statusbar32" ) - ::Resize( nXincRelative, 1 ) + ::Resize( nXincRelative, w1 != w9, h1 != h9 ) ENDIF ENDIF ENDIF @@ -538,11 +538,11 @@ CLASS VAR winclass INIT "msctls_statusbar32" DATA aParts - DATA nStatusHeight + DATA nStatusHeight INIT 0 DATA bDblClick DATA bRClick - METHOD New( oWndParent, nId, nStyle, oFont, aParts, bInit, bSize, bPaint, bRClick, bDblClick ) + METHOD New( oWndParent, nId, nStyle, oFont, aParts, bInit, bSize, bPaint, bRClick, bDblClick, nHeight ) METHOD Activate() METHOD Init() METHOD Notify( lParam ) @@ -556,16 +556,16 @@ ENDCLASS -METHOD New( oWndParent, nId, nStyle, oFont, aParts, bInit, bSize, bPaint, bRClick, bDblClick ) CLASS HStatus +METHOD New( oWndParent, nId, nStyle, oFont, aParts, bInit, bSize, bPaint, bRClick, bDblClick, nHeight ) CLASS HStatus - bSize := IIf( bSize != NIL, bSize, { | o, x, y | o:Move( 0, y - 20, x, 20 ) } ) + bSize := IIf( bSize != NIL, bSize, { | o, x, y | o:Move( 0, y - ::nStatusHeight, x, ::nStatusHeight ) } ) nStyle := Hwg_BitOr( IIf( nStyle == NIL, 0, nStyle ), ; - WS_CHILD + WS_VISIBLE + WS_OVERLAPPED + ; - WS_CLIPSIBLINGS ) + WS_CHILD + WS_VISIBLE + WS_OVERLAPPED + WS_CLIPSIBLINGS ) Super:New( oWndParent, nId, nStyle, 0, 0, 0, 0, oFont, bInit, ; bSize, bPaint ) //::nHeight := nHeight + ::nStatusHeight := IIF( nHeight = Nil, ::nStatusHeight, nHeight ) ::aParts := aParts ::bDblClick := bDblClick ::bRClick := bRClick @@ -579,11 +579,14 @@ IF ! Empty( ::oParent:handle ) ::handle := CreateStatusWindow( ::oParent:handle, ::id ) + ::StatusHeight( ::nStatusHeight ) ::Init() + /* IF __ObjHasMsg( ::oParent, "AOFFSET" ) aCoors := GetWindowRect( ::handle ) ::oParent:aOffset[ 4 ] := aCoors[ 4 ] - aCoors[ 2 ] ENDIF + */ ENDIF RETURN NIL @@ -635,16 +638,25 @@ RETURN Nil -METHOD StatusHeight( nHeight ) CLASS HStatus +METHOD StatusHeight( nHeight ) CLASS HStatus + LOCAL aCoors - IF nHeight != Nil .AND. nHeight > 0 + IF nHeight != Nil + aCoors := GetWindowRect( ::handle ) IF nHeight != 0 - SendMessage( ::handle,; // (HWND) handle to destination control - SB_SETMINHEIGHT, nHeight, 0 ) // (UINT) message ID // = (WPARAM)(int) minHeight; 0L; not used, must be zero - ::nStatusHeight := nHeight - RedrawWindow( ::handle, RDW_NOERASE + RDW_INVALIDATE + RDW_FRAME ) + IF ::lInit .AND. __ObjHasMsg( ::oParent, "AOFFSET" ) + ::oParent:aOffset[ 4 ] -= ( aCoors[ 4 ] - aCoors[ 2 ] ) + ENDIF + SendMessage( ::handle,; // (HWND) handle to destination control + SB_SETMINHEIGHT, nHeight, 0 ) // (UINT) message ID // = (WPARAM)(int) minHeight; + SendMessage( ::handle, WM_SIZE, 0, 0 ) + aCoors := GetWindowRect( ::handle ) ENDIF - ENDIF + ::nStatusHeight := ( aCoors[ 4 ] - aCoors[ 2 ] ) - 1 + IF __ObjHasMsg( ::oParent, "AOFFSET" ) + ::oParent:aOffset[ 4 ] += ( aCoors[ 4 ] - aCoors[ 2 ] ) + ENDIF + ENDIF RETURN ::nStatusHeight METHOD GetTextPanel( nPart ) CLASS HStatus @@ -728,19 +740,19 @@ cCaption, oFont, bInit, bSize, bPaint, cTooltip, tcolor, ; bColor, lTransp, bClick, bDblClick, bOther ) CLASS HStatic - Local nBorder + Local nStyles // Enabling style for tooltips //IF ValType( cTooltip ) == "C" // IF nStyle == NIL // nStyle := SS_NOTIFY // ELSE - nBorder := IIF( Hwg_BitAND( nStyle, WS_BORDER ) != 0, WS_BORDER, 0 ) - nBorder += IIF( Hwg_BitAND( nStyle, WS_DLGFRAME ) != 0, WS_DLGFRAME, 0 ) - nStyle := Hwg_BitOr( nStyle, SS_NOTIFY ) - nBorder + nStyles := IIF(Hwg_BitAND( nStyle, WS_BORDER ) != 0, WS_BORDER, 0 ) + nStyles += IIF(Hwg_BitAND( nStyle, WS_DLGFRAME ) != 0, WS_DLGFRAME , 0 ) + nStyles += IIF(Hwg_BitAND( nStyle, WS_DISABLED ) != 0, WS_DISABLED , 0 ) + nStyle := Hwg_BitOr( nStyle, SS_NOTIFY ) - nStyles // ENDIF // ENDIF // - ::nStyleHS := IIf( nStyle == Nil, 0, nStyle ) ::BackStyle := OPAQUE IF ( lTransp != NIL .AND. lTransp ) //.OR. ::lOwnerDraw @@ -754,7 +766,7 @@ ENDIF ::hBrushDefault := HBrush():Add( GetSysColor( COLOR_BTNFACE ) ) - Super:New( oWndParent, nId, nStyle + nBorder, nLeft, nTop, nWidth, nHeight, oFont, ; + Super:New( oWndParent, nId, nStyle + nStyles, nLeft, nTop, nWidth, nHeight, oFont, ; bInit, bSize, bPaint, cTooltip, tcolor, bColor ) IF ::oParent:oParent != Nil @@ -899,15 +911,16 @@ IF ::BackStyle = OPAQUE brBackground := IIF( ! EMPTY( ::brush ), ::brush, ::hBrushDefault ) FillRect( dc, client_rect[ 1 ], client_rect[ 2 ], client_rect[ 3 ], client_rect[ 4 ], brBackground:handle ) - ELSE - SelectObject( DC, GetStockObject( NULL_BRUSH )) - ENDIF - - IF ! ::isEnabled() - SetTextColor( dc, GetSysColor( COLOR_GRAYTEXT ) ) - ELSEIF ::tcolor != NIL .AND. ::isEnabled() - SetTextColor( dc, ::tcolor ) ENDIF + + IF ::tcolor != NIL .AND. ::isEnabled() + SetTextColor( dc, ::tcolor ) + ELSEIF ! ::isEnabled() + SetTextColor( dc, 16777215 ) //GetSysColor( COLOR_WINDOW ) ) + DrawText( dc, szText, { client_rect[ 1 ] + 1, client_rect[ 2 ] + 1, client_rect[ 3 ] + 1, client_rect[ 4 ] + 1 }, dwtext ) + SetBkMode( dc, TRANSPARENT ) + SetTextColor( dc, 10526880 ) //GetSysColor( COLOR_GRAYTEXT ) ) + ENDIF // Draw the text DrawText( dc, szText, client_rect, dwtext ) @@ -1380,8 +1393,9 @@ METHOD onEvent( msg, wParam, lParam ) CLASS HBUTTONEx LOCAL pt := {, }, rectButton, acoor - LOCAL pos, nID, oParent + LOCAL pos, nID, oParent, nEval + IF msg == WM_THEMECHANGED IF ::Themed IF ValType( ::hTheme ) == "P" @@ -1420,9 +1434,16 @@ ELSEIF msg == WM_MOUSELEAVE ::CancelHover() RETURN 0 + ENDIF + + IF ::bOther != Nil + IF ( nEval := Eval( ::bOther, Self, msg, wParam, lParam )) != -1 .AND. nEval != Nil + RETURN 0 + ENDIF + ENDIF + + IF msg == WM_KEYDOWN - ELSEIF msg == WM_KEYDOWN - #ifdef __XHARBOUR__ IF hb_BitIsSet( PtrtoUlong( lParam ), 30 ) // the key was down before ? #else @@ -2002,7 +2023,7 @@ ENDIF // Draw the focus rect - IF bIsFocused .and. bDrawFocusRect + IF bIsFocused .and. bDrawFocusRect .AND. Hwg_BitaND( ::sTyle, WS_TABSTOP ) != 0 focusRect := COPYRECT( itemRect ) InflateRect( @focusRect, - 3, - 3 ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lf...@us...> - 2012-08-27 13:14:36
|
Revision: 1864 http://hwgui.svn.sourceforge.net/hwgui/?rev=1864&view=rev Author: lfbasso Date: 2012-08-27 13:14:25 +0000 (Mon, 27 Aug 2012) Log Message: ----------- 2012-08-27 09:50 UTC-0300 Luis Fernando Basso <lfbasso at via-rs.net> * source/hbrowse.prg * CLASS HBrowse + DATA Highlight INIT .F. // only editable is Highlight. (Default) + DATA HighlightStyle INIT 1 // 0 No color highlighting for grid row // 1 Enable highlighting for current row. (Default) // 2 nopersist highlighting // 3 nopersist when grid is not the current active control. * METHOD onEvent ! msg == WM_MOUSEWHEEL remove RETURN 0 because bother would not be executed * METHOD PAINT() * METHOD LineOut() * METHOD SetColumn() * FUNCTION LINELEFT() * FUNCTION LINERIGHT() ! code need for new features * METHOD EDIT() ! add DS_CONTROL in style DIALOG * source/hdialog.prg + DATA lContainer INIT .F. ! when the dialog has the style DS_CONTROL the active window does not lose the style of activated * FUNCTION onActivate ! code needed for the style DS_CONTROL Modified Paths: -------------- trunk/hwgui/Changelog trunk/hwgui/source/hbrowse.prg trunk/hwgui/source/hdialog.prg Modified: trunk/hwgui/Changelog =================================================================== --- trunk/hwgui/Changelog 2012-08-08 12:01:48 UTC (rev 1863) +++ trunk/hwgui/Changelog 2012-08-27 13:14:25 UTC (rev 1864) @@ -8,19 +8,43 @@ 2002-12-01 23:12 UTC+0100 Foo Bar <fo...@fo...> */ +2012-08-27 09:50 UTC-0300 Luis Fernando Basso <lfbasso at via-rs.net> + * source/hbrowse.prg + * CLASS HBrowse + + DATA Highlight INIT .F. // only editable is Highlight. (Default) + + DATA HighlightStyle INIT 1 // 0 No color highlighting for grid row + // 1 Enable highlighting for current row. (Default) + // 2 nopersist highlighting + // 3 nopersist when grid is not the current active control. + * METHOD onEvent + ! msg == WM_MOUSEWHEEL remove RETURN 0 because bother would not be executed + * METHOD PAINT() + * METHOD LineOut() + * METHOD SetColumn() + * FUNCTION LINELEFT() + * FUNCTION LINERIGHT() + ! code need for new features + * METHOD EDIT() + ! add DS_CONTROL in style DIALOG + * source/hdialog.prg + + DATA lContainer INIT .F. + ! when the dialog has the style DS_CONTROL the active window does not lose the style of activated + * FUNCTION onActivate + ! code needed for the style DS_CONTROL + 2012-08-08 09:30 UTC-0300 Luis Fernando Basso <lfbasso at via-rs.net> * source/hbrowse.prg - * METHOS onEvent + * METHOD onEvent ! minor fix in WM_KEYDOWN and WM_CHAR 2012-08-06 12:30 UTC-0300 Luis Fernando Basso <lfbasso at via-rs.net> * source/hbrowse.prg - * METHOS onEvent + * METHOD onEvent ! fixed VK_RETURN in WM_KEYDOWN 2012-08-03 12:30 UTC-0300 Luis Fernando Basso <lfbasso at via-rs.net> * source/hbrowse.prg - * METHOS INIT + * METHOD INIT - VScrollPos( Self, 0, .F. ) ( comment , no necessary ) 2012-07-09 12:30 UTC-0300 Luis Fernando Basso <lfbasso at via-rs.net> Modified: trunk/hwgui/source/hbrowse.prg =================================================================== --- trunk/hwgui/source/hbrowse.prg 2012-08-08 12:01:48 UTC (rev 1863) +++ trunk/hwgui/source/hbrowse.prg 2012-08-27 13:14:25 UTC (rev 1864) @@ -300,6 +300,11 @@ DATA lDisableVScrollPos INIT .F. DATA oTimer HIDDEN DATA nSetRefresh INIT 0 HIDDEN + DATA Highlight INIT .F. // only editable is Highlight + DATA HighlightStyle INIT 1 // 0 No color highlighting for grid row + // 1 Enable highlighting for current row. (Default) + // 2 nopersit highlighting //for current row and current cell + // 3 nopersist when grid is not the current active control. METHOD New( lType,oWndParent,nId,nStyle,nLeft,nTop,nWidth,nHeight,oFont, ; bInit,bSize,bPaint,bEnter,bGfocus,bLfocus,lNoVScroll,; @@ -514,7 +519,7 @@ IIF( HIWORD( wParam ) > 32768, ; HIWORD( wParam ) - 65535, HIWORD( wParam ) ), ; LOWORD( lParam ), HIWORD( lParam ) ) - RETURN 0 + //RETURN 0 because bother is not run ENDIF // IF ::bOther != Nil @@ -522,7 +527,7 @@ nRet := IIF( VALTYPE( nRet ) = "L" .AND. ! nRet, 0, -1 ) ENDIF IF nRet >= 0 - RETURN -1 + RETURN -1 ENDIF ENDIF IF msg == WM_THEMECHANGED @@ -1589,7 +1594,7 @@ // Highlights the selected ROW // we can have a modality with CELL selection only or ROW selection - IF ! ::lHeadClick .AND. ! ::lEditable // .AND. ! ::lResizing + IF !::lHeadClick .AND. ( ! ::lEditable .OR. ( ::lEditable .AND. ::Highlight ) ) // .AND.! ::lResizing ::LineOut( ::rowPos, 0, hDC, ! ::lResizing ) ENDIF // Highligths the selected cell @@ -1597,7 +1602,7 @@ // to move the "cursor cell" if lEditable is FALSE // Actually: if lEditable is FALSE we can only have LINE selection // if ::lEditable - IF lLostFocus == NIL .AND. !::lHeadClick .AND. ::lEditable // .AND. !::lResizing + IF lLostFocus == NIL .AND. ! ::lHeadClick .AND. ( ::lEditable .OR. ::Highlight ) //.AND. !::lResizing ::LineOut( ::rowPos, ::colpos, hDC, ! ::lResizing ) ENDIF // endif @@ -2111,13 +2116,11 @@ //-------------- -Row-- --Col-- ------------------------------// METHOD LineOut( nRow, nCol, hDC, lSelected, lClear ) CLASS HBrowse LOCAL x, nColumn, sviv, xSize, lFixed := .F., xSizeMax - LOCAL j, ob, bw, bh, y1, hBReal + LOCAL j, ob, bw, bh, y1, hBReal, oPen LOCAL oldBkColor, oldTColor, oldBk1Color, oldT1Color - LOCAL oLineBrush := IIf( nCol >= 1, HBrush():Add( ::htbColor ), IIf( lSelected, ::brushSel, ::brush ) ) LOCAL lColumnFont := .F. LOCAL rcBitmap, ncheck, nstate, nCheckHeight - -//Local nPaintCol, nPaintRow + LOCAL oLineBrush := IIf( nCol >= 1, HBrush():Add( ::htbColor ), IIf( lSelected, ::brushSel, ::brush ) ) LOCAL aCores nColumn := 1 @@ -2153,9 +2156,28 @@ ::x1 - ::nDeleteMark - 1 , ::y1 + ( ::height + 1 ) * ::nPaintRow - 0 ) //, IIF( Deleted(), GetStockObject( 7 ), ::brush:handle )) ENDIF IF lSelected - DrawTransparentBitmap( hDC, ::oBmpMark:Handle, ::x1 - ::nShowMark - ::nDeleteMark + 1,; +* msginfo(str(::HighlightStyle)) + DrawTransparentBitmap( hDC, ::oBmpMark:Handle, ::x1 - ::nShowMark - ::nDeleteMark + 1,; ( ::y1 + ( ::height + 1 ) * ( ::nPaintRow - 1 ) ) + ; ( ( ::y1 + ( ::height + 1 ) * ( ::nPaintRow ) ) - ( ::y1 + ( ::height + 1 ) * ( ::nPaintRow - 1 ) ) ) / 2 - 6 ) + IF ::HighlightStyle = 2 .OR. ( ( ::HighlightStyle = 0 .AND. SelfFocus( ::Handle ) ) .OR. ; + ( ::HighlightStyle = 3 .AND. ( ! SelfFocus( ::Handle ) .or. ::lEditable ) ) ) + IF ! ::lEditable .OR. ::HighlightStyle = 3 + oPen := HPen():Add( 0, 1, ::bcolorSel ) + SelectObject( hDC, GetStockObject( NULL_BRUSH ) ) + SelectObject( hDC, oPen:handle ) + RoundRect( hDC, ::x1, ; + ::y1 + ( ::height + 1 ) * ( ::nPaintRow - 1 ) + 1 , ; + ::x2 - 1 ,; + ::y1 + ( ::height + 1 ) * ::nPaintRow , 0, 0 ) + DeleteObject( oPen ) + IF ( ! ::lEditable .AND. nCol = 0 ) .OR. ( ::HighlightStyle = 3 .AND. ! SelfFocus( ::Handle ) ) + RETURN NIL + ENDIF + ENDIF + ELSEIF ::HighlightStyle = 0 //.OR. ::HighlightStyle = 3 + RETURN NIL + ENDIF ENDIF ENDIF ::nVisibleColLeft := ::nPaintCol @@ -2334,8 +2356,9 @@ //----------------------------------------------------// METHOD SetColumn( nCol ) CLASS HBrowse LOCAL nColPos, lPaint := .f. + LOCAL lEditable := ::lEditable .OR. ::Highlight - IF ::lEditable .OR. ::lAutoEdit + IF lEditable .OR. ::lAutoEdit IF nCol != nil .AND. nCol >= 1 .AND. nCol <= Len( ::aColumns ) IF nCol <= ::freeze ::colpos := nCol @@ -2368,8 +2391,9 @@ //----------------------------------------------------// STATIC FUNCTION LINERIGHT( oBrw ) LOCAL i - - IF oBrw:lEditable .OR. oBrw:lAutoEdit + LOCAL lEditable := oBrw:lEditable .OR. oBrw:Highlight + + IF lEditable .OR. oBrw:lAutoEdit IF oBrw:colpos < oBrw:nColumns oBrw:colpos ++ RETURN Nil @@ -2388,13 +2412,14 @@ //----------------------------------------------------// // Move the visible browse one step to the left STATIC FUNCTION LINELEFT( oBrw ) + LOCAL lEditable := oBrw:lEditable .OR. oBrw:Highlight - IF oBrw:lEditable .OR. oBrw:lAutoEdit + IF lEditable .OR. oBrw:lAutoEdit oBrw:colpos -- ENDIF - IF oBrw:nLeftCol > oBrw:freeze + 1 .AND. ( ! oBrw:lEditable .OR. oBrw:colpos < oBrw:freeze + 1 ) + IF oBrw:nLeftCol > oBrw:freeze + 1 .AND. ( ! lEditable .OR. oBrw:colpos < oBrw:freeze + 1 ) oBrw:nLeftCol -- - IF ! oBrw:lEditable .OR. oBrw:colpos < oBrw:freeze + 1 + IF ! lEditable .OR. oBrw:colpos < oBrw:freeze + 1 oBrw:colpos := oBrw:freeze + 1 ENDIF ENDIF @@ -2702,6 +2727,7 @@ LOCAL STEP, res LOCAL xm, x1, fif LOCAL aColumns := {}, nCols := 1, xSize := 0 + LOCAL lEditable := ::lEditable .OR. ::Highlight // Calculate the line you clicked on, keeping track of header IF( ::lDispHead ) @@ -2782,7 +2808,7 @@ ENDIF */ ENDIF - IF ::lEditable .OR. ::lAutoEdit + IF lEditable .OR. ::lAutoEdit IF ::colpos != fif - ::nLeftCol + 1 + ::freeze // Colpos should not go beyond last column or I get bound errors on ::Edit() @@ -3154,7 +3180,7 @@ IF Type <> "M" INIT DIALOG oModDlg ; - STYLE WS_POPUP + 1 + IIf( oColumn:aList == Nil, WS_BORDER, 0 ) ; + STYLE WS_POPUP + 1 + IIf( oColumn:aList == Nil, WS_BORDER, 0 ) + DS_CONTROL ; At x1, y1 - IIf( oColumn:aList == Nil, 1, 0 ) ; SIZE nWidth - 1, ::height + IIf( oColumn:aList == Nil, 1, 0 ) ; ON INIT bInit ; @@ -3163,7 +3189,7 @@ INIT DIALOG oModDlg title "memo edit" At 0, 0 SIZE 400, 300 ON INIT { | o | o:center() } ENDIF - IF oColumn:aList != Nil .AND. ( oColumn:bWhen = Nil .OR. Eval( oColumn:bWhen ) ) + IF oColumn:aList != Nil .AND. ( oColumn:bWhen = Nil .OR. Eval( oColumn:bWhen ) ) oModDlg:brush := - 1 oModDlg:nHeight := ::height + 1 // * 5 @@ -3467,24 +3493,27 @@ RETURN ! EMPTY( res ) METHOD When() CLASS HBrowse - LOCAL nSkip, res := .T. + LOCAL nSkip, res := .T. - IF !CheckFocus(self, .f.) + IF !CheckFocus(self, .f. ) RETURN .F. ENDIF - nSkip := iif( GetKeyState( VK_UP ) < 0 .or. (GetKeyState( VK_TAB ) < 0 .and. GetKeyState(VK_SHIFT) < 0 ), -1, 1 ) + IF ::HighlightStyle = 0 .OR. ::HighlightStyle = 3 + ::RefreshLine() + ENDIF - IF ::bGetFocus != Nil - ::oParent:lSuspendMsgsHandling := .T. - ::lnoValid := .T. + IF ::bGetFocus != Nil + nSkip := iif( GetKeyState( VK_UP ) < 0 .OR. (GetKeyState( VK_TAB ) < 0 .AND. GetKeyState(VK_SHIFT) < 0 ), -1, 1 ) + ::oParent:lSuspendMsgsHandling := .T. + ::lnoValid := .T. //::setfocus() - res := Eval( ::bGetFocus, ::COLPOS, Self ) - res := IIF(VALTYPE(res) = "L", res, .T.) + res := Eval( ::bGetFocus, ::Colpos, Self ) + res := IIF( VALTYPE(res) = "L", res, .T.) ::lnoValid := ! res IF ! res WhenSetFocus( Self, nSkip ) ENDIF - ::oParent:lSuspendMsgsHandling := .F. + ::oParent:lSuspendMsgsHandling := .F. ENDIF RETURN res @@ -3492,28 +3521,33 @@ LOCAL res //IF ::bLostFocus != Nil .AND. ( ! CheckFocus( Self, .t. ) .OR.::lNoValid ) - IF !CheckFocus(self, .T.) .OR. ::lNoValid + IF !CheckFocus(self, .T. ) .OR. ::lNoValid RETURN .T. - ENDIF + ENDIF + IF ::HighlightStyle = 0 .OR. ::HighlightStyle = 3 + ::RefreshLine() + ENDIF IF ::bLostFocus != Nil - ::oParent:lSuspendMsgsHandling := .T. - res := Eval( ::bLostFocus, ::COLPOS, Self ) - res := IIF( VALTYPE(res) = "L", res, .T. ) - IF VALTYPE(res) = "L" .AND. ! res - ::setfocus( .T. ) - ::oParent:lSuspendMsgsHandling := .F. - RETURN .F. - ENDIF - ::oParent:lSuspendMsgsHandling := .F. + ::oParent:lSuspendMsgsHandling := .T. + res := Eval( ::bLostFocus, ::ColPos, Self ) + res := IIF( VALTYPE(res) = "L", res, .T. ) + IF VALTYPE(res) = "L" .AND. ! res + ::setfocus( .T. ) + ::oParent:lSuspendMsgsHandling := .F. + RETURN .F. + ENDIF + ::oParent:lSuspendMsgsHandling := .F. ENDIF RETURN .T. //----------------------------------------------------// METHOD RefreshLine() CLASS HBrowse + LOCAL nInternal := ::internal[ 1 ] ::internal[ 1 ] := 0 InvalidateRect( ::handle, 0, ::x1 - ::nDeleteMark , ::y1 + ( ::height + 1 ) * ::rowPos - ::height, ::x2, ::y1 + ( ::height + 1 ) * ::rowPos ) + ::internal[ 1 ] := nInternal RETURN Nil //----------------------------------------------------// Modified: trunk/hwgui/source/hdialog.prg =================================================================== --- trunk/hwgui/source/hdialog.prg 2012-08-08 12:01:48 UTC (rev 1863) +++ trunk/hwgui/source/hdialog.prg 2012-08-27 13:14:25 UTC (rev 1864) @@ -70,14 +70,15 @@ DATA nLastKey INIT 0 DATA oIcon, oBmp DATA bActivate - DATA lActivated INIT .F. + DATA lActivated INIT .F. DATA xResourceID DATA oEmbedded DATA bOnActivate DATA lOnActivated INIT .F. DATA WindowState INIT 0 - DATA nScrollBars INIT - 1 + DATA nScrollBars INIT - 1 DATA bScroll + DATA lContainer INIT .F. METHOD New( lType, nStyle, x, y, width, height, cTitle, oFont, bInit, bExit, bSize, ; bPaint, bGfocus, bLfocus, bOther, lClipper, oBmp, oIcon, lExitOnEnter, nHelpId,; @@ -136,7 +137,8 @@ IF Hwg_Bitand( nStyle, WS_VSCROLL ) > 0 ::nScrollBars += 2 ENDIF - + ::lContainer := Hwg_Bitand( nStyle, DS_CONTROL ) > 0 + RETURN Self @@ -209,7 +211,7 @@ METHOD onEvent( msg, wParam, lParam ) CLASS HDialog LOCAL i, oTab, nPos, aCoors - * WRITELOG(STR(MSG)+STR(WPARAM)+STR(LPARAM)+CHR(13)) + IF msg = WM_GETMINMAXINFO IF ::minWidth > - 1 .OR. ::maxWidth > - 1 .OR. ; ::minHeight > - 1 .OR. ::maxHeight > - 1 @@ -662,7 +664,13 @@ //HB_SYMBOL_UNUSED( lParam ) - IF iParLow = WA_ACTIVE .AND. lParam = oDlg:Handle + IF ( iParLow = WA_ACTIVE .OR. iParLow = WA_CLICKACTIVE ) .AND. oDlg:lContainer .AND. ; + ! SelfFocus( lParam, oDlg:Handle ) + UpdateWindow( oDlg:Handle ) + SENDMessage( lParam, WM_NCACTIVATE, 1, Nil ) + RETURN 0 + ENDIF + IF iParLow = WA_ACTIVE .AND. SelfFocus( lParam, oDlg:Handle ) IF Valtype( oDlg:bOnActivate) == "B" *- oDlg:lSuspendMsgsHandling := .t. Eval( oDlg:bOnActivate, oDlg ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lf...@us...> - 2012-08-08 12:01:58
|
Revision: 1863 http://hwgui.svn.sourceforge.net/hwgui/?rev=1863&view=rev Author: lfbasso Date: 2012-08-08 12:01:48 +0000 (Wed, 08 Aug 2012) Log Message: ----------- 2012-08-08 09:30 UTC-0300 Luis Fernando Basso <lfbasso at via-rs.net> * source/hbrowse.prg * METHOS onEvent ! minor fix in WM_KEYDOWN and WM_CHAR Modified Paths: -------------- trunk/hwgui/Changelog trunk/hwgui/source/hbrowse.prg Modified: trunk/hwgui/Changelog =================================================================== --- trunk/hwgui/Changelog 2012-08-06 11:59:00 UTC (rev 1862) +++ trunk/hwgui/Changelog 2012-08-08 12:01:48 UTC (rev 1863) @@ -8,6 +8,11 @@ 2002-12-01 23:12 UTC+0100 Foo Bar <fo...@fo...> */ +2012-08-08 09:30 UTC-0300 Luis Fernando Basso <lfbasso at via-rs.net> + * source/hbrowse.prg + * METHOS onEvent + ! minor fix in WM_KEYDOWN and WM_CHAR + 2012-08-06 12:30 UTC-0300 Luis Fernando Basso <lfbasso at via-rs.net> * source/hbrowse.prg * METHOS onEvent Modified: trunk/hwgui/source/hbrowse.prg =================================================================== --- trunk/hwgui/source/hbrowse.prg 2012-08-06 11:59:00 UTC (rev 1862) +++ trunk/hwgui/source/hbrowse.prg 2012-08-08 12:01:48 UTC (rev 1863) @@ -593,7 +593,7 @@ nShiftAltCtrl += IIF( IsCtrlShift( .T., .F. ), 2 , nShiftAltCtrl ) //nShiftAltCtrl += IIF( wParam > 111, 4, nShiftAltCtrl ) IF ::bKeyDown != Nil .and. ValType( ::bKeyDown ) == 'B' .AND. wParam != VK_TAB .AND. wParam != VK_RETURN - IF EMPTY( Eval( ::bKeyDown, Self, wParam, nShiftAltCtrl, msg ) ) + IF EMPTY( nRet := Eval( ::bKeyDown, Self, wParam, nShiftAltCtrl, msg ) ) .and. nRet != Nil RETURN 0 ENDIF ENDIF @@ -661,13 +661,13 @@ ELSEIF msg == WM_KEYDOWN .AND. ! ::oParent:lSuspendMsgsHandling //::isMouseOver := .F. - IF ( ( CheckBit( lParam, 25 ) .AND. wParam != 111 ) .OR. ( wParam > 111 .AND. wParam < 124 ) .AND.; + IF ( ( CheckBit( lParam, 25 ) .AND. wParam != 111 ) .OR. ( wParam > 111 .AND. wParam < 124 ) .OR.; wParam = VK_TAB .OR. wParam = VK_RETURN ) .AND.; ::bKeyDown != Nil .and. ValType( ::bKeyDown ) == 'B' nShiftAltCtrl := IIF( IsCtrlShift( .F., .T. ), 1 , 0 ) - nShiftAltCtrl += IIF( IsCtrlShift( .T., .F. ), 2 , 0 ) + nShiftAltCtrl += IIF( IsCtrlShift( .T., .F. ), 2 , nShiftAltCtrl ) nShiftAltCtrl += IIF( wParam > 111, 4, nShiftAltCtrl ) - IF EMPTY( Eval( ::bKeyDown, Self, wParam, nShiftAltCtrl, msg ) ) + IF EMPTY( nRet := Eval( ::bKeyDown, Self, wParam, nShiftAltCtrl, msg ) ) .AND. nRet != Nil RETURN 0 ENDIF ENDIF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lf...@us...> - 2012-08-06 11:59:07
|
Revision: 1862 http://hwgui.svn.sourceforge.net/hwgui/?rev=1862&view=rev Author: lfbasso Date: 2012-08-06 11:59:00 +0000 (Mon, 06 Aug 2012) Log Message: ----------- 2012-08-06 12:30 UTC-0300 Luis Fernando Basso <lfbasso at via-rs.net> * source/hbrowse.prg * METHOS onEvent ! fixed VK_RETURN in WM_KEYDOWN Modified Paths: -------------- trunk/hwgui/Changelog trunk/hwgui/source/hbrowse.prg Modified: trunk/hwgui/Changelog =================================================================== --- trunk/hwgui/Changelog 2012-08-02 17:31:17 UTC (rev 1861) +++ trunk/hwgui/Changelog 2012-08-06 11:59:00 UTC (rev 1862) @@ -8,8 +8,13 @@ 2002-12-01 23:12 UTC+0100 Foo Bar <fo...@fo...> */ -2012-07-09 12:30 UTC-0300 Luis Fernando Basso <lfbasso at via-rs.net> +2012-08-06 12:30 UTC-0300 Luis Fernando Basso <lfbasso at via-rs.net> * source/hbrowse.prg + * METHOS onEvent + ! fixed VK_RETURN in WM_KEYDOWN + +2012-08-03 12:30 UTC-0300 Luis Fernando Basso <lfbasso at via-rs.net> + * source/hbrowse.prg * METHOS INIT - VScrollPos( Self, 0, .F. ) ( comment , no necessary ) Modified: trunk/hwgui/source/hbrowse.prg =================================================================== --- trunk/hwgui/source/hbrowse.prg 2012-08-02 17:31:17 UTC (rev 1861) +++ trunk/hwgui/source/hbrowse.prg 2012-08-06 11:59:00 UTC (rev 1862) @@ -661,7 +661,8 @@ ELSEIF msg == WM_KEYDOWN .AND. ! ::oParent:lSuspendMsgsHandling //::isMouseOver := .F. - IF ( ( CheckBit( lParam, 25 ) .AND. wParam != 111 ) .OR. ( wParam > 111 .AND. wParam < 124 ) ) .AND.; + IF ( ( CheckBit( lParam, 25 ) .AND. wParam != 111 ) .OR. ( wParam > 111 .AND. wParam < 124 ) .AND.; + wParam = VK_TAB .OR. wParam = VK_RETURN ) .AND.; ::bKeyDown != Nil .and. ValType( ::bKeyDown ) == 'B' nShiftAltCtrl := IIF( IsCtrlShift( .F., .T. ), 1 , 0 ) nShiftAltCtrl += IIF( IsCtrlShift( .T., .F. ), 2 , 0 ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lf...@us...> - 2012-08-02 17:31:26
|
Revision: 1861 http://hwgui.svn.sourceforge.net/hwgui/?rev=1861&view=rev Author: lfbasso Date: 2012-08-02 17:31:17 +0000 (Thu, 02 Aug 2012) Log Message: ----------- Modified Paths: -------------- trunk/hwgui/source/hbrowse.prg Modified: trunk/hwgui/source/hbrowse.prg =================================================================== --- trunk/hwgui/source/hbrowse.prg 2012-08-02 17:14:53 UTC (rev 1860) +++ trunk/hwgui/source/hbrowse.prg 2012-08-02 17:31:17 UTC (rev 1861) @@ -445,7 +445,7 @@ SetWindowObject( ::handle, Self ) Super:Init() ::InitBrw( , .T. ) - VScrollPos( Self, 0, .F. ) + //VScrollPos( Self, 0, .F. ) IF ::GetParentForm( ):Type < WND_DLG_RESOURCE ::GetParentForm():lDisableCtrlTab := .T. ENDIF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lf...@us...> - 2012-08-02 17:15:00
|
Revision: 1860 http://hwgui.svn.sourceforge.net/hwgui/?rev=1860&view=rev Author: lfbasso Date: 2012-08-02 17:14:53 +0000 (Thu, 02 Aug 2012) Log Message: ----------- 2012-07-09 12:30 UTC-0300 Luis Fernando Basso <lfbasso at via-rs.net> * source/hbrowse.prg * METHOS INIT - VScrollPos( Self, 0, .F. ) ( comment , no necessary ) Modified Paths: -------------- trunk/hwgui/Changelog trunk/hwgui/source/hbrowse.prg Modified: trunk/hwgui/Changelog =================================================================== --- trunk/hwgui/Changelog 2012-07-16 17:19:49 UTC (rev 1859) +++ trunk/hwgui/Changelog 2012-08-02 17:14:53 UTC (rev 1860) @@ -9,6 +9,11 @@ */ 2012-07-09 12:30 UTC-0300 Luis Fernando Basso <lfbasso at via-rs.net> + * source/hbrowse.prg + * METHOS INIT + - VScrollPos( Self, 0, .F. ) ( comment , no necessary ) + +2012-07-09 12:30 UTC-0300 Luis Fernando Basso <lfbasso at via-rs.net> * source/hwindow.prg * FUNCTION onMove ! fixed visibility WIN_MDICHILD minimized Modified: trunk/hwgui/source/hbrowse.prg =================================================================== --- trunk/hwgui/source/hbrowse.prg 2012-07-16 17:19:49 UTC (rev 1859) +++ trunk/hwgui/source/hbrowse.prg 2012-08-02 17:14:53 UTC (rev 1860) @@ -444,8 +444,8 @@ ::nHolder := 1 SetWindowObject( ::handle, Self ) Super:Init() - VScrollPos( Self, 0, .f. ) ::InitBrw( , .T. ) + VScrollPos( Self, 0, .F. ) IF ::GetParentForm( ):Type < WND_DLG_RESOURCE ::GetParentForm():lDisableCtrlTab := .T. ENDIF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |