change a get with on execution

change a get with on execution

Postby Silvio.Falconi » Fri Apr 26, 2013 7:50 pm

I wish size a get when the user press a button or a menu

I tried with move(), resize() methods with no success !!!

I have this get

@ 0.5, 0.5 GET oGet VAR cGet OF oDlg SIZE 120, 12 RIGHT FONT oFont2

and I wish change the with from 120 to 232
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6867
Joined: Thu Oct 18, 2012 7:17 pm

Re: change a get with on execution

Postby ukoenig » Fri Apr 26, 2013 8:31 pm

Silvio,

tested with a big font :

Image

lRepaint := .F.

REDEFINE GET oGet1 VAR nWColorF ID 120 OF oDlg4 PICTURE "999999999" FONT oBigFont

REDEFINE BTNBMP oBtn1 OF oDlg4 ;
ID 130 PIXEL 2007 ;
NOBORDER ;
PROMPT "&1. Color" ;
FILENAME c_path1 + "Select.Bmp" ;
ACTION ( lRepaint := .T., nWColorF := ChooseColor(), ;
oBmp1:Refresh(), oBmp3:Refresh(), oGet1:Refresh() ) ;
FONT oFont1 ;
LEFT
oBtn1:lTransparent := .t.
oBtn1:cToolTip = { "1. Dlg-Gradient" + CRLF + "Color","Color-Selection", 1, CLR_BLACK, 14089979 }
oBtn1:SetColor( 0, )

oGet1:bPainted := { |hDC| IIF( lRepaint = .T., oGet1:Move( , , 100, 50, .f. ), NIL ) }

Best Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: change a get with on execution

Postby Silvio.Falconi » Fri Apr 26, 2013 9:30 pm

Sorry here not run ok

Function Calc_Scentifica(oDlg,oGet)
lRepaint:=.t.
oGet:bPainted := { |hDC| IIF( lRepaint , oGet:Move( , , 100, 50, .f. ), NIL ) }
oGet:refresh()
RETURN NIL

the error
Code: Select all  Expand view
pplication
===========
   Path and name: C:\Work\Prg\msgcalc\msgcalc.Exe (32 bits)
   Size: 2,138,624 bytes
   Compiler version: xHarbour build 1.2.1 Intl. (SimpLex) (Rev. 6715)
   FiveWin  Version: FWHX 12.03
   Windows version: 6.1, Build 7600

   Time from start: 0 hours 0 mins 3 secs
   Error occurred at: 04/26/13, 23:28:19
   Error description: Error BASE/1005  Class: 'NIL' has no property: BPAINTED
   Args:
     [   1] = U  
     [   2] = B   {|| ... }

Stack Calls
===========
   Called from:  => _BPAINTED( 0 )
   Called from: msgcalc.prg => CALC_SCENTIFICA( 467 )
   Called from: msgcalc.prg => (b)BUILDMENU( 432 )
   Called from: .\source\classes\MENU.PRG => TMENU:COMMAND( 461 )
   Called from: .\source\classes\DIALOG.PRG => TDIALOG:COMMAND( 350 )
   Called from:  => TWINDOW:HANDLEEVENT( 0 )
   Called from: .\source\classes\DIALOG.PRG => TDIALOG:HANDLEEVENT( 886 )
   Called from:  => DIALOGBOXINDIRECT( 0 )
   Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 270 )
   Called from: msgcalc.prg => MSGCALC( 359 )
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6867
Joined: Thu Oct 18, 2012 7:17 pm

Re: change a get with on execution

Postby ukoenig » Fri Apr 26, 2013 9:56 pm

Silvio,

it is a wrong logic.
The oGet:Refresh() is needed inside the BUTTON-action !
Just add the line < oGet:bPainted > next to Your defined get.
You don't need a function for oGet:bPainted !

lRepaint := .F.
REDEFINE GET oGet1 VAR nWColorF ID 120 OF oDlg4 PICTURE "999999999" FONT oFont1

// only resized with lRepaint := .T. and oGet:Refresh() from button-action
oGet:bPainted := { |hDC| IIF( lRepaint , oGet:Move( , , 100, 50, .f. ), NIL ) }

Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: change a get with on execution

Postby nageswaragunupudi » Sat Apr 27, 2013 1:15 am

I have this get

@ 0.5, 0.5 GET oGet VAR cGet OF oDlg SIZE 120, 12 RIGHT FONT oFont2

and I wish change the with from 120 to 232


Please try
Code: Select all  Expand view
function test()

   local oDlg, oGet
   local cGet  := PadR( "Change Get Width", 100 )

   DEFINE DIALOG oDlg SIZE 520,120 PIXEL
   @  10,10 BUTTON "GetWidth" SIZE 60,12 PIXEL OF oDlg ;
      ACTION ( oGet:nWidth := 232 * 2 )
   @  25,10 GET oGet VAR cGet SIZE 120,12 PIXEL OF oDlg

   ACTIVATE DIALOG oDlg CENTERED

return nil

 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10318
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: change a get with on execution

Postby Silvio.Falconi » Sat Apr 27, 2013 6:42 am

this run ok , I need it to change Msgcalc Standard to Scentific...
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6867
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 125 guests