A little correction on Get Action Bitmap

A little correction on Get Action Bitmap

Postby fraxzi » Wed Jun 23, 2010 7:43 am

Dear All,

Anyone using Get with Action and Bitmap Clause..

Before:
Image


minor coding:
Code: Select all  Expand view
AEval( aGetObjs, {|a| IF(Upper(a:Classname()) == 'TGET',;
                      IF( a:oBtn <> Nil, ( a:oBtn:nWidth -= 1, a:oBtn:nHeight -= 1 ),Nil) ,Nil) })


Results:
Image

The action bitmap is now visually better.


I hope this will be fix in v10.6


Regards,
Frances
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: A little correction on Get Action Bitmap

Postby Antonio Linares » Wed Jun 23, 2010 8:30 am

Frances,

Please test samples\GetBtn.prg and post here a screenshot of it, thanks
regards, saludos

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

Re: A little correction on Get Action Bitmap

Postby fraxzi » Wed Jun 23, 2010 9:46 am

Dear Mr. Antonio,

I tried/read "getbtn.prg" but declaration is diff not redefined.

Code: Select all  Expand view
#include "FiveWin.ch"

function Main()

   local oWnd, cTest := "Hello world!"

   DEFINE WINDOW oWnd COLOR "N/W*"

   @ 2, 2 GET cTest SIZE 110, 22 ;
      ACTION MsgInfo( "click" ) BITMAP "..\bitmaps\16x16\find.bmp"

   ACTIVATE WINDOW oWnd

return nil


Screenshot:
Image


my redefined action Get:
Code: Select all  Expand view
REDEFINE GET oGet VAR cVar;
         ID 1015 OF oDlg UPDATE;
         BITMAP 'client16';
         ACTION msginfo('here')


RC:
Code: Select all  Expand view
...
  CONTROL "",1015,"Edit",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP,78,75,124,12,WS_EX_CLIENTEDGE
...



Maybe there's a difference between redefine and command @..


Regards,
Frances
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: A little correction on Get Action Bitmap

Postby Antonio Linares » Wed Jun 23, 2010 11:42 am

Frances,

In source\classes\TGet.prg please modify these lines:
Code: Select all  Expand view


            ::oBtn := TButtonBmp():New( 0, ::nWidth - nBmpWidth - If( ::lSpinner, 20, 4 ),, Self, {|| Eval( oThis:bAction, oThis ) }, ;
            nBmpWidth, ::nHeight - 4,,,,.t.,,,,,,,::cBmpName )
 

Use - 5 instead of - 4 and please check the results, thanks
regards, saludos

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

Re: A little correction on Get Action Bitmap

Postby Antonio Linares » Wed Jun 23, 2010 11:55 am

This may be a better implementation:
Code: Select all  Expand view

::oBtn := TButtonBmp():New( 0, ::nWidth - nBmpWidth - If( ::lSpinner, 20, 4 ),, Self, {|| Eval( oThis:bAction, oThis ) }, ;
            nBmpWidth, ::nHeight - If( ::oWnd:IsKindOf( "TDIALOG" ) .and. ! Empty( ::oWnd:cResName ), 5, 4 ),,,,.t.,,,,,,,::cBmpName )
 
regards, saludos

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Marc Venken, nageswaragunupudi and 67 guests