FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour TGet ( Fix )
Posts: 603
Joined: Sun May 04, 2008 08:44 PM
TGet ( Fix )
Posted: Mon Mar 28, 2011 11:27 AM
Code (fw): Select all Collapse
METHOD CreateButton() CLASS TGet

   local oThis := Self
   local hBitmap
   local nBmpWidth := 1
   local lFileBmp := .t.

   if ValType( ::bAction ) == "B" .and. Upper( ::ClassName() ) == "TGET"
      if Empty( ::cBmpName )
         @ 0, ::nWidth - ::nHeight - If( ::lSpinner, 20, 0 ) BUTTONBMP ::oBtn OF Self ;
         ACTION ( Eval( oThis:bAction, oThis ), oThis:SetFocus() ) ;
         SIZE ::nHeight - 4, ::nHeight - 4 PIXEL
         if Empty( ::oBtn:hBitmap )
            ::oBtn:SetText( "..." )
         endif
      else

         hBitmap   = If( ( lFileBmp := File( ::cBmpName ) ), ReadBitmap( 0, ::cBmpName ),;
                     LoadBitmap( GetResources(), ::cBmpName ) )

         if ::lAdjustBtn
            nBmpWidth := nBmpWidth( hBitmap ) + 5
            ::SetMargins( 1, nBmpWidth )
         else
            nBmpWidth := ::nHeight - 4
         endif

         if ::lBtnTransparent
            ::oBtn := TBtnBmp():New(0, ::nWidth - nBmpWidth - If( ::lSpinner, 20, 4 ), nBmpWidth, ::nHeight - 4,;
            if ( !lFileBmp, ::cBmpName, ),,if ( lFileBmp, ::cBmpName, ),,{|| Eval( oThis:bAction, oThis ),oThis:SetFocus() },;
            Self,,,,,,,,,.f.)
            ::oBtn:lTransparent := ::lBtnTransparent
         else
            ::oBtn := TButtonBmp():New( 0, ::nWidth - nBmpWidth - If( ::lSpinner, 20, 4 ),, Self, {|| Eval( oThis:bAction, oThis ),oThis:SetFocus() }, ;
            nBmpWidth, ::nHeight - 4,,,,.t.,,,,,,,::cBmpName )
         endif

         DeleteObject( hBitmap )

      endif
      ::oBtn:lCancel = .T. // so the GET VALID is not fired when the button is focused

      if Upper( ::oWnd:ClassName() ) == "TDIALOG" .and. ::oWnd:lResize16
         ::oBtn:nWidth  = ::nHeight - 5
         ::oBtn:nHeight = ::nHeight - 5
         ::oBtn:nLeft   = ( ::nWidth * 1.167 ) - ::nHeight
      endif


      /*
      // We force a WM_NCCALCSIZE msg to be sent to the GET
      SetWindowPos( ::hWnd, 0, 0, 0, 0, 0,;
                    nOr( SWP_NOMOVE, SWP_NOSIZE, SWP_NOZORDER, SWP_FRAMECHANGED ) )
      */
   endif

return nil


TGET using 'action' need use oThis:SetFocus() later bcodeblock, to receive callback focus.

=] :-)
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: TGet ( Fix )
Posted: Tue Mar 29, 2011 09:48 AM

Implemented for next build, Thanks! :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 422
Joined: Mon Aug 17, 2009 12:18 PM
Re: TGet ( Fix )
Posted: Tue Mar 29, 2011 12:28 PM

Antonio,

Why don´t you create a patch or an updated fixed build?.

Otherwise, we must wait until next release, hopping that no new unfixed bugs persist.

Thank you.

Saludos,



Eduardo
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: TGet ( Fix )
Posted: Tue Mar 29, 2011 12:32 PM

We will surely publish a revised 11.03 in one day or two

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 422
Joined: Mon Aug 17, 2009 12:18 PM
Re: TGet ( Fix )
Posted: Tue Mar 29, 2011 09:34 PM

Antonio,

Thanks for reply. But it will be more useful to have access to SVN or just publish the libs and the .prgs fixed.

;)

Saludos,



Eduardo
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: TGet ( Fix )
Posted: Wed Mar 30, 2011 05:38 AM

You can easily fix it yourself with the code posted by Lailton

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion