* BUG: Using style functions on a picture does not crash anymore. But it 
  seems use a "default default" style instead of the current one.

[GB.FORM]
* BUG: SidePanel draw its arrows directly when gb.gtk is used, otherwise 
  the style is not respected (see above).


git-svn-id: svn://localhost/gambas/trunk@3247 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Benoît Minisini 2010-09-30 23:48:49 +00:00
parent fc60aacecc
commit cdb3872751
3 changed files with 21 additions and 6 deletions

View File

@ -2,9 +2,8 @@
{ Form Form
MoveScaled(0,0,97,52)
Arrangement = Arrange.Vertical
{ tv TableView
MoveScaled(3,1,16,16)
MoveScaled(3,1,34,30)
Expand = True
Header = GridView.Both
}
@ -26,4 +25,7 @@
MoveScaled(53,2,8,4)
}
}
{ SidePanel1 SidePanel
MoveScaled(42,5,36,24)
}
}

View File

@ -4,6 +4,7 @@ Static Private $hHandleH As Picture
Static Private $hHandleV As Picture
Private $iOrientation As Integer
Private $iArrowType As Integer
Private $bFixed As Boolean
Private $X As Integer
Private $Y As Integer
@ -245,7 +246,8 @@ Private Sub RefreshArrow()
Endif
End Select
$hArrow = Main.GetArrow(iType, 10)
If Not Component.IsLoaded("gb.gtk") Then $hArrow = Main.GetArrow(iType, 10)
$iArrowType = iType
btnSide.Refresh
btnSide2.Refresh
@ -534,10 +536,16 @@ End
Public Sub btnSide_Draw()
Dim S As Integer
'If Last.Tag Then
' Draw.Style.Button(0, 0, btnSide.W, btnSide.H, Last.Tag = 2)
'Endif
If $hArrow Then Draw.Image($hArrow, (Last.W - $hArrow.W) / 2, (Last.H - $hArrow.H) / 2)
If $hArrow Then
Draw.Image($hArrow, (Last.W - $hArrow.W) / 2, (Last.H - $hArrow.H) / 2)
Else
S = Min(btnSide.W, btnSide.H)
Draw.Style.Arrow((btnSide.W - S) \ 2, (btnSide.H - S) \ 2, S, S, $iArrowType)
Endif
End

View File

@ -327,14 +327,18 @@ GtkStyle *gDraw::style(const char *name, GType type)
stl = NULL;
}
if (!name)
if (!name && _widget)
{
stl = gtk_style_copy(_widget->style);
stl = gtk_style_attach(stl, _widget->window);
}
else
{
stl = gtk_style_copy(gt_get_style(name, type));
if (name)
stl = gtk_style_copy(gt_get_style(name, type));
else
stl = gtk_style_copy(gtk_widget_get_default_style());
stl = gtk_style_attach(stl, (GdkWindow*)dr);
}
@ -653,6 +657,7 @@ void gDraw::setFillStyle(int vl)
Clip Area
***************************************************************************/
int gDraw::clipX()
{
return clip.x;