Page 1 of 2

Main window with child windows

Posted: Mon Mar 23, 2009 12:12 pm
by ohaldi
Hello,

I'm looking for a good sample for HGMIDE about a main window with many child windows.
I find some of them in c:\Hmg\SAMPLES\SPLITBOX_2\, but the child window can move outside from the main window.
Could somebody tell me if they are any do download ?

Many thanks in advance for any help.
Otto

Re: Main window with child windows

Posted: Mon Mar 23, 2009 12:19 pm
by esgici
Hello Otto, welcome
ohaldi wrote:Hello,
...
... the child window can move outside from the main window.
...
This is a normal behavior.

Regards

--

Esgici

Re: Main window with child windows

Posted: Mon Mar 23, 2009 1:33 pm
by CCH4CLIPPER
Hi Otto

HMG does not support MDI in the traditional sense.
What is you wanted is clearly child windows within a Main Window i.e MDI programming.
If this is what you want, you will have to use HMG Extended. No worries all your HMG codes can still be used :-)

But be forewarned that HMG Extended codes may not compile in HMG-IDE.

Regards

CCH
http://cch4clipper.blogspot.com

Re: Main window with child windows

Posted: Mon Mar 23, 2009 3:26 pm
by sudip
Hi Otto,

You may use SPLITCHILD window also with hmg.

But, as a learner, I couldn't find any example for this.

Can any one send me an example of SPLITCHILD windows? :)

Regards.

Sudip

Re: Main window with child windows

Posted: Mon Mar 23, 2009 7:18 pm
by esgici
Hi Sudip

sudip wrote: But, as a learner, I couldn't find any example for this.
Can any one send me an example of SPLITCHILD windows? :)

Please look at DEFINE WINDOW SplitChild_1 ( line 94) in C:\hmg\SAMPLES\CONTAINERS\SPLITBOX\demo4.prg.

Regards

--

Esgici

Re: Main window with child windows

Posted: Tue Mar 24, 2009 3:57 am
by sudip
Thank you Esgici,

I compiled the demo previously but didn't go through it precisely (as I thought it's only splitbox demo!!!). There are many hidden treasures within HMG examples. :)

Now, I have a query, can we define a SPLITCHILD window on the fly. For example, by clicking a menuitem one window will be opened within main window ... etc. etc.

With best regards.

Sudip

Re: Main window with child windows

Posted: Tue Mar 24, 2009 5:32 am
by Rathinagiri
Yes. I think it can be.

Re: Main window with child windows

Posted: Tue Mar 24, 2009 6:55 am
by sudip
Hi Rathi,

Any special syntax required or standard splitchild definition will work? (Actually I am facing problem regarding this)

It gives error in following code snippet:

Code: Select all

   DEFINE WINDOW frmCust            ;
      AT 0,0               ;
      WIDTH 635            ;
      HEIGHT 460            ;
      TITLE 'Customer Setup'   ;
      SPLLITCHILD  ;
      FONT 'ARIAL' SIZE 9         ;
      ON INIT   ( OpenTables() , DeactivateEdit() ) ;
      ON RELEASE CloseTables()
Regards

Sudip

Re: Main window with child windows

Posted: Tue Mar 24, 2009 9:48 am
by Rathinagiri
I think you have to specify the parent window by using the word "of" for the splitbox control.

See the sample for splitbox. You have to every time release the splitbox and re-define it.

Re: Main window with child windows

Posted: Tue Mar 24, 2009 11:51 am
by sudip
Hello Rathinagiri,

Thanks a lot.

Sample code is like this

Code: Select all

DEFINE WINDOW SplitChild_1 ; 
	WIDTH 200 ;
	HEIGHT 200 ;
	VIRTUAL WIDTH 400 ;
	VIRTUAL HEIGHT 400 ;
	SPLITCHILD NOCAPTION 
But, here splitchild window is defined within a parent window, not defined on the fly (say, from menu) which I want.

Regards.

Sudip