DIALOG inside WINDOW

DIALOG inside WINDOW

Postby Otto » Thu Sep 10, 2009 7:37 am

Is it possible to have a dialog inside a window like a MDI window?

Thanks in advance
Otto


I tried:

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

//----------------------------------------------------------------------------//

function Main()

   local oWnd

   DEFINE WINDOW oWnd TITLE "A Window"

   ACTIVATE WINDOW oWnd ;
      ON INIT ShowDlg(oWnd)

return nil

//----------------------------------------------------------------------------//

function ShowDlg(oWnd)

   local oDlg

   DEFINE DIALOG oDlg FROM 5, 5 TO 20, 40 TITLE "A Dialog Box" [b] OF oWnd[/b]

   ACTIVATE DIALOG oDlg NOWAIT ;
      ON PAINT oDlg:Say( 1, 1, "Hello" ) ;
      VALID ( MsgInfo( "Valid Clause" ), .t. )

return nil

//----------------------------------------------------------------------------//
 
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6328
Joined: Fri Oct 07, 2005 7:07 pm

Re: DIALOG inside WINDOW

Postby fraxzi » Thu Sep 10, 2009 8:56 am

Sir,

Here an example:

Code: Select all  Expand view

      ...
      DEFINE WINDOW oWnd TITLE "mdi window or just window" MDICHILD;
             OF oMDIFrame PIXEL
 
             DEFINE DIALOG oDlg RESOURCE 'DLG_TEST';
                    OF oWnd PIXEL;
                    STYLE nOr( WS_VSCROLL, WS_HSCROLL )
 
                    ....

             ACTIVATE DIALOG oDlg NOWAIT;
                      VALID .F.   //no esc-key

      ACTIVATE WINDOW oWnd
      ...
 


You can also resize the child dialog to the coords of window:oWndClient or the window to coords of child dialog upon ON INIT of window.


I hope this helps...


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: DIALOG inside WINDOW

Postby Otto » Thu Sep 10, 2009 11:40 am

Hello Frances,

thank you very much for your help.
Is it clever to use such a complicated construction or should I make another approach.

I am experimenting with the new ribbonbar control and I thought if I start a function that the input for the function should be inside the main application window.
Maybe someone has a better suggestion than to open a dialog.
How should the different functions take use of the main window.

Thanks in advance
Otto

Image
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6328
Joined: Fri Oct 07, 2005 7:07 pm

Re: DIALOG inside WINDOW

Postby Otto » Fri Sep 11, 2009 10:35 am

Hello Frances,

I tried with your code but if I use MDI the program errors out:
ImageBest regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6328
Joined: Fri Oct 07, 2005 7:07 pm

Re: DIALOG inside WINDOW

Postby ukoenig » Fri Sep 11, 2009 11:36 am

Hello Otto,

You don't need to open a Dialog from inside a Ribbonbar.
You can place the Controls You need, inside the Ribbonbar itself like a Folder.

Image

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: DIALOG inside WINDOW

Postby Otto » Fri Sep 11, 2009 11:40 am

Hello Uwe, thank you.

But I mean the working area of an application.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6328
Joined: Fri Oct 07, 2005 7:07 pm

Re: DIALOG inside WINDOW

Postby Cgallegoa » Fri Sep 11, 2009 6:22 pm

Hello Otto,

I hope this help you.

Image

Code: Select all  Expand view
#include "fivewin.ch"
#include "ribbon.ch"


STATIC oWnd
STATIC oDlgRB[3]

