Boton multilinea

Boton multilinea

Postby mastintin » Fri Aug 24, 2012 9:19 am

He intentado crear un boton desde codigo que tenga 2 lineas en su PROMPT y con chr(13)+chr(10) no funciona .
Investigando he hecho unos cambios a la clase Tbutton que permiten que funcione sin problemas . Dejo aqui los cambios por si se quieren incorporar a fivewin.

En Fivewin.ch :
Code: Select all  Expand view


#xcommand @ <nRow>, <nCol> BUTTON [ <oBtn> PROMPT ] <cCaption> ;
             [ SIZE <nWidth>, <nHeight> ] ;
             [ ACTION <uAction> ] ;
             [ <default: DEFAULT> ] ;
             [ <of:OF, WINDOW, DIALOG> <oWnd> ] ;
             [ <help:HELP, HELPID, HELP ID> <nHelpId> ] ;
             [ FONT <oFont> ] ;
             [ <pixel: PIXEL> ] ;
             [ <design: DESIGN> ] ;
             [ MESSAGE <cMsg> ] ;
             [ <update: UPDATE> ] ;
             [ WHEN <WhenFunc> ] ;
             [ VALID <uValid> ] ;
             [ <lCancel: CANCEL> ] ;
             [ <lmultiline: MULTILINE> ] ;
      => ;
         [ <oBtn> := ] TButton():New( <nRow>, <nCol>, <cCaption>, <oWnd>,;
            <{uAction}>, <nWidth>, <nHeight>, <nHelpId>, <oFont>, <.default.>,;
            <.pixel.>, <.design.>, <cMsg>, <.update.>, <{WhenFunc}>,;
            <{uValid}>, <.lCancel.>, [<(oBtn)>] ,<.lmultiline.>)

 


En la clase tbutton :
Code: Select all  Expand view

...
#define BS_MULTILINE 0x2000
...
METHOD New( nRow, nCol, cCaption, oWnd, bAction, nWidth, nHeight, ;
            nHelpId, oFont, lDefault, lPixel, lDesign, cMsg,;
            lUpdate, bWhen, bValid, lCancel, cVarName,lMultiline ) CLASS TButton

   local nFntWidth, nFntHeight

   DEFAULT nRow     := 0, nCol := 0,;
           cCaption := "&Button",;
           oWnd     := GetWndDefault(),;
           oFont    := oWnd:oFont,;
           lDefault := .F., lPixel := .F., lDesign := .F., lUpdate := .F.,;
           lCancel  := .F., nWidth   := Max( Len( cCaption ) * BTN_CHARPIX_W, 30 ),;
           nHeight  := BTN_CHARPIX_H - 5 ,;
           lMultiline:= .f.

   ::cCaption  = cCaption

   ::nTop      = nRow * If( ! lPixel, BTN_CHARPIX_H, 1 )
   ::nLeft     = nCol * If( ! lPixel, BTN_CHARPIX_W, 1 )
   ::nBottom   = ::nTop  + nHeight
   ::nRight    = ::nLeft + nWidth

   ::nHelpId   = nHelpId
   ::bAction   = bAction
   ::oWnd      = oWnd
   ::oFont     = oFont
   ::nStyle    = nOR( WS_CHILD, WS_VISIBLE, WS_TABSTOP,;
                     If( lDefault, BS_DEFPUSHBUTTON, 0 ),;
                     If( lDesign, WS_CLIPSIBLINGS, 0 ),;
                     If( lMultiline, BS_MULTILINE, 0 )  )
...

 


Saludos a todos
User avatar
mastintin
 
Posts: 1516
Joined: Thu May 27, 2010 2:06 pm

Re: Boton multilinea

Postby Antonio Linares » Sat Aug 25, 2012 12:07 pm

Manuel,

gracias! :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41898
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 132 guests