FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour 2 XBROWSEs on a window
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
2 XBROWSEs on a window
Posted: 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
Posts: 1144
Joined: Mon Feb 05, 2007 07:15 PM
Re: 2 XBROWSEs on a window
Posted: 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 "
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: 2 XBROWSEs on a window
Posted: Thu Sep 24, 2009 09: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





second







third

Best Regards, Saludos



Falconi Silvio
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: 2 XBROWSEs on a window
Posted: Thu Sep 24, 2009 05: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.



Resizing the Main-Window also resizes Dialog and Browser :



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



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: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: 2 XBROWSEs on a window
Posted: Thu Sep 24, 2009 06: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
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: 2 XBROWSEs on a window
Posted: Thu Sep 24, 2009 07: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



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: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: 2 XBROWSEs on a window
Posted: Thu Sep 24, 2009 07: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
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: 2 XBROWSEs on a window
Posted: Thu Sep 24, 2009 07: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 (fw): Select all Collapse
#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 :-)
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.

Continue the discussion