RAO Antonio GROUP error DEFCONTRL with REDEFINE or @

RAO Antonio GROUP error DEFCONTRL with REDEFINE or @

Postby Maurizio » Tue Jul 25, 2023 9:15 am

Hello RAO
I have an error in GROUP when using REDEFINE commands, while it works with @ commands


Error description: Error BASE/1004 Message not found: TGROUP:DEFCONTROL
Args:
[ 1] = O TGROUP

Stack Calls
===========
Called from: => __ERRRT_SBASE( 0 )
Called from: ../../../tobject.prg => TGROUP:ERROR( 148 )
Called from: ../../../tobject.prg => (b)HBOBJECT( 77 )
Called from: ../../../tobject.prg => TGROUP:MSGNOTFOUND( 0 )
Called from: ../../../tobject.prg => TGROUP:DEFCONTROL( 142 )
Called from: .\source\classes\BUTTON.PRG => TBUTTON:REDEFINE( 157 )






I hope you can help me

I found your example of RAO and it works fine
Code: Select all  Expand view  RUN
#include "fivewin.ch"

function Main()
 local oDlg, oGroup

   DEFINE DIALOG oDlg SIZE 700,400 PIXEL TRUEPIXEL
   ACTIVATE DIALOG oDlg CENTERED  ON INIT DlgControls( oDlg)

return nil
function dlgcontrols( oDlg  )
   local oGroup ,cF := space(20)
   local oget

   @ 50,20 GROUP oGroup TO 150,170 PIXEL OF oDlg
   @ 20,20 GET oGET VAR cF SIZE 100,20 PIXEL OF oGroup
   @ 45,20 say 'inside click OK to move ' SIZE 130,20 PIXEL OF oGroup
 
   @ 70,30 BUTTON "OK" SIZE 60,20 PIXEL OF oGroup ;
        ACTION oGroup:Move( oGroup:nTop, oGroup:nLeft + 30, , , .t. )

return nil
 

I need to use REDEFINE commands in a DLL, I prepared an example PRG e RC and it doesn't work


Code: Select all  Expand view  RUN
#include "fivewin.ch"
function Main()
 local oDlg, oGroup

   DEFINE DIALOG oDlg RESOURCE "test"
     
   ACTIVATE DIALOG oDlg CENTERED  ON INIT DlgControls( oDlg)

return nil

function dlgcontrols( oDlg  )

   local oGroup ,cF := space(20)
   local oget, oBtn

   REDEFINE GROUP oGroup  ID 4001 OF oDlg
   REDEFINE get oGet Var  cF  ID 4002 OF oGroup  
   REDEFINE BUTTON oBtn  ID 250 OF oGroup ;  
       ACTION oGroup:Move( oGroup:nTop, oGroup:nLeft + 30, , , .t. )
 
return nil


//**** RC
Code: Select all  Expand view  RUN
LANGUAGE LANG_ITALIAN,SUBLANG_ITALIAN


test DIALOG DISCARDABLE 22, 74, 174, 129
STYLE WS_POPUP|DS_MODALFRAME|DS_3DLOOK|WS_CAPTION|WS_SYSMENU
FONT 8, "Arial"


{
  CONTROL "OK", 250, "Button", WS_TABSTOP, 28, 59, 45, 15
  CONTROL "Group-box", 4001, "Button", BS_GROUPBOX, 19, 13, 107, 68
  CONTROL "", 4002, "Edit", ES_AUTOHSCROLL|WS_BORDER|WS_TABSTOP, 26, 26, 82, 13
  CONTROL "inside click OK to move", 4003, "Static", WS_GROUP, 27, 45, 80, 8
}


Regards Maurizio
Last edited by Maurizio on Tue Jul 25, 2023 1:48 pm, edited 5 times in total.
User avatar
Maurizio
 
Posts: 825
Joined: Mon Oct 10, 2005 1:29 pm


Re: RAO - GROUP error between command REDEFINE and com@

Postby Maurizio » Tue Jul 25, 2023 1:16 pm

Ciao Enrico ,

I modified RC but it doesn't work (also the one above)

