[Gambas-user] Sidepanel Problem and solution

Benoit Minisini gambas at ...1...
Tue May 9 22:29:29 CEST 2006


On Monday 08 May 2006 06:45, ron wrote:
> Changes to SidePanel
> My add/change are marked with '<add ron> and '</add ron>
>

Funny, I was debugging the SidePanel before you sent your mail.

> 1) Add Resize event on changes the SidebPanel layout.

OK. I take that.

>
> 2) Correction on 'RAISE PanelShow' (Bug Fix)
>   Orginal the properties are changed after the event instead before.
>   Resulting in Hidden always True, Height/Width always the same.
>
>   Now the Width/Height and Hidden have the correct values.
>   The Raise PanelHidden is after modify properties so PanleShow should
>   be the same way

The Show event is now raised after the side panel is shown. The Hide event is 
now raised before the side panel is hidden, for symetrical reason.

The Dimension property is now read/write, and should always return an accurate 
value, that is independant of the hidden state.

>
> 3) Event transfer from FSidePanel to SidePanel event
>   This add the SidePanel.Resize event.
>

OK.

> Changes are done in the source tree at
> <src>/gambas2-1.9.29/comp/src/gb.form/*
> You can also put the attached files there.
> With make install the are effective to use.
>
> Projects using SidePanel should recompiled to be safe.
> I did on the menubar->properties->components deselect gb.form
> and OK then the same but select gb.form and all was working.
>
>
> In FSidePanel.form
> -- 1a ----------------
> PRIVATE BUTTON_H AS Integer = Desktop.Scale
> PRIVATE BUTTON_W AS Integer = 64
>
> '<add ron>
> EVENT roResizeF
> '</add ron>
>
> PUBLIC SUB _new()
>
>   $bVisible = TRUE
> -- 1b ----------------
> PUBLIC SUB Form_Resize()
>
>   RefreshPanel
> '<add ron>
>   RAISE roResizeF
> '</add ron>
> END
> ======================
>
> -- 2 ----------------
> PUBLIC SUB btnSide_Click()
>
>   IF ME.Parent.Design THEN RETURN
>
>   IF $bVisible THEN
>     ....
>     RefreshPanel
>     RefreshArrow
>     panSide.Lower
>
>     RAISE PanelHide
>   ELSE
>
> '<disabled ron>
> '    RAISE PanelShow ' wrong property values
> '</disabled ron>
>
>     panSide.Raise
>     ME.Parent.Resize($W, $H)
>     $bVisible = TRUE
>
>     RefreshPanel
>     RefreshArrow
> '<add ron>
>     RAISE PanelShow '  correct property values
> '</add ron>
>
>   ENDIF
>
> END
>
> ==================
> In SidePanel.class:
>
> -- 3 -----------------
> PRIVATE $hForm AS FSidePanel
> PRIVATE $bAnimate AS Boolean
>
> '<add ron>
> EVENT Resize
> PUBLIC SUB Form_roResizeF()
>   RAISE Resize
> END
> '</add ron>
>
> PUBLIC SUB _new()
>
>   $hForm = NEW FSidePanel(ME)
> =================
>
>
> Happy fishing gambas,
>
> Ron

Thanks for the patches.

Regards,

-- 
Benoit Minisini





More information about the User mailing list