From d68ec289063394f24296ee098f5113e9242f2b0b Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Wed, 28 Apr 2004 10:21:37 +0000 Subject: [PATCH] Bug fix; ensure that all is Ok after the combox is moved with fl_set_object_position et al. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8702 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/xforms/ChangeLog | 6 ++++++ src/frontends/xforms/combox.c | 20 ++++++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index 81fd9b2037..72ed677d35 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,9 @@ +2004-04-28 Angus Leeming + + * combox.c (combox_handle): reset the x,y data for the sub-objects + on receipt of an FL_DRAWLABEL event. Ensures that all is Ok + after the combox has been re-positioned with fl_set_object_position. + 2004-04-19 Angus Leeming * FormPreferences.C: diff --git a/src/frontends/xforms/combox.c b/src/frontends/xforms/combox.c index b4b3094dce..7e9b9b131c 100644 --- a/src/frontends/xforms/combox.c +++ b/src/frontends/xforms/combox.c @@ -374,10 +374,26 @@ combox_handle(FL_OBJECT * ob, int event, FL_Coord mx, FL_Coord my, int key, case FL_DRAW: attrib_change(ob->spec); /* Fall through */ - case FL_DRAWLABEL: + case FL_DRAWLABEL: { + COMBOX_SPEC * sp = ob->spec; + + FL_Coord const xbs = + ob->x + (sp->button_state->x - sp->button_chosen->x); + + if (ob->x != sp->button_chosen->x || + ob->y != sp->button_chosen->y || + xbs != sp->button_state->x || + ob->y != sp->button_state->y) { + + fl_freeze_form(ob->form); + fl_set_object_position(sp->button_chosen, ob->x, ob->y); + fl_set_object_position(sp->button_state, xbs, ob->y); + fl_unfreeze_form(ob->form); + } + fl_draw_object_label(ob); break; - case FL_SHORTCUT: + } case FL_SHORTCUT: show_browser(ob->spec); break; case FL_FREEMEM: {