2 XBROWSEs on a window

2 XBROWSEs on a window

Postby Silvio » Wed Sep 23, 2009 11:41 am

I want to create two xbrowses with two different dbfs in a dialog or a window divided by a horizontal splitter
so that when I resize the window or the dialog the procedure must resize also the xbrowses and the splitter
there is an sample test to create it, please ?
Some can help me to create it please
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: 2 XBROWSEs on a window

Postby sysctrl2 » Wed Sep 23, 2009 10:10 pm

Silvio ,
See c:\fwh\samples\testSP*.PRG

SALUDOS..
Cesar Cortes Cruz
SysCtrl Software
Mexico

' Sin +- FWH es mejor "
User avatar
sysctrl2
 
Posts: 1020
Joined: Mon Feb 05, 2007 7:15 pm

Re: 2 XBROWSEs on a window

Postby Silvio » Thu Sep 24, 2009 9:02 am

sorry but not see xbrowses and ....then my problem is another
I use a Main window and on it a dialog with style nor 4

on this dialog i have two xbrowses one on top and one on bottom and one splitter horizontal between xbrowses

when I resize the main window it not resize the xbrowses look it please :

first

Image



second


Image




third

Image
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: 2 XBROWSEs on a window

Postby ukoenig » Thu Sep 24, 2009 5:59 pm

Hello Silvio,

I started a Test and it looks quite good. It works perfect.
It is not easy, to do what You need. Is this the Solution, You are looking for ?.
I still have to adjust the 2 Browsers ( Height ) to the Splitter-Position for a complete Sample
( like You can see in the Screenshot ).

What I do :
1. I create a Main-Window ( MDI )
2. A MDIChild with a embedded Dialog.

The Main-Window with a Dialog and 2 included browsers with a horizontal Splitter.

Image

Resizing the Main-Window also resizes Dialog and Browser :

Image

I can resize the Dialog inside the Main-Window. The Browsers are also resized.

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: 2 XBROWSEs on a window

Postby Silvio » Thu Sep 24, 2009 6:44 pm

perhaps you not understand me ....
I have a main window NO MDI
On this main window I open a Dialog ::nStyle = nOR( WS_CHILD, 4 )
On this dialog I want insert two xbrowses
There is an horizontal splitter between the xbrowses
each xbrowses have ::left = 120
because on right I must insert a vmenu
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: 2 XBROWSEs on a window

Postby ukoenig » Thu Sep 24, 2009 7:07 pm

Hello Silvio,

to control Resizing from the Main-Window, it works only with MDI,
otherwise You will notice the Problems You posted.
To resize the Dialog together with the Main-Window, works only with this Solution.

Your Post what You asked for :
I use a Main window and on it a dialog with style nor 4
on this dialog i have two xbrowses one on top and one on bottom
and one splitter horizontal between xbrowses
when I resize the main window it not resize the xbrowses

Image

Best Regards
Uwe :lol:
Last edited by ukoenig on Thu Sep 24, 2009 7:16 pm, edited 1 time in total.
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: 2 XBROWSEs on a window

Postby Silvio » Thu Sep 24, 2009 7:16 pm

uwe,
on your picture I see a Main window mdi
and a window child on it

I use a tfsdi mdified to create the dialog and it not run on MDI
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: 2 XBROWSEs on a window

Postby ukoenig » Thu Sep 24, 2009 7:27 pm

Silvio,

the Browsers included inside a normal Dialog.
The Child-Window is only the Container for the Dialog.

Maybe the Code can help a bit for testing :

Code: Select all  Expand view

#include "FiveWin.ch"
#include "Splitter.ch"

static oWnd
static oLbx1, oLbx2, oHSplit1
#define COLOR_BTNFACE   15

FUNCTION Main()
LOCAL cTitle := "Testing Splitter on Dialog in Child-Window"

DEFINE WINDOW oWnd FROM 50, 50 TO 650, 700 PIXEL ;
TITLE cTitle MDI

SET MESSAGE OF oWnd TO cTitle KEYBOARD CLOCK DATE NOINSET
 
ACTIVATE WINDOW  oWnd  ;
ON INIT BuildChild() ;

RETURN NIL

// ---------- Container for the Dialog ----------

FUNCTION BuildChild()
LOCAL oChild
   
DEFINE WINDOW oChild TITLE "A Child Window / Dialog" MDICHILD  MENU TMenu():New() ;
      COLOR 0, GetSysColor( COLOR_BTNFACE )
     
ACTIVATE WINDOW oChild ;
      ON INIT Dialog( oChild )
   
RETURN NIL

// ------- Dialog embedded inside the Child-Window -----------------------------

FUNCTION Dialog(oChild)
LOCAL oDlg

DEFINE DIALOG oDlg FROM 80, 50 TO 600, 500 TITLE "A Dialog Box"  PIXEL OF oWnd

SELECT 1
USE EJEMPLO1.DBF

@ 10,15 LISTBOX oLbx1 FIELDS SIZE 115,150 PIXEL OF oDlg

SELECT 2
USE EJEMPLO2.DBF

@ 160,15 LISTBOX oLbx2 FIELDS SIZE 115,150 PIXEL OF oDlg

@ 155,15 SPLITTER oHSplit1 ;
            HORIZONTAL ;
            PREVIOUS CONTROLS oLbx1 ;
            HINDS CONTROLS oLbx2 ;
            TOP MARGIN 20 ;
            BOTTOM MARGIN 20 ;
            SIZE 450, 4 PIXEL ;
            OF oDlg ;
            _3DLOOK ;
            UPDATE

ACTIVATE DIALOG oDlg ;
NOWAIT ;
ON INIT ChangeParent( oDlg, oChild )
     
oDlg:End()  
oChild:bResized = { || oLbx1:SetSize( oChild:nWidth, oChild:nHeight / 2 + 40 ),;
                                    oLbx2:SetSize( oChild:nWidth, oChild:nHeight / 2 ) }
oChild:SetSize( 600, 500 ) //  Dialog-Size

RETURN NIL

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

FUNCTION ChangeParent( oDlg, oChild )
LOCAL n
   
FOR n = 1 to Len( oDlg:aControls )
      SetParent( oDlg:aControls[ n ]:hWnd, oChild:hWnd )
      AAdd( oChild:aControls, oDlg:aControls[ n ] )
      oDlg:aControls[ n ]:oWnd = oChild
NEXT
   
RETURN 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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 71 guests