Maurizio
User avatar
Maurizio
 
Posts: 825
Joined: Mon Oct 10, 2005 1:29 pm

Re: RAO Antonio GROUP error DEFCONTRL with REDEFINE or @

Postby nageswaragunupudi » Tue Jul 25, 2023 2:11 pm

Please post revised rc
Regards

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

Re: RAO Antonio GROUP error DEFCONTRL with REDEFINE or @

Postby Maurizio » Tue Jul 25, 2023 2:34 pm

Code: Select all  Expand view  RUN
LANGUAGE LANG_ITALIAN,SUBLANG_ITALIAN


test DIALOG DISCARDABLE 22, 74, 174, 129
STYLE WS_POPUP|DS_MODALFRAME|DS_3DLOOK|WS_CAPTION|WS_SYSMENU
FONT 8, "Arial"


{
  CONTROL "OK", 250, "Button", WS_TABSTOP, 28, 59, 45, 15
  CONTROL "Group-box", 4001, "Button", BS_GROUPBOX, 19, 13, 107, 68
  CONTROL "", 4002, "Edit", ES_AUTOHSCROLL|WS_BORDER|WS_TABSTOP, 26, 26, 82, 13
  CONTROL "inside click OK to move", 4003, "Static", WS_GROUP, 27, 45, 80, 8
}
User avatar
Maurizio
 
Posts: 825
Joined: Mon Oct 10, 2005 1:29 pm

Re: RAO Antonio GROUP error DEFCONTRL with REDEFINE or @

Postby Enrico Maria Giordano » Tue Jul 25, 2023 3:18 pm

With your revised RC, your sample works fine here.
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: RAO Antonio GROUP error DEFCONTRL with REDEFINE or @

Postby Maurizio » Tue Jul 25, 2023 3:36 pm

Ciao Enrico ,
Did you use the REDEFINE sources? I have the same error
Code: Select all  Expand view  RUN
#include "fivewin.ch"
function Main()
 local oDlg, oGroup

   DEFINE DIALOG oDlg RESOURCE "test"
     
   ACTIVATE DIALOG oDlg CENTERED  ON INIT DlgControls( oDlg)

return nil

function dlgcontrols( oDlg  )

   local oGroup ,cF := space(20)
   local oget, oBtn

   REDEFINE GROUP oGroup  ID 4001 OF oDlg
   REDEFINE get oGet Var  cF  ID 4002 OF oGroup  
   REDEFINE BUTTON oBtn  ID 250 OF oGroup ;  
       ACTION oGroup:Move( oGroup:nTop, oGroup:nLeft + 30, , , .t. )
 
return nil
User avatar
Maurizio
 
Posts: 825
Joined: Mon Oct 10, 2005 1:29 pm

Re: RAO Antonio GROUP error DEFCONTRL with REDEFINE or @

Postby karinha » Tue Jul 25, 2023 3:56 pm

Code: Select all  Expand view  RUN

// C:\FWH..\SAMPLES\MAURIZ3.PRG & .RC - 25/07/2023 - kapiabafwh@gmail.com

#Include "FiveWin.ch"

#Define CLR_MSPURPLE   nRGB( 0,   120, 215 )
#Define CLR_ORANGE     nRGB( 255, 165, 000 )

