Skip to content

Commit

Permalink
*** empty log message ***
Browse files Browse the repository at this point in the history
  • Loading branch information
scuri committed Oct 19, 2012
1 parent d9ca840 commit 1e06fd8
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
4 changes: 4 additions & 0 deletions mak.vc9/iuptestgtk.vcproj
Expand Up @@ -266,6 +266,10 @@
RelativePath="..\test\scanf.c"
>
</File>
<File
RelativePath="..\test\scrollbox.c"
>
</File>
<File
RelativePath="..\test\spin.c"
>
Expand Down
2 changes: 1 addition & 1 deletion src/config.mak
Expand Up @@ -41,7 +41,7 @@ SRC = iup_array.c iup_callback.c iup_dlglist.c iup_attrib.c iup_focus.c iup_font
iup_user.c iup_button.c iup_radio.c iup_toggle.c iup_progressbar.c iup_text.c iup_val.c \
iup_box.c iup_hbox.c iup_vbox.c iup_cbox.c iup_class.c iup_classbase.c iup_maskmatch.c \
iup_mask.c iup_maskparse.c iup_tabs.c iup_spin.c iup_list.c iup_getparam.c \
iup_sbox.c iup_normalizer.c iup_tree.c iup_split.c iup_layoutdlg.c iup_recplay.c
iup_sbox.c iup_scrollbox.c iup_normalizer.c iup_tree.c iup_split.c iup_layoutdlg.c iup_recplay.c

ifdef USE_GTK
CHECK_GTK = Yes
Expand Down
17 changes: 12 additions & 5 deletions src/iup_scrollbox.c
Expand Up @@ -25,16 +25,23 @@
|* Canvas Callbacks *|
\*****************************************************************************/

static void iScrollBoxUpdatePosition(Ihandle* ih, int posx, int posy)
static void iScrollBoxUpdatePosition(Ihandle* ih, float posx, float posy)
{
iupBaseSetPosition(ih->firstchild, -posx, -posy);
if (IupGetGlobal("GTKVERSION"))
{
/* In GTK, IupCanvas handle is NOT the actual container of the child native handle */
posx -= (float)ih->x;
posy -= (float)ih->y;
}

iupBaseSetPosition(ih->firstchild, -(int)posx, -(int)posy);
}

static int iScrollBoxScroll_CB(Ihandle *ih, int op, float posx, float posy)
{
if (ih->firstchild)
{
iScrollBoxUpdatePosition(ih->firstchild, (int)posx, (int)posy);
iScrollBoxUpdatePosition(ih, posx, posy);
iupLayoutUpdate(ih->firstchild);
}
(void)op;
Expand All @@ -56,7 +63,7 @@ static void iScrollBoxLayoutUpdate(Ihandle* ih)

if (ih->firstchild)
{
iScrollBoxUpdatePosition(ih->firstchild, (int)IupGetFloat(ih, "POSX"), (int)IupGetFloat(ih, "POSY"));
iScrollBoxUpdatePosition(ih, IupGetFloat(ih, "POSX"), IupGetFloat(ih, "POSY"));
iupLayoutUpdate(ih->firstchild);
}
}
Expand Down Expand Up @@ -89,7 +96,7 @@ static void iScrollBoxSetChildrenPositionMethod(Ihandle* ih, int x, int y)
{
if (ih->firstchild)
{
iScrollBoxUpdatePosition(ih->firstchild, (int)IupGetFloat(ih, "POSX"), (int)IupGetFloat(ih, "POSY"));
iScrollBoxUpdatePosition(ih, IupGetFloat(ih, "POSX"), IupGetFloat(ih, "POSY"));

/* because ScrollBox is a native container,
child position is restarted at (0,0) */
Expand Down
1 change: 1 addition & 0 deletions test/config.mak
Expand Up @@ -64,6 +64,7 @@ SRC += tree.c
SRC += zbox.c
SRC += scanf.c
SRC += sbox.c
SRC += scrollbox.c
SRC += clipboard.c
SRC += split.c

Expand Down

0 comments on commit 1e06fd8

Please sign in to comment.