Msgbar on dialog As MDICHILD inside a oWnd MDI

Msgbar on dialog As MDICHILD inside a oWnd MDI

Postby Silvio.Falconi » Mon Nov 04, 2024 10:58 am

First of all I don't see the status bar (MsgBar) and I don't understand why it isn't created, I need the msgbar because I have to insert a progressbar, furthermore the dialog must be inside the oWnd Mdi and instead it is outside, why?

I create a dialog AS MDICHILD from a class, where I inserted the creation of the msgbar

Image


BUT THE CLAUSOLE AS MDICHILD NOT WORK !!

this is the test

Code: Select all  Expand view


#include "fivewin.ch"

REQUEST DBFCDX

    #define AS_MDICHILD  1
    #define AS_DIALOG    2

FUNCTION Main()
local oWnd

   RddSetDefault( "DBFCDX" )

   SetHandleCount( 100 )

   SET DATE FORMAT "dd-mm-yyyy"
   SET DELETED     ON
   SET CENTURY     ON
   SET EPOCH TO    year( date() ) - 20
   SET MULTIPLE    OFF

   


   DEFINE WINDOW oWnd   ;
      FROM 0, 0 TO 24, 79  ;
      TITLE "TEST"     ;
      COLOR CLR_BLACK, CLR_WHITE ;
      MENU BuildMenu()        ;
      MDI  VSCROLL HSCROLL


   DEFINE BUTTONBAR oBar OF oWnd SIZE 100,32 2015

   DEFINE BUTTON OF oBar PROMPT "test" CENTER ACTION test(oWnd)
   ACTIVATE WINDOW oWnd

    return nil

  function BuildMenu();return nil



function test(oWnd)
  local  oAnalisi  := NewDlg():New( "Test", 10, 10, 300, 300,oWnd)
  local oBar

   DEFINE BUTTONBAR oBar TOP _3D OF oAnalisi SIZE 65,24 2015  NOBORDER

  oAnalisi:Activate()

 return nil








CLASS NewDlg

   DATA oDlg

   METHOD NEW()
   METHOD ACTIVATE()
   METHOD END()

ENDCLASS

METHOD NEW( cTitle, nTop, nLeft, nBottom, nRight,oWnd ) CLASS NewDlg

   DEFINE DIALOG ::oDlg TITLE cTitle OF oWnd;
          FROM nTop, nLeft TO nBottom, nRight PIXEL ;
          STYLE NOR( WS_POPUP, WS_VISIBLE, WS_CAPTION, WS_THICKFRAME, WS_SYSMENU, WS_MINIMIZEBOX )

RETURN ::oDlg

METHOD ACTIVATE() CLASS NewDlg
   LOCAL oDlg

   ::oDlg := oDlg

   ::oDlg:bInit  := { || StatusBar( ::oDlg ) }

   ACTIVATE DIALOG ::oDlg AS MDICHILD


RETURN NIL

METHOD END() CLASS NewDlg

   ::oDlg:End()

RETURN NIL

STATIC FUNCTION STATUSBAR(oDlg)
   //LOCAL oDlg

   oDlg := ::oDlg

   SET MESSAGE OF ::oDlg;
        TO "status bar";

RETURN NI
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: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: Msgbar on dialog As MDICHILD inside a oWnd MDI

Postby Antonio Linares » Tue Nov 05, 2024 3:08 pm

Dear Silvio,

Method New() must return Self

also,

DEFINE BUTTONBAR oBar TOP _3D OF oAnalisi SIZE 65,24 2015 NOBORDER

must be created from the ON INIT clause of the dialog
regards, saludos

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

Re: Msgbar on dialog As MDICHILD inside a oWnd MDI

Postby Silvio.Falconi » Tue Nov 05, 2024 5:28 pm

Antonio Linares wrote:Dear Silvio,

Method New() must return Self

also,

DEFINE BUTTONBAR oBar TOP _3D OF oAnalisi SIZE 65,24 2015 NOBORDER

must be created from the ON INIT clause of the dialog


Antonio I not see the msgbar (set message to)
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: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: Msgbar on dialog As MDICHILD inside a oWnd MDI

Postby Silvio.Falconi » Tue Nov 05, 2024 10:01 pm

I corrected the class Now is inside of oWnd but I not see the msgbar


Image

the test

Code: Select all  Expand view


#include "fivewin.ch"

REQUEST DBFCDX

    #define AS_MDICHILD  1
    #define AS_DIALOG    2

FUNCTION Main()
local oWnd

   RddSetDefault( "DBFCDX" )

   SetHandleCount( 100 )

   SET DATE FORMAT "dd-mm-yyyy"
   SET DELETED     ON
   SET CENTURY     ON
   SET EPOCH TO    year( date() ) - 20
   SET MULTIPLE    OFF

   


   DEFINE WINDOW oWnd   ;
      FROM 0, 0 TO 24, 79  ;
      TITLE "TEST"     ;
      COLOR CLR_BLACK, CLR_WHITE ;
      MENU BuildMenu()        ;
      MDI  VSCROLL HSCROLL


   DEFINE BUTTONBAR oBar OF oWnd SIZE 100,32 2015

   DEFINE BUTTON OF oBar PROMPT "test" CENTER ACTION test(oWnd)
   ACTIVATE WINDOW oWnd

    return nil

  function BuildMenu();return nil



function test(oWnd)
  local  oAnalisi  := NewDlg():New( "Test", 10, 10, 300, 300,oWnd)
  local  aBtnBar:= array(1)
  oAnalisi:Activate()


   DEFINE BUTTON aBtnBar[1] OF oAnalisi:oBar PROMPT "Nuovo" RESOURCE "NEW_REC"  ;
          ACTION msginfo("btn")


 return nil








CLASS NewDlg

   DATA oDlg
   DATA oBar

   METHOD NEW()
   METHOD ACTIVATE()
   METHOD END()
    METHOD ButtonBar(oDlg)
     METHOD STATUSBAR(oDlg)
ENDCLASS

METHOD NEW( cTitle, nTop, nLeft, nBottom, nRight,oWnd ) CLASS NewDlg

   DEFINE DIALOG ::oDlg TITLE cTitle OF oWnd;
          FROM nTop, nLeft TO nBottom, nRight PIXEL ;
          STYLE NOR( WS_POPUP, WS_VISIBLE, WS_CAPTION, WS_THICKFRAME, WS_SYSMENU, WS_MINIMIZEBOX )

RETURN self

METHOD ACTIVATE() CLASS NewDlg
    local oThis:= self
   oThis:oDlg:bInit  := { || ::StatusBar( oThis:oDlg ),::ButtonBar(oThis:oDlg) }

   ACTIVATE DIALOG oThis:oDlg AS MDICHILD

RETURN NIL

METHOD END() CLASS NewDlg
   ::oDlg:End()

RETURN NIL
METHOD ButtonBar(oDlg) CLASS NewDlg
          DEFINE BUTTONBAR ::oBar TOP _3D OF oDlg SIZE 65,24 2015  NOBORDER
      RETURN ::oBar

METHOD STATUSBAR(oDlg)  CLASS NewDlg
   //LOCAL oDlg



   SET MESSAGE OF oDlg;
        TO "status bar";

        RETURN NIL


 
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: 7061
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

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