FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour change a get with on execution
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM

change a get with on execution

Posted: Fri Apr 26, 2013 07: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 March-April 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
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM

Re: change a get with on execution

Posted: Fri Apr 26, 2013 08:31 PM
Silvio,

tested with a big font :



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 :-)
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.
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM

Re: change a get with on execution

Posted: Fri Apr 26, 2013 09: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 (fw): Select all Collapse
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 March-April 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
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM

Re: change a get with on execution

Posted: Fri Apr 26, 2013 09: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 :-)
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.
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM

Re: change a get with on execution

Posted: Sat Apr 27, 2013 01: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 (fw): Select all Collapse
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
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM

Re: change a get with on execution

Posted: Sat Apr 27, 2013 06: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 March-April 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

Continue the discussion