mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +00:00
handle Wide attribute of floats in their dialog (from Juergen S)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4772 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
3ab3886ba6
commit
6c3456a115
@ -3,6 +3,7 @@
|
||||
* MenuBackend.C (expand): move from Menu to MenuBackend; pass a
|
||||
Menu as first parameter. Now, this calls itself recursively to
|
||||
expand a whole tree (this will be useful for TOC handling)
|
||||
(expandFloatInsert): remove 'wide' version of floats
|
||||
|
||||
* MenuBackend.h (submenuname): returns the name of the submenu.
|
||||
(submenu): returns the submenu itself, provided it has been
|
||||
|
@ -385,13 +385,6 @@ void expandFloatInsert(Menu & tomenu)
|
||||
cit->second.type());
|
||||
string const label = _(cit->second.name());
|
||||
tomenu.add(MenuItem(MenuItem::Command, label, action));
|
||||
|
||||
// and the wide version
|
||||
int const action2 =
|
||||
lyxaction.getPseudoAction(LFUN_INSET_WIDE_FLOAT,
|
||||
cit->second.type());
|
||||
string const label2 = label + _(" (wide)");
|
||||
tomenu.add(MenuItem(MenuItem::Command, label2, action2));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,3 +1,8 @@
|
||||
2002-07-24 Juergen Spitzmueller <j.spitzmueller@gmx.de>
|
||||
|
||||
* ControlFloat.[Ch]: Implement Wide Float toggle
|
||||
Replace "allow_here_definitely" by "wide"
|
||||
|
||||
2002-07-22 Herbert Voss <voss@lyx.org>
|
||||
|
||||
* ControlGraphics.C: small changes
|
||||
|
@ -16,6 +16,7 @@
|
||||
#endif
|
||||
|
||||
#include "ControlFloat.h"
|
||||
#include "BufferView.h"
|
||||
|
||||
|
||||
ControlFloat::ControlFloat(LyXView & lv, Dialogs & d)
|
||||
@ -26,6 +27,9 @@ ControlFloat::ControlFloat(LyXView & lv, Dialogs & d)
|
||||
void ControlFloat::applyParamsToInset()
|
||||
{
|
||||
inset()->placement(params().placement);
|
||||
inset()->wide(params().wide);
|
||||
lv_.view()->updateInset(inset(), true);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -41,11 +45,11 @@ FloatParams const ControlFloat::getParams(InsetFloat const & inset)
|
||||
|
||||
FloatParams::FloatParams()
|
||||
: placement("htbp"),
|
||||
allow_here_definitely(true)
|
||||
wide(false)
|
||||
{}
|
||||
|
||||
|
||||
FloatParams::FloatParams(InsetFloat const & inset)
|
||||
: placement(inset.placement()),
|
||||
allow_here_definitely(!inset.wide())
|
||||
wide(inset.wide())
|
||||
{}
|
||||
|
@ -33,14 +33,14 @@ struct FloatParams {
|
||||
///
|
||||
string placement;
|
||||
///
|
||||
bool allow_here_definitely;
|
||||
bool wide;
|
||||
};
|
||||
|
||||
|
||||
inline
|
||||
bool operator==(FloatParams const & p1, FloatParams const & p2)
|
||||
{
|
||||
return p1.placement == p2.placement && p1.allow_here_definitely == p2.allow_here_definitely;
|
||||
return p1.placement == p2.placement && p1.wide == p2.wide;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,3 +1,8 @@
|
||||
2002-07-24 Juergen Spitzmueller <j.spitzmueller@gmx.de>
|
||||
|
||||
* FormFloat.C:
|
||||
* forms/form_float.fd: Implement Wide Float toggle
|
||||
|
||||
2002-07-24 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
|
||||
|
||||
* Menubar_pimpl.C (create_submenu): updates due to changes in
|
||||
|
@ -46,6 +46,7 @@ void FormFloat::build()
|
||||
bc().addReadOnly(dialog_->check_page);
|
||||
bc().addReadOnly(dialog_->check_here);
|
||||
bc().addReadOnly(dialog_->check_here_definitely);
|
||||
bc().addReadOnly(dialog_->check_wide);
|
||||
}
|
||||
|
||||
|
||||
@ -69,6 +70,7 @@ void FormFloat::apply()
|
||||
}
|
||||
}
|
||||
controller().params().placement = placement;
|
||||
controller().params().wide = fl_get_button(dialog_->check_wide);
|
||||
}
|
||||
|
||||
|
||||
@ -103,7 +105,8 @@ void FormFloat::update()
|
||||
fl_set_button(dialog_->check_page, page);
|
||||
fl_set_button(dialog_->check_here, here);
|
||||
fl_set_button(dialog_->check_here_definitely, here_definitely);
|
||||
setEnabled(dialog_->check_here_definitely, controller().params().allow_here_definitely);
|
||||
setEnabled(dialog_->check_here_definitely, !controller().params().wide);
|
||||
fl_set_button(dialog_->check_wide, controller().params().wide);
|
||||
}
|
||||
|
||||
|
||||
@ -121,6 +124,14 @@ ButtonPolicy::SMInput FormFloat::input(FL_OBJECT * ob, long)
|
||||
fl_set_button(dialog_->check_here_definitely, false);
|
||||
}
|
||||
}
|
||||
if (ob == dialog_->check_wide) {
|
||||
if (fl_get_button(dialog_->check_wide)) {
|
||||
fl_set_button(dialog_->check_here_definitely, false);
|
||||
setEnabled(dialog_->check_here_definitely, false);
|
||||
}
|
||||
else
|
||||
setEnabled(dialog_->check_here_definitely, true);
|
||||
}
|
||||
|
||||
return ButtonPolicy::SMI_VALID;
|
||||
}
|
||||
|
@ -9,13 +9,13 @@ Unit of measure: FL_COORD_PIXEL
|
||||
=============== FORM ===============
|
||||
Name: form_float
|
||||
Width: 360
|
||||
Height: 200
|
||||
Height: 240
|
||||
Number of Objects: 12
|
||||
|
||||
--------------------
|
||||
class: FL_BOX
|
||||
type: FLAT_BOX
|
||||
box: 0 0 360 200
|
||||
box: 0 0 360 240
|
||||
boxtype: FL_FLAT_BOX
|
||||
colors: FL_COL1 FL_COL1
|
||||
alignment: FL_ALIGN_CENTER
|
||||
@ -30,42 +30,6 @@ name:
|
||||
callback:
|
||||
argument:
|
||||
|
||||
--------------------
|
||||
class: FL_FRAME
|
||||
type: ENGRAVED_FRAME
|
||||
box: 10 100 340 50
|
||||
boxtype: FL_NO_BOX
|
||||
colors: FL_BLACK FL_COL1
|
||||
alignment: FL_ALIGN_CENTER
|
||||
style: FL_NORMAL_STYLE
|
||||
size: FL_DEFAULT_SIZE
|
||||
lcol: FL_BLACK
|
||||
label:
|
||||
shortcut:
|
||||
resize: FL_RESIZE_ALL
|
||||
gravity: FL_NoGravity FL_NoGravity
|
||||
name:
|
||||
callback:
|
||||
argument:
|
||||
|
||||
--------------------
|
||||
class: FL_LABELFRAME
|
||||
type: ENGRAVED_FRAME
|
||||
box: 10 20 340 80
|
||||
boxtype: FL_NO_BOX
|
||||
colors: FL_BLACK FL_COL1
|
||||
alignment: FL_ALIGN_TOP_LEFT
|
||||
style: FL_BOLD_STYLE
|
||||
size: FL_NORMAL_SIZE
|
||||
lcol: FL_BLACK
|
||||
label: Placement
|
||||
shortcut:
|
||||
resize: FL_RESIZE_ALL
|
||||
gravity: FL_NoGravity FL_NoGravity
|
||||
name:
|
||||
callback:
|
||||
argument:
|
||||
|
||||
--------------------
|
||||
class: FL_CHECKBUTTON
|
||||
type: PUSH_BUTTON
|
||||
@ -159,7 +123,7 @@ argument: 0
|
||||
--------------------
|
||||
class: FL_BUTTON
|
||||
type: NORMAL_BUTTON
|
||||
box: 10 160 80 30
|
||||
box: 10 200 80 30
|
||||
boxtype: FL_UP_BOX
|
||||
colors: FL_COL1 FL_COL1
|
||||
alignment: FL_ALIGN_CENTER
|
||||
@ -177,7 +141,7 @@ argument: 0
|
||||
--------------------
|
||||
class: FL_BUTTON
|
||||
type: RETURN_BUTTON
|
||||
box: 120 160 70 30
|
||||
box: 120 200 70 30
|
||||
boxtype: FL_UP_BOX
|
||||
colors: FL_COL1 FL_COL1
|
||||
alignment: FL_ALIGN_CENTER
|
||||
@ -195,7 +159,7 @@ argument: 0
|
||||
--------------------
|
||||
class: FL_BUTTON
|
||||
type: NORMAL_BUTTON
|
||||
box: 200 160 70 30
|
||||
box: 200 200 70 30
|
||||
boxtype: FL_UP_BOX
|
||||
colors: FL_COL1 FL_COL1
|
||||
alignment: FL_ALIGN_CENTER
|
||||
@ -213,7 +177,7 @@ argument: 0
|
||||
--------------------
|
||||
class: FL_BUTTON
|
||||
type: NORMAL_BUTTON
|
||||
box: 280 160 70 30
|
||||
box: 280 200 70 30
|
||||
boxtype: FL_UP_BOX
|
||||
colors: FL_COL1 FL_COL1
|
||||
alignment: FL_ALIGN_CENTER
|
||||
@ -228,5 +192,41 @@ name: button_close
|
||||
callback: C_FormBaseCancelCB
|
||||
argument: 0
|
||||
|
||||
--------------------
|
||||
class: FL_CHECKBUTTON
|
||||
type: PUSH_BUTTON
|
||||
box: 20 160 30 30
|
||||
boxtype: FL_NO_BOX
|
||||
colors: FL_COL1 FL_YELLOW
|
||||
alignment: FL_ALIGN_CENTER
|
||||
style: FL_NORMAL_STYLE
|
||||
size: FL_DEFAULT_SIZE
|
||||
lcol: FL_BLACK
|
||||
label: Wide Float|#W
|
||||
shortcut:
|
||||
resize: FL_RESIZE_ALL
|
||||
gravity: FL_NoGravity FL_NoGravity
|
||||
name: check_wide
|
||||
callback: C_FormBaseInputCB
|
||||
argument: 0
|
||||
|
||||
--------------------
|
||||
class: FL_LABELFRAME
|
||||
type: ENGRAVED_FRAME
|
||||
box: 10 20 340 130
|
||||
boxtype: FL_NO_BOX
|
||||
colors: FL_BLACK FL_COL1
|
||||
alignment: FL_ALIGN_TOP_LEFT
|
||||
style: FL_NORMAL_STYLE
|
||||
size: FL_DEFAULT_SIZE
|
||||
lcol: FL_BLACK
|
||||
label: Placement
|
||||
shortcut:
|
||||
resize: FL_RESIZE_ALL
|
||||
gravity: FL_NoGravity FL_NoGravity
|
||||
name:
|
||||
callback:
|
||||
argument:
|
||||
|
||||
==============================
|
||||
create_the_forms
|
||||
|
Loading…
Reference in New Issue
Block a user