function main()

   local oRBar
   local oMenu, oMenuWnd, oBrush1
   local oGr, oGr1, oGr2, oGr3, oGr4
   local oBtn,   oBtn1,  oBtn2,  oBtn3,  oBtn4, oBtn5
   local oBtn6,  oBtn7,  oBtn8,  oBtn9,  oBtn10
   local oBtn11, oBtn12, oBtn13, oBtn14, oBtn15
   local oBtn16, oBtn17, oBtn18, oBtn19, oBtn20
   local oBtn21, oBtn22, oBtn23, oBtn24, oBtn25
   local oBtn26, oBtn27, oBtn28, oBtn29, oBtn30
   local oBtn31, oBtn32, oBtn33, oBtn34, oBtn35
   LOCAL oSay1, oBmp, oFont1
   LOCAL oCursor

   menu oMenu 2007
   endmenu

   DEFINE FONT oFont1 NAME "Arial" SIZE 0,-30 // BOLD
   DEFINE CURSOR oCursor HAND
   DEFINE BRUSH oBrush1 COLOR nRGB(210,210,255) // ,nRGB(255,255,255)
   DEFINE WINDOW oWnd TITLE "RibbonBar Test " + FWVERSION from 1,1 to 600,600 pixel MDI MENU oMenu brush oBrush1

   DEFINE RIBBONBAR oRBar WINDOW oWnd PROMPT "Tab 01", "Tab 02", "Tab 03";
         HEIGHT 130 TOPMARGIN 25

   ADD GROUP oGr  RIBBON oRBar TO OPTION 1 PROMPT "Clipboard" width 130 BITMAP "c:\fwh-908\bitmap\fivetech.BMP"

     @ 02, 05 ADD BUTTON oBtn2 GROUP oGr BITMAP "C:\FWH-908\bitmaps\cut16.BMP" ;
       SIZE 75, 20 PROMPT "Dialog 01"  MOSTLEFT round ;
       action ( Dialog01() )

     @ 24, 05 ADD BUTTON oBtn3 GROUP oGr BITMAP "C:\FWH-908\bitmaps\copy16.BMP" ;
       SIZE 75, 20 PROMPT "Dialog 02"  MOSTLEFT round ;
       action( Dialog02() )

     @ 46, 05 ADD BUTTON oBtn4 GROUP oGr BITMAP "C:\FWH-908\bitmaps\paste16.BMP" ;
       SIZE 75, 20 PROMPT "Dialog 03"  MOSTLEFT round ;
       action( Dialog03() )

   ADD GROUP oGr1 RIBBON oRBar TO OPTION 1 PROMPT "Font" WIDTH 205

     @ 10, 05 ADD BUTTON oBtn5 GROUP oGr1 BITMAP "C:\FWH-908\bitmaps\bold16.bmp" GROUPBUTTON FIRST SIZE 25, 20 ROUND ;
     ACTION( oBtn5:lSelected := !oBtn5:lSelected )

     @ 10, 30 ADD BUTTON oBtn6 GROUP oGr1 BITMAP "C:\FWH-908\bitmaps\italic16.bmp" GROUPBUTTON SIZE 25, 20 ROUND ;
        ACTION( oBtn6:lSelected := !oBtn6:lSelected )

     @ 10, 55 ADD BUTTON oBtn7 GROUP oGr1 BITMAP "C:\FWH-908\bitmaps\underline16.bmp" GROUPBUTTON SIZE 35, 20 ROUND Popup

     @ 10, 90 ADD BUTTON oBtn8 GROUP oGr1 BITMAP "C:\FWH-908\bitmaps\strikethru16.bmp" GROUPBUTTON SIZE 25, 20 ROUND;
        ACTION( oBtn8:lSelected := !oBtn8:lSelected )

     @ 10, 115 ADD BUTTON oBtn9 GROUP oGr1 BITMAP "C:\FWH-908\bitmaps\subindex16.bmp" GROUPBUTTON SIZE 25, 20 ROUND;
        ACTION( oBtn9:lSelected := !oBtn9:lSelected, oBtn10:lSelected := .f., oBtn10:Refresh() )

     @ 10, 140 ADD BUTTON oBtn10 GROUP oGr1 BITMAP "C:\FWH-908\bitmaps\superindex16.bmp" GROUPBUTTON SIZE 25, 20 ROUND ;
        ACTION( oBtn10:lSelected := !oBtn10:lSelected, oBtn9:lSelected := .f., oBtn9:Refresh() )

     @ 10, 165 ADD BUTTON oBtn11 GROUP oGr1 BITMAP "C:\FWH-908\bitmaps\casing16.bmp" GROUPBUTTON END SIZE 35, 20 ROUND POPUP

     @ 40, 05 ADD BUTTON oBtn11 GROUP oGr1 BITMAP "C:\FWH-908\bitmaps\hilight16.bmp" GROUPBUTTON FIRST SIZE 35, 20 ROUND POPUP

     @ 40, 40 ADD BUTTON oBtn12 GROUP oGr1 BITMAP "C:\FWH-908\bitmaps\fontcolor16.bmp" GROUPBUTTON END SIZE 35, 20 ROUND POPUP

     @ 40, 100 ADD BUTTON oBtn13 GROUP oGr1 BITMAP "C:\FWH-908\bitmaps\fontsizeincrease16.bmp" GROUPBUTTON FIRST SIZE 25, 20 ROUND

     @ 40, 125 ADD BUTTON oBtn14 GROUP oGr1 BITMAP "C:\FWH-908\bitmaps\fontsizedecrease16.bmp" GROUPBUTTON END SIZE 25, 20 ROUND

     @ 40, 175 ADD BUTTON oBtn16 GROUP oGr1 BITMAP "C:\FWH-908\bitmaps\style16.bmp" SIZE 25, 20 ROUND BORDER


   ADD GROUP oGr2 RIBBON oRBar TO OPTION 1 PROMPT "Exit" width 70 // BITMAP "c:\fwh-908\bitmap\fivetech.bmp"

     @ 15, 20 ADD BUTTON oBtn4 GROUP oGr2 BITMAP "C:\FWH-908\bitmaps\32x32\quit.BMP" ;
           SIZE 34,52 PROMPT "Exit" action( oWnd:End())

   SET MESSAGE OF oWnd TO "Testing FWH own Class RibbonBar" ;
      CENTERED CLOCK KEYBOARD 2007

   WndCenter(oWnd:hWnd)

   ACTIVATE WINDOW oWnd ON INIT Dialog01() // MAXIMIZED

   oRBar:End()

