FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Un Peque帽o Aporte: Font en redefine Folder 8.09
Posts: 57
Joined: Tue Nov 04, 2008 02:08 PM
Un Peque帽o Aporte: Font en redefine Folder 8.09
Posted: Wed Sep 02, 2009 08:53 PM
Un peque帽o aporte para FWH 8.09, Se trata de el Font en Redefine de la Class TFolder, Espero les sirva, y si a煤n no existe en las versiones posteriores, espero que lo a帽adan.

Primero en Class TFolder

Code (fw): Select all Collapse
CLASS TFolder FROM TControl

聽 聽CLASSDATA lRegistered AS LOGICAL

聽 聽DATA 聽 aPrompts, aDialogs
聽 聽DATA 聽 nOption, nTabSize, nFdHeight
聽 聽DATA 聽 oFont2
聽 聽DATA 聽 aEnable
聽 聽DATA 聽 lAllWidth AS LOGICAL INIT .t.
聽 聽DATA 聽 lWin95Look AS LOGICAL
聽 聽DATA 聽 oImageList

聽 聽CLASSDATA aProperties ;
聽 聽 聽 INIT { "aPrompts", "cVarName", "nClrText",;
聽 聽 聽 聽 聽 聽 聽"nClrPane", "nAlign", "nTop", "nLeft",;
聽 聽 聽 聽 聽 聽 聽"nWidth", "nHeight", "nOption", "Cargo" }

聽 聽METHOD New( nTop, nLeft, aPrompts, aDialogs, oWnd, nOption, nClrFore,;
聽 聽 聽 聽 聽 聽 聽 聽nClrBack, lPixel, lDesign, nWidth, nHeight,;
聽 聽 聽 聽 聽 聽 聽 聽cMsg, lAllWidth, oFont ) CONSTRUCTOR

聽 聽METHOD ReDefine( nId, aPrompts, aDialogs, oWnd, nOption, nClrFore,;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 nClrBack, bChange, lAllWidth,oFont ) CONSTRUCTOR


En Method ReDefine, el 煤ltimo par谩metro es <oFont>.

Luego en METHOD ReDefine

Code (fw): Select all Collapse
METHOD ReDefine( nId, aPrompts, aDialogs, oWnd, nOption, ;
聽 聽 聽 聽 聽 聽 聽 聽 聽nClrFore, nClrBack, bChange, lAllWidth,oFont ) CLASS TFolder

聽 聽::oFont2 聽 聽 = ::SetFont( oFont ) //TFont():New( GetSysFont(), 0, -9,, .t. ) ->Aqu铆 hay un cambio
聽 聽::bChange 聽 聽= bChange
聽 聽::nClrPane 聽 = GetSysColor( COLOR_BTNFACE )
聽 聽::lAllWidth 聽= lAllWidth
聽 聽::nFdHeight 聽= If( LargeFonts(), 25 , 22 )
聽 聽::lWin95Look = GetVersion()[ 1 ] > 3 .or. GetVersion()[ 2 ] > 51 .or. ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 IsWinNT()

聽 聽::Register()
*C贸digo Nuevo
聽 聽if oFont != nil
聽 聽 聽 ::SetFont( oFont )
聽 聽elseif oWnd != nil .and. oWnd:oFont != nil
聽 聽 聽 ::SetFont( oWnd:oFont )
聽 聽else
聽 聽 聽 ::GetFont()
聽 聽endif
* Fin C贸digo Nuevo
Quiero hacer facturaci贸n electr贸nica...



Leon Valenzuela.

Santiago - Chile.
Posts: 57
Joined: Tue Nov 04, 2008 02:08 PM
Re: Un Peque帽o Aporte: Font en redefine Folder 8.09
Posted: Wed Sep 02, 2009 09:13 PM
Luego, para evitar porblemas nos vamos al Method Destroy()

Code (fw): Select all Collapse
METHOD Destroy() CLASS TFolder

聽 聽local n

* C贸digo Nuevo
聽 聽IF ::oFont2 != Nil
聽 聽 聽 聽::oFont2:End()
聽 聽ENDIF
* Fin C贸digo Nuevo

聽 聽if ::oFont != nil
聽 聽 聽 ::oFont:End()
聽 聽endif

聽 聽for n = 1 to Len( ::aDialogs )
聽 聽 聽 ::aDialogs[ n ]:bValid = { || .t. }
聽 聽 聽 ::aDialogs[ n ]:End()
聽 聽next

return Super:Destroy()


Luego en la Cabecera Folder.Ch Hacer la siguiente modificaci贸n

Code (fw): Select all Collapse
#xcommand REDEFINE FOLDER [<oFolder>] ;
聽 聽 聽 聽 聽 聽 聽[ ID <nId> ] ;
聽 聽 聽 聽 聽 聽 聽[ <of: OF, WINDOW, DIALOG> <oWnd> ] ;
聽 聽 聽 聽 聽 聽 聽[ <prm: PROMPT, PROMPTS, ITEMS> <cPrompt,...> ] ;
聽 聽 聽 聽 聽 聽 聽[ <dlg: DIALOG, DIALOGS, PAGE, PAGES> <cDlgName1> [,<cDlgNameN>] ] ;
聽 聽 聽 聽 聽 聽 聽[ <color: COLOR, COLORS> <nClrFore> [,<nClrBack>] ] ;
聽 聽 聽 聽 聽 聽 聽[ OPTION <nOption> ] ;
聽 聽 聽 聽 聽 聽 聽[ ON CHANGE <uChange> ] ;
聽 聽 聽 聽 聽 聽 聽[ <lAdjust: ADJUST> ] ;
聽 聽 聽 聽 聽[ FONT <oFont> ];
聽 聽 聽 聽=> ;
聽 聽 聽 聽 聽 [<oFolder> := ] TFolder():ReDefine( <nId>, [\{<cPrompt>\}],;
聽 聽 聽 聽 聽 聽 聽\{ <cDlgName1> [,<cDlgNameN>] \}, <oWnd>,;
聽 聽 聽 聽 聽 聽 聽<nOption>, <nClrFore>, <nClrBack>,;
聽 聽 聽 聽 聽 聽 聽[{|nOption,nOldOption| <uChange>}], <.lAdjust.>,<oFont> )


Y eso es todo, una vez compiladas las modificaciones en la lib, podremos definir Fonts para la Folder y los di谩logos contenidos en la folder con el m茅todo ReDefine. Espero sea de utilidad mi aporte.
Quiero hacer facturaci贸n electr贸nica...



Leon Valenzuela.

Santiago - Chile.

Continue the discussion