[Gambas-devel] Preview gb.form.md[ia]

Benoit Minisini gambas at ...1...
Sat Aug 5 20:25:13 CEST 2006


On Saturday 05 August 2006 20:05, Ron Onstenk wrote:
> just changed next code in Form_Resize to test and works OK
>
> PUBLIC SUB Form_Resize()
>   DIM showtab AS Boolean
>   showtab = FALSE
>   IF showtab = FALSE THEN tabWorkspace.height = 0
>   IF tabWorkspace.Visible AND showtab THEN
>

Never sets height to 0, it may not work on other GUI components. Use Hide() 
instead.

> > > The child Windows Titlebar can switched complete off. The taskbar must
> > > do it. If they are switched of only resize is possible, no buttons
> > > anymore. Here one of the problems with the close button I must pay
> > > attention to.
> > >
> > > I will look a way to hide it if it is possible in special case.
> > >
> > >
> > > Ron
> >
> > To make your title bar and your resize borders, I think you have to
> > reparent the MDI child window inside some other container that manages
> > them. One can imagine that, in the gb.form.mdi mode, this container keeps
> > being there, but displays only the MDI child window entirely. But this
> > needs some modifications in the gb.form.mdi code, as at the moment all
> > MDI child windows are direct child of the same panel.
> >
> > Regards,
>
> If you ask from the Workspace the child windows you do get
> exactly the same in mda as in mdi
> i.e. GetActiveWindow()  returns exact for both the same Window
>
> ------------------
> CWindow is changed to:
> ' Gambas class file
>
> PUBLIC Window AS Window
> PUBLIC Watcher AS Watcher
> PUBLIC Resizable AS Boolean
> PUBLIC Grid AS Integer
>
> '====== add by ron =======
> PUBLIC wsfra AS Object ' frame  ' panel '
> PUBLIC wslbl AS Label
> PUBLIC wsico AS PictureBox
> PUBLIC wsbtn AS Button
> PUBLIC wsrol AS ToggleButton
> PUBLIC wsmin AS Button
> PUBLIC wstbl AS Object
>

It would be cool if you could use the same naming convention than me :-)

> ------------------
>
> FWorkspace changes but important part:
> PUBLIC SUB _new()
>
>   IF NOT $hTile THEN $hTile = Picture["img/hash.png"]
>
> IF USEMDA THEN
>   tabWorkspace.Orientation = TabStrip.Top
>
>   svwWorkspace.Reparent(ME)
> '  panWorkspace.Reparent(svwWorkspace)
> '  dwgBorder.Reparent(svwWorkspace)
>
>   panWorkspace.Visible = FALSE 'mdi
>   dwgBorder.Visible = FALSE 'mdi
> ' wstbl is one of frame/panel/drawingarea  'mda
>
>   panRightDown.Visible = FALSE 'group
>   panDown.Visible = FALSE
>   panRight.Visible = FALSE
> ENDIF 'USEMDA
>
> END
> ------------------
> Note wstbl has a long story:
>   listbox -> listview  in my old project
>   -> frame	for the first startup making .mda
>   -> panel  as replace for panWorkspace
>   -> drawingarea as replace for dwgBorder
>
> Every client window is dynamic created with sub routine
> inside FWorkspace instead of CWindow.
> --------------------------
> MakeWindow(bResize as boolean)
>   hWin.wsfra = NEW  DrawingArea(svwWorkspace) AS "WSfra"
>   hWin.wslbl = NEW        Label(hWin.wsfra) AS "WSlbl"
>   hWin.wsico = NEW   PictureBox(hWin.wsfra) AS "WSico"
>   hWin.wsbtn = NEW       Button(hWin.wsfra) AS "WSbtn"
>   hWin.wsRol = NEW ToggleButton(hWin.wsfra) AS "WSrol"
>   hWin.wsMin = NEW       Button(hWin.wsfra) AS "WSmin"
>   IF bResize THEN
>    hWin.wstbl = NEW DrawingArea(hWin.wsfra) AS "WStbl"
>   ELSE
>    hWin.wstbl = NEW       Panel(hWin.wsfra) AS "WStbl"
>   ENDIF
>
>   Object.Attach(hWin.wsfra, ME, "WSfra")
>   object.Attach(hwin.wsico, ME, "WSico")
>   Object.Attach(hWin.wslbl, ME, "WSlbl")
>   ....
>   and more
> --------------------------
> FWorkspace_New()
>   ....
> IF USEMDI THEN
>   IF bResize THEN
>     hWin.Reparent(dwgBorder)
>   ELSE
>     hWin.Reparent(panWorkspace)
>   ENDIF
>
>   hWin.Hide
>
>   hWindow = NEW CWindow
> ENDIF 'USEMDI
>
> IF USEMDA THEN
>   ' hWin is the Window to embed, hWindow is Cwindow
>   hWindow = WSnewwindow(bResize) ' returns a CWindow
>   'wstbl is dwgBorder/panWorkspace replacement
>   hWin.Reparent(hWindow.wstbl)
> ENDIF 'USEMDA
>   ....
> ---------------------
>
> This are the essential things of changes .mdi/.mda
>
> Ron

Regards,

-- 
Benoit Minisini





More information about the Devel mailing list