return nil




Procedure Dialog01()
   LOCAL aCoords:=GetCoors(oWnd:oWndClient), oBrush, oGet, cTxtGet:="Get in Dialog 01"
   LOCAL oFont1, oBmpAlpha
   LOCAL lEscapa:=.F.

   HideDlg( 1 )

   if ValType(oDlgRB[1]) <> "O"
      oBmpAlpha:=TImage():Define(, "c:\fwh-908\Bitmaps\AlphaBmp\World.bmp" )
      DEFINE FONT oFont1 NAME "Ms Sans Serif" SIZE 0,-8 BOLD
      DEFINE BRUSH oBrush FILE "c:\fwh-908\Bitmaps\BackGrnd\Stone.bmp"
      DEFINE DIALOG oDlgRB[1] FROM 0,0 TO 538,782 OF oWnd:oWndClient PIXEL // COLORS RGB(0,0,0),RGB(255,255,255)
         oDlgRB[1]:nStyle := nOR(WS_CHILD) // ,WS_THICKFRAME
         oDlgRB[1]:oBrush := oBrush
         oDlgRB[1]:lTransparent := .T.

      @ 20,20 SAY "Some text bla bla bla in DIALOG 01" OF oDlgRB[1] PIXEL COLOR nRGB(0,0,125) FONT oFont1

      @ 35,20 GET oGet VAR cTxtGet OF oDlgRB[1] PIXEL

      ACTIVATE DIALOG oDlgRB[1] NOWAIT ; //CENTERED
          ON INIT (oDlgRB[1]:Move(aCoords[1]+0,aCoords[2]+0,,,.T.));
          ON PAINT (ABPaint( hDC,335,200, oBmpAlpha:hBitmap, 255 ));
          VALID lEscapa
   else
      oDlgRB[1]:Show()
   endif
Return



Procedure Dialog02()
   LOCAL aCoords:=GetCoors(oWnd:oWndClient), oBrush, oGet, cTxtGet:="Get in Dialog 02"
   LOCAL oFont1, oBmpAlpha
   LOCAL lEscapa:=.F.

   HideDlg( 2 )

   if ValType(oDlgRB[2]) <> "O"
      oBmpAlpha:=TImage():Define(, "c:\fwh-908\Bitmaps\AlphaBmp\World.bmp" )
      DEFINE FONT oFont1 NAME "Ms Sans Serif" SIZE 0,-8 BOLD
      DEFINE BRUSH oBrush FILE "c:\fwh-908\Bitmaps\BackGrnd\Stone.bmp"
      DEFINE DIALOG oDlgRB[2] FROM 0,0 TO 538,782 OF oWnd:oWndClient PIXEL // COLORS RGB(0,0,0),RGB(255,255,255)
         oDlgRB[2]:nStyle := nOR(WS_CHILD) // ,WS_THICKFRAME
         oDlgRB[2]:oBrush := oBrush
         oDlgRB[2]:lTransparent := .T.

         @ 30,30 SAY "Some text bla bla bla in DIALOG 02" OF oDlgRB[2] PIXEL COLOR nRGB(0,0,125) FONT oFont1

         @ 45,30 GET oGet VAR cTxtGet OF oDlgRB[2] PIXEL

      ACTIVATE DIALOG oDlgRB[2] NOWAIT ; //CENTERED
          ON INIT (oDlgRB[2]:Move(aCoords[1]+0,aCoords[2]+0,,,.T.));
          ON PAINT (ABPaint( hDC,365,230, oBmpAlpha:hBitmap, 255 ));
          VALID lEscapa
   else
      oDlgRB[2]:Show()
   endif