FUNCTION Main()

   LOCAL oDlg, oGroup, cF := "TEST OF GET WITH MAURIZIO"
   LOCAL oGet, oBtn, oBtn2, oBtn3, oFnt, oFont

   SkinButtons()

   DEFINE FONT oFont NAME "Ms Sans Serif"  SIZE 00, -14 BOLD
   DEFINE FONT oFnt  NAME "Ms Sans Serif"  SIZE 00, -12 BOLD

   DEFINE DIALOG oDlg RESOURCE "TEST" COLOR CLR_BLACK, CLR_WHITE TRANSPARENT  ;
      FONT oFont

   REDEFINE GROUP oGroup ID 501 OF oDlg COLOR CLR_ORANGE, CLR_WHITE FONT oFnt ;
      TRANSPARENT

   REDEFINE SAY ID 401 OF oDlg COLORS CLR_CYAN, CLR_WHITE UPDATE FONT oFont   ;
      TRANSPARENT

   //    Set( 29, ! Set( 29 ) )
   IF Set( _SET_INSERT, ! Set( _SET_INSERT ) )
      Set( _SET_INSERT, ! Set( _SET_INSERT ) )
   ENDIF

   REDEFINE GET oGet Var cF ID 20 OF oDlg UPDATE COLOR CLR_MSPURPLE, CLR_WHITE ;
      FONT oFont

   oGet:cToolTip := "TEST OF GET WITH MAURIZIO"

   // Move Right
   REDEFINE BUTTON oBtn ID 301 OF oDlg ;
      ACTION oGroup:Move( oGroup:nTop, oGroup:nLeft + 30, , , .T., ;
             oDlg:Refresh() )

   oBtn:cToolTip := "Maurizio Move Right"

   // Move Left
   REDEFINE BUTTON oBtn2 ID 302 OF oDlg ;
      ACTION oGroup:Move( oGroup:nTop, oGroup:nLeft - 30, , , .T., ;
         oDlg:Refresh() )

   oBtn2:cToolTip := "Maurizio Move Left"

   // yes, i am.
   REDEFINE BUTTON oBtn3 ID 303 OF oDlg ;
      ACTION( oDlg:End() ) CANCEL

   oBtn3:cToolTip := "Maurizio Exit"
     
   ACTIVATE DIALOG oDlg CENTERED

   //    Set( 29, ! Set( 29 ) )
   IF Set( _SET_INSERT, ! Set( _SET_INSERT ) )
      Set( _SET_INSERT, ! Set( _SET_INSERT ) )
   ENDIF

   oFnt:End()
   oFont:End()

RETURN NIL

/*  // MAURIZ3.RC
test DIALOG 202, 78, 200, 129
STYLE DS_ABSALIGN | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_SYSMENU
FONT 8, "Arial"
{
 EDITTEXT 20, 10, 58, 180, 16, ES_MULTILINE | WS_BORDER | WS_TABSTOP
 PUSHBUTTON "&Move >>", 301, 12, 107, 60, 16
 PUSHBUTTON "<< Mo&ve ", 302, 75, 107, 60, 16
 PUSHBUTTON "&Exit", 303, 137, 107, 50, 16
 CTEXT "inside click ""Move"" to move controls.", 401, 10, 44, 180, 12, SS_CENTER | NOT WS_GROUP
 GROUPBOX "Group-box", 501, 5, 19, 190, 68, BS_GROUPBOX
}
*/


// FIN / END
 


Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7831
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: RAO Antonio GROUP error DEFCONTRL with REDEFINE or @

Postby karinha » Tue Jul 25, 2023 7:22 pm

Code: Select all  Expand view  RUN

#Include "FiveWin.ch"

#Define CLR_MSPURPLE   nRGB( 0,   120, 215 )
#Define CLR_ORANGE     nRGB( 255, 165, 000 )

STATIC oWnd

FUNCTION Main()

   LOCAL oBar

   SetBalloon( .T. )
   SkinButtons()

   DEFINE WINDOW oWnd TITLE "Dlg Controls"

   DEFINE BUTTONBAR oBar _3D OF oWnd 2007

   DEFINE BUTTON OF oBar FILENAME "..\bitmaps\16x16\floppy.bmp" FLAT ;
      ACTION( DlgControls() ) TOOLTIP "Dlg Controls"

   DEFINE BUTTON OF oBar FILENAME "..\bitmaps\16x16\Exit.bmp" FLAT ;
      ACTION oWnd:End() TOOLTIP "Exit this app" GROUP

   SET MESSAGE OF oWnd TO "dlgcontrols" NOINSET CLOCK DATE KEYBOARD

   ACTIVATE WINDOW oWnd

RETURN NIL

