[Gambas-user] Sidepanel Problem and solution

ron ronstk at ...239...
Mon May 8 06:45:13 CEST 2006


Changes to SidePanel
My add/change are marked with '<add ron> and '</add ron>

1) Add Resize event on changes the SidebPanel layout.

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 

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

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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: FSidePanel.class
Type: application/x-java
Size: 6119 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20060508/3c501657/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SidePanel.class
Type: application/x-java
Size: 1647 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20060508/3c501657/attachment-0001.bin>


More information about the User mailing list