Return



Procedure Dialog03()
   LOCAL aCoords:=GetCoors(oWnd:oWndClient), oBrush, oGet, cTxtGet:="Get in Dialog 03"
   LOCAL oFont1, oBmpAlpha
   LOCAL lEscapa:=.F.

   HideDlg( 3 )

   if ValType(oDlgRB[3]) <> "O"
      oBmpAlpha:=TImage():Define(, "c:\fwh-908\Bitmaps\AlphaBmp\World.bmp" )
      DEFINE FONT oFont1 NAME "Ms Sans Serif" SIZE 0,-8 BOLD
      DEFINE BRUSH oBrush FILE "c:\fwh-908\Bitmaps\BackGrnd\Stone.bmp"
      DEFINE DIALOG oDlgRB[3] FROM 0,0 TO 538,782 OF oWnd:oWndClient PIXEL // COLORS RGB(0,0,0),RGB(255,255,255)
         oDlgRB[3]:nStyle := nOR(WS_CHILD) // ,WS_THICKFRAME
         oDlgRB[3]:oBrush := oBrush
         oDlgRB[3]:lTransparent := .T.

         @ 40,40 SAY "Some text bla bla bla in DIALOG 03" OF oDlgRB[3] PIXEL COLOR nRGB(0,0,125) FONT oFont1

         @ 55,40 GET oGet VAR cTxtGet OF oDlgRB[3] PIXEL

      ACTIVATE DIALOG oDlgRB[3] NOWAIT ; //CENTERED
          ON INIT (oDlgRB[3]:Move(aCoords[1]+0,aCoords[2]+0,,,.T.));
          ON PAINT (ABPaint( hDC,395,260, oBmpAlpha:hBitmap, 255 ));
          VALID lEscapa
   else
      oDlgRB[3]:Show()
   endif
Return



Procedure HideDlg( nDlg )
   LOCAL i:=1
   for i:=1 TO Len(oDlgRB)
       if ValType(oDlgRB[i])=="O"
          oDlgRB[i]:Hide()
       endif
   next
Return

Best Regards,

Carlos Gallego
Saludos,

Carlos Gallego

*** FWH-24.07, xHarbour 1.3.1 Build 20240624, Borland C++7.70, PellesC ***
Cgallegoa
 
Posts: 492
Joined: Sun Oct 16, 2005 3:32 am
Location: Quito - Ecuador

Re: DIALOG inside WINDOW

Postby Otto » Fri Sep 11, 2009 8:20 pm

Hello Carlos,

thank you for the sample. Have you modified the ribbon-class.
If I use MDI I get the error “parent no correct”.

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6328
Joined: Fri Oct 07, 2005 7:07 pm

Re: DIALOG inside WINDOW

Postby Cgallegoa » Fri Sep 11, 2009 8:31 pm

Hello Otto,

No, I don´t. I use FWH-908 without modifications.

Best regards,

Carlos Gallego
Saludos,

Carlos Gallego

*** FWH-24.07, xHarbour 1.3.1 Build 20240624, Borland C++7.70, PellesC ***
Cgallegoa
 
Posts: 492
Joined: Sun Oct 16, 2005 3:32 am
Location: Quito - Ecuador

Re: DIALOG inside WINDOW

Postby Otto » Fri Sep 11, 2009 8:52 pm

Hello Carlos, I am still on 9.07. I will download 9.08.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6328
Joined: Fri Oct 07, 2005 7:07 pm

Re: DIALOG inside WINDOW

Postby fraxzi » Sat Sep 12, 2009 2:46 am

Hello Otto,

Sorry I cant help you with RibbonBar... My FWH is only 9.01...


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: DIALOG inside WINDOW

Postby Otto » Sat Sep 12, 2009 6:17 pm

Hello Carlos,
now with version 9.08 all is working. Thank for this sample.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6328
Joined: Fri Oct 07, 2005 7:07 pm

Re: DIALOG inside WINDOW

Postby Cgallegoa » Sat Sep 12, 2009 6:58 pm

Hello Otto,

It's a pleasure.

See new example. Now moving between Tab´s:

http://forums.fivetechsupport.com/viewtopic.php?f=3&t=16679

Best Regards,

Carlos Gallego
Saludos,

Carlos Gallego

*** FWH-24.07, xHarbour 1.3.1 Build 20240624, Borland C++7.70, PellesC ***
Cgallegoa
 
Posts: 492
Joined: Sun Oct 16, 2005 3:32 am
Location: Quito - Ecuador


Return to FiveWin for Harbour/xHarbour

Who is online

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