FUNCTION dlgcontrols()

   LOCAL oDlg, oFont, oFnt
   LOCAL oGroup, cF := "TEST OF GET WITH MAURIZIO"
   LOCAL oGet, oBtn, oBtn2, oBtn3

   DEFINE FONT oFont NAME "Ms Sans Serif"  SIZE 00, -14 BOLD
   DEFINE FONT oFnt  NAME "Ms Sans Serif"  SIZE 00, -12 BOLD

   DEFINE DIALOG oDlg RESOURCE "TEST" COLOR CLR_BLACK, CLR_WHITE TRANSPARENT  ;
      FONT oFont

   REDEFINE GROUP oGroup ID 501 OF oDlg COLOR CLR_ORANGE, CLR_WHITE FONT oFnt ;
      TRANSPARENT

   REDEFINE SAY ID 401 OF oDlg COLORS CLR_CYAN, CLR_WHITE UPDATE FONT oFont   ;
      TRANSPARENT

   //    Set( 29, ! Set( 29 ) )
   IF Set( _SET_INSERT, ! Set( _SET_INSERT ) )
      Set( _SET_INSERT, ! Set( _SET_INSERT ) )
   ENDIF

   REDEFINE GET oGet Var cF ID 20 OF oDlg UPDATE COLOR CLR_MSPURPLE, CLR_WHITE ;
      FONT oFont

   oGet:cToolTip := "TEST OF GET WITH MAURIZIO"

   // Move Right
   REDEFINE BUTTON oBtn ID 301 OF oDlg ;
      ACTION oGroup:Move( oGroup:nTop, oGroup:nLeft + 30, , , .T., ;
             oDlg:Refresh() )

   oBtn:cToolTip := "Maurizio Move Right"

   // Move Left
   REDEFINE BUTTON oBtn2 ID 302 OF oDlg ;
      ACTION oGroup:Move( oGroup:nTop, oGroup:nLeft - 30, , , .T., ;
         oDlg:Refresh() )

   oBtn2:cToolTip := "Maurizio Move Left"

   // yes, i am.
   REDEFINE BUTTON oBtn3 ID 303 OF oDlg ;
      ACTION( oDlg:End() ) CANCEL

   oBtn3:cToolTip := "Maurizio Exit"

   ACTIVATE DIALOG oDlg CENTERED

   IF Set( _SET_INSERT, ! Set( _SET_INSERT ) )
      Set( _SET_INSERT, ! Set( _SET_INSERT ) )
   ENDIF

   oFnt:End()
   oFont:End()

RETURN NIL

/*  // MAURIZ4.RC
test DIALOG 202, 78, 200, 129
STYLE DS_ABSALIGN | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_SYSMENU
FONT 8, "Arial"
{
 EDITTEXT 20, 10, 58, 180, 16, ES_MULTILINE | WS_BORDER | WS_TABSTOP
 PUSHBUTTON "&Move >>", 301, 12, 107, 60, 16
 PUSHBUTTON "<< Mo&ve ", 302, 75, 107, 60, 16
 PUSHBUTTON "&Exit", 303, 137, 107, 50, 16
 CTEXT "inside click ""Move"" to move controls.", 401, 10, 44, 180, 12, SS_CENTER | NOT WS_GROUP
 GROUPBOX "Group-box", 501, 5, 19, 190, 68, BS_GROUPBOX
}
*/


// FIN / END
 


Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7831
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: RAO Antonio GROUP error DEFCONTRL with REDEFINE or @

Postby Enrico Maria Giordano » Tue Jul 25, 2023 7:26 pm

Maurizio wrote:Ciao Enrico ,
Did you use the REDEFINE sources? I have the same error


Please replace OF oGroup with OF oDlg.
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: RAO Antonio GROUP error DEFCONTRL with REDEFINE or @

Postby Maurizio » Wed Jul 26, 2023 7:33 am

Enrico ,
Yes, it works with oDlg, what I'm trying to do is match the GETs to the GROUP

Maurizio
User avatar
Maurizio
 
Posts: 825
Joined: Mon Oct 10, 2005 1:29 pm

Re: RAO Antonio GROUP error DEFCONTRL with REDEFINE or @

Postby Enrico Maria Giordano » Wed Jul 26, 2023 8:18 am

I don't know why we can't use OF oGroup. Maybe TGroup class lacks of something required.
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 73 guests