+2000-11-29 Angus Leeming <a.leeming@ic.ac.uk>
+
+ * src/combox.[Ch] )(add, Show): workaround xforms bug when Show()ing
+ the browser form for a combox in a tabbed folder. Bug fix courtesy of
+ Steve Lamont <spl@ncmir.ucsd.edu>.
+
+ * src/frontends/xforms/FormDocument.C (build):
+ * src/frontends/xforms/FormPreferences.C (Language::build):
+ pass tabfolders to Combox::add() in order to use this work around.
+
+ * src/frontends/xforms/FormCitation.C (connect): remove max size
+ limitation.
+ (update): sort list of bibliography keys.
+
+ * src/frontends/xforms/FormRef.[Ch] (connect, showBrowser, hideBrowser,
+ setSize): removed.
+ No max size limitation. Same popup for new and existing insets. Fixes
+ bugs reported by Rob Lahaye.
+
+ * src/frontends/xforms/FormCitation.C (c-tor):
+ * src/frontends/xforms/FormCopyright.C (c-tor):
+ * src/frontends/xforms/FormError.C (c-tor):
+ * src/frontends/xforms/FormGraphics.C (c-tor):
+ * src/frontends/xforms/FormIndex.C (c-tor):
+ * src/frontends/xforms/FormRef.C (c-tor):
+ * src/frontends/xforms/FormToc.C (c-tor):
+ * src/frontends/xforms/FormUrl.C (c-tor):
+ use correct policy for ButtonController.
+
+ * src/frontends/xforms/FormPreferences.[Ch]: cleaned up a little more.
+
+ * src/frontends/xforms/Menubar_pimpl.C (create_submenu): modified lyxerr
+ call a little.
+
+ * src/frontends/xforms/forms/form_citation.fd: some resizing changes.
+
+ * src/frontends/xforms/forms/form_ref.fd: new Restore, Apply buutons.
+ Some resizing changes.
+
2000-11-28 Lars Gullik Bjønnes <larsbj@lyx.org>
* configure.in: fix typo
extern "C" int C_Combox_peek_event(FL_FORM * form, void *xev);
Combox::Combox(combox_type t)
- : type(t)
+ : type(t), tabfolder1(0), tabfolder2(0)
{
browser = button = 0;
callback = 0;
}
-void Combox::add(int x, int y, int w, int hmin, int hmax)
-{
+void Combox::add(int x, int y, int w, int hmin, int hmax,
+ FL_OBJECT * tabfolder1_, FL_OBJECT * tabfolder2_)
+{
+ // Store these for later use in working round an xforms bug in Show()
+ tabfolder1 = tabfolder1_;
+ tabfolder2 = tabfolder2_;
+
FL_OBJECT * obj;
switch (type) {
fl_set_object_label(button, "@2<-");
fl_redraw_object(button);
}
- int x = label->form->x + label->x, y = label->form->y + label->y;
- fl_set_form_position(form, x, y + label->h);
+
+ int x = label->x;
+ int y = label->y + label->h;
+ if (tabfolder1) {
+ // This is a bug work around suggested by Steve Lamont on the
+ // xforms mailing list. It correctly positions the browser form
+ // after the main window has been moved.
+ // The bug only occurs in tabbed folders.
+ int folder_x, folder_y, folder_w, folder_h;
+ fl_get_folder_area( tabfolder1,
+ &folder_x, &folder_y,
+ &folder_w, &folder_h );
+ x += folder_x;
+ y += folder_y;
+
+ if (tabfolder2) {
+ fl_get_folder_area( tabfolder2,
+ &folder_x, &folder_y,
+ &folder_w, &folder_h );
+ x += tabfolder2->form->x + folder_x;
+ y += tabfolder2->form->y + folder_y;
+ } else {
+ x += tabfolder1->form->x;
+ y += tabfolder1->form->y;
+ }
+
+ } else {
+ x += label->form->x;
+ y += label->form->y;
+ }
+
+ fl_set_form_position(form, x, y);
fl_show_form(form, FL_PLACE_POSITION, FL_NOBORDER, "");
if (sel>0) {
fl_set_browser_topline(browser, sel);
~Combox();
/** To add this object to a form. Note that there are two heights
- for normal (button) and expanded (browser) mode each.
+ for normal (button) and expanded (browser) mode each.
+ The optional tabfolder arguments are needed to overcome an
+ xforms bug when repositioning a combox in a tab folder.
+ tabfolder1_ is the folder holding the combox.
+ If using nested tabfolders, tabfolder2_ is the "base" folder
+ holding tabfolder1_.
*/
- void add(int x, int y, int w, int hmin, int hmax);
+ void add(int x, int y, int w, int hmin, int hmax,
+ FL_OBJECT * tabfolder1_ = 0, FL_OBJECT * tabfolder2_ = 0);
/// Add lines. Same as for fl_browser object
void addline(string const &);
FL_OBJECT * label;
///
FL_FORM* form;
+ ///
+ FL_OBJECT * tabfolder1;
+ ///
+ FL_OBJECT * tabfolder2;
};
#include "lyxfunc.h"
#include "support/filetools.h"
-using std::vector;
-using std::pair;
+using std::find;
using std::max;
using std::min;
-using std::find;
+using std::pair;
+using std::sort;
+using std::vector;
FormCitation::FormCitation(LyXView * lv, Dialogs * d)
- : FormCommand(lv, d, _("Citation"), new OkApplyCancelReadOnlyPolicy),
+ : FormCommand(lv, d, _("Citation"), new NoRepeatedApplyReadOnlyPolicy),
dialog_(0)
{
// let the dialog be shown
void FormCitation::connect()
{
- fl_set_form_maxsize( dialog_->form, 3*minw_, minh_ );
+ //fl_set_form_maxsize( dialog_->form, 3*minw_, minh_ );
FormCommand::connect();
}
vector<pair<string,string> > blist =
lv_->buffer()->getBibkeyList();
+ sort(blist.begin(), blist.end());
for (unsigned int i = 0; i < blist.size(); ++i) {
bibkeys.push_back(blist[i].first);
#include "xform_helpers.h"
FormCopyright::FormCopyright( LyXView * lv, Dialogs * d )
- : FormBaseBI(lv, d, _("Copyright and Warranty"),
- new OkApplyCancelPolicy),
+ : FormBaseBI(lv, d, _("Copyright and Warranty"), new OkCancelPolicy),
dialog_(0)
{
// let the dialog be shown
obj = class_->choice_doc_class;
fl_addto_form(class_->form);
combo_doc_class = new Combox(FL_COMBOX_DROPLIST);
- combo_doc_class->add(obj->x, obj->y, obj->w, obj->h, 400);
+ combo_doc_class->add(obj->x, obj->y, obj->w, obj->h, 400,
+ dialog_->tabbed_folder);
combo_doc_class->shortcut("#C",1);
combo_doc_class->setcallback(ComboInputCB, this);
fl_end_form();
obj = language_->choice_language;
fl_addto_form(language_->form);
combo_language = new Combox(FL_COMBOX_DROPLIST);
- combo_language->add(obj->x, obj->y, obj->w, obj->h, 400);
+ combo_language->add(obj->x, obj->y, obj->w, obj->h, 400,
+ dialog_->tabbed_folder);
combo_language->shortcut("#L",1);
combo_language->setcallback(ComboInputCB, this);
fl_end_form();
FormError::FormError(LyXView * lv, Dialogs * d)
- : FormInset( lv, d, _("LaTeX Error"), new OkApplyCancelPolicy),
+ : FormInset( lv, d, _("LaTeX Error"), new OkCancelPolicy),
dialog_(0), inset_(0)
{
Assert(lv && d);
FormGraphics::FormGraphics(LyXView * lv, Dialogs * d)
- : FormInset(lv, d, _("Graphics"), new OkApplyCancelReadOnlyPolicy),
+ : FormInset(lv, d, _("Graphics"), new NoRepeatedApplyReadOnlyPolicy),
dialog_(0), inset_(0),
// The buttons c-tor values are the number of buttons we use
// This is only to reduce memory waste.
#include "lyxfunc.h"
FormIndex::FormIndex(LyXView * lv, Dialogs * d)
- : FormCommand(lv, d, _("Index"), new OkApplyCancelReadOnlyPolicy),
+ : FormCommand(lv, d, _("Index"), new NoRepeatedApplyPolicy),
dialog_(0)
{
// let the dialog be shown
AdjustVal(FL_RIGHT_BCOL, FL_COL1, -0.5);
AdjustVal(FL_BOTTOM_BCOL, FL_COL1, -0.5);
- }
+ }
+
+ if ((*cit).colorID == GUI_COLOR_CURSOR) {
+ fl_mapcolor(GUI_COLOR_CURSOR,
+ (*cit).r, (*cit).g, (*cit).b);
+ fl_set_cursor_color(FL_DEFAULT_CURSOR,
+ GUI_COLOR_CURSOR, FL_WHITE);
+ }
}
Dialogs::redrawGUI();
}
if (cit2 == colorDB.end()) continue;
if (lcolor.getX11Name(lc) != (*cit2).getname()) {
- lyxerr << "FormPreferences::Colors::apply: "
- << "resetting LColor " << lcolor.getGUIName(lc)
- << " from \"" << lcolor.getX11Name(lc)
- << "\" to \"" << (*cit2).getname() << "\"."
- << endl;
+ lyxerr[Debug::GUI]
+ << "FormPreferences::Colors::apply: "
+ << "resetting LColor " << lcolor.getGUIName(lc)
+ << " from \"" << lcolor.getX11Name(lc)
+ << "\" to \"" << (*cit2).getname() << "\"."
+ << endl;
string const arg =
lcolor.getLyXName(lc) + string(" ") +
{
dialog_ = parent_.build_colors();
- fl_set_object_color(dialog_->button_color, FL_FREE_COL1, FL_FREE_COL1);
+ fl_set_object_color(dialog_->button_color,
+ GUI_COLOR_CHOICE, GUI_COLOR_CHOICE);
- fl_set_object_color(dialog_->dial_hue, FL_FREE_COL2, FL_BLACK);
+ fl_set_object_color(dialog_->dial_hue, GUI_COLOR_HUE_DIAL, FL_BLACK);
fl_set_dial_return(dialog_->dial_hue, FL_RETURN_CHANGED);
fl_set_dial_bounds(dialog_->dial_hue, 0.0, 360.0);
vector<NamedColor>::const_iterator cit =
find(colorDB.begin(), colorDB.end(), color);
- if (cit == colorDB.end()) return;
+ if (cit == colorDB.end()) return;
int const j = static_cast<int>(cit - colorDB.begin());
fl_freeze_form(dialog_->form);
RGBColor const & col = colorDB[i-1].color();
- fl_mapcolor(FL_FREE_COL1, col.r, col.g, col.b);
+ fl_mapcolor(GUI_COLOR_CHOICE, col.r, col.g, col.b);
fl_redraw_object(dialog_->button_color);
HSVColor hsv(col);
fl_set_slider_value(dialog_->slider_value, hsv.v);
RGBColor col2 = HSVColor(hsv.h, 1.0, 1.0);
- fl_mapcolor(FL_FREE_COL2, col2.r, col2.g, col2.b);
+ fl_mapcolor(GUI_COLOR_HUE_DIAL, col2.r, col2.g, col2.b);
fl_redraw_object(dialog_->dial_hue);
// Is it valid to activate the "Modify" button?
fl_set_browser_topline(dialog_->browser_x11, max(i-5, 1));
fl_select_browser_line(dialog_->browser_x11, i+1);
- fl_mapcolor(FL_FREE_COL1, col.r, col.g, col.b);
+ fl_mapcolor(GUI_COLOR_CHOICE, col.r, col.g, col.b);
fl_redraw_object(dialog_->button_color);
// Only activate the "Modify" button if the browser and slider colors
// Finally, modify the color of the dial.
col = HSVColor(hue, 1.0, 1.0);
- fl_mapcolor(FL_FREE_COL2, col.r, col.g, col.b);
+ fl_mapcolor(GUI_COLOR_HUE_DIAL, col.r, col.g, col.b);
fl_redraw_object(dialog_->dial_hue);
fl_unfreeze_form(dialog_->form);
xcol.colorID = FL_BLACK;
fl_getmcolor(FL_BLACK, &xcol.r, &xcol.g, &xcol.b);
- xformColorDB.push_back(xcol);
+ fl_mapcolor(GUI_COLOR_CURSOR, xcol.r, xcol.g, xcol.b);
+ fl_set_cursor_color(FL_DEFAULT_CURSOR, GUI_COLOR_CURSOR, FL_WHITE);
- // FL_LIGHTER_COL1 does not exist in xforms 0.88
- // xcol.name = "GUI active tab";
- // xcol.colorID = FL_LIGHTER_COL1;
- // fl_getmcolor(FL_LIGHTER_COL1, &xcol.r, &xcol.g, &xcol.b);
- //
- // xformColorDB.push_back(xcol);
+ xformColorDB.push_back(xcol);
xcol.name = "GUI selection";
xcol.colorID = FL_YELLOW;
xformColorDB.push_back(xcol);
+ xcol.name = "GUI pointer";
+ xcol.colorID = GUI_COLOR_CURSOR;
+ fl_getmcolor(GUI_COLOR_CURSOR, &xcol.r, &xcol.g, &xcol.b);
+
+ xformColorDB.push_back(xcol);
+
// Now create the the LyX LColors database
lyxColorDB.clear();
for (int i=0; i<LColor::ignore; ++i) {
FL_OBJECT * obj = dialog_->choice_default_lang;
fl_deactivate_object(dialog_->choice_default_lang);
combo_default_lang = new Combox(FL_COMBOX_DROPLIST);
- combo_default_lang->add(obj->x, obj->y, obj->w, obj->h, 400);
+ combo_default_lang->add(obj->x, obj->y, obj->w, obj->h, 400,
+ parent_.lang_opts_tab_->tabfolder_outer,
+ parent_.dialog_->tabfolder_prefs);
combo_default_lang->shortcut("#L",1);
combo_default_lang->setcallback(ComboCB, &parent_);
// This is safe, as nothing is done to the pointer, other than
// to use its address in a block-if statement.
+ // No it's not! Leads to crash.
// setPreHandler(
// reinterpret_cast<FL_OBJECT *>(combo_default_lang),
// C_FormPreferencesFeedbackCB);
class Colors {
public:
+ ///
+ enum GuiColors {
+ GUI_COLOR_CHOICE = FL_FREE_COL1,
+ GUI_COLOR_HUE_DIAL = FL_FREE_COL2,
+ GUI_COLOR_CURSOR = FL_FREE_COL3
+ };
///
Colors( FormPreferences & p ) : parent_(p), dialog_(0) {}
///
#include <algorithm>
+using std::find;
+using std::max;
using std::sort;
using std::vector;
-static int const minw_hb = 250;
-static int minw_sb;
-
FormRef::FormRef(LyXView * lv, Dialogs * d)
- : FormCommand(lv, d, _("Reference"), new OkCancelReadOnlyPolicy),
+ : FormCommand(lv, d, _("Reference"), new NoRepeatedApplyPolicy),
toggle(GOBACK), dialog_(0)
{
// let the dialog be shown
}
-void FormRef::connect()
-{
- fl_set_form_maxsize(form(), 2 * minw_, minh_);
- FormCommand::connect();
-}
-
-
void FormRef::disconnect()
{
refs.clear();
// Workaround dumb xforms sizing bug
minw_ = form()->w;
minh_ = form()->h;
- minw_sb = minw_;
- // Name is irrelevant to LaTeX documents
- if (lv_->buffer()->isLatex()) {
- fl_deactivate_object(dialog_->name);
- fl_set_object_lcol(dialog_->name, FL_INACTIVE);
- }
-
- // Can change reference only through browser
+ // Force the user to use the browser to change refs.
fl_deactivate_object(dialog_->ref);
// Manage the ok and cancel/close buttons
bc_.setOK(dialog_->button_ok);
+ bc_.setApply(dialog_->button_apply);
bc_.setCancel(dialog_->button_cancel);
+ bc_.setUndoAll(dialog_->button_restore);
bc_.refresh();
bc_.addReadOnly(dialog_->type);
+ bc_.addReadOnly(dialog_->name);
}
fl_set_input(dialog_->name, params.getOptions().c_str());
Type type = getType();
- fl_set_choice(dialog_->type, type + 1);
+ fl_set_choice(dialog_->type, type+1);
toggle = GOBACK;
fl_set_object_label(dialog_->button_go, _("Goto reference"));
- refs.clear();
+ // Name is irrelevant to LaTeX documents
+ if (lv_->buffer()->isLatex()) {
+ fl_deactivate_object(dialog_->name);
+ fl_set_object_lcol(dialog_->name, FL_INACTIVE);
+ }
+
+ refs = lv_->buffer()->getLabelList();
+ updateBrowser(refs);
+
if (inset_ == 0) {
- refs = lv_->buffer()->getLabelList();
- updateBrowser(refs);
- showBrowser();
} else {
- hideBrowser();
}
+
bc_.readOnly(lv_->buffer()->isReadonly());
}
fl_set_object_lcol(dialog_->button_update, FL_BLACK);
fl_activate_object(dialog_->sort);
fl_set_object_lcol(dialog_->sort, FL_BLACK);
- }
-}
-
-
-void FormRef::showBrowser() const
-{
- fl_show_object(dialog_->browser);
- fl_show_object(dialog_->button_update);
- fl_show_object(dialog_->sort);
-
- setSize(minw_sb, 0);
-
- fl_deactivate_object(dialog_->type);
- fl_set_object_lcol(dialog_->type, FL_INACTIVE);
- fl_deactivate_object(dialog_->button_go);
- fl_set_object_lcol(dialog_->button_go, FL_INACTIVE);
- fl_set_object_lcol(dialog_->ref, FL_INACTIVE);
- bc_.valid(false);
-}
+ string ref = fl_get_input(dialog_->ref);
+ vector<string>::const_iterator cit =
+ find(refs.begin(), refs.end(), ref);
-void FormRef::hideBrowser() const
-{
- fl_hide_object(dialog_->browser);
- fl_hide_object(dialog_->button_update);
- fl_hide_object(dialog_->sort);
-
- setSize(minw_hb, 280);
-
- fl_activate_object(dialog_->type);
- fl_set_object_lcol(dialog_->type, FL_BLACK);
- fl_activate_object(dialog_->button_go);
- fl_set_object_lcol(dialog_->button_go, FL_BLACK);
- fl_set_object_lcol(dialog_->ref, FL_BLACK);
- bc_.invalid();
-}
-
-
-void FormRef::setSize(int w, int dx) const
-{
- static int x1 = dialog_->name->x;
- static int y1 = dialog_->name->y;
- static int x2 = dialog_->ref->x;
- static int y2 = dialog_->ref->y;
- static int x3 = dialog_->type->x;
- static int y3 = dialog_->type->y;
- static int x4 = dialog_->button_go->x;
- static int y4 = dialog_->button_go->y;
- static int x5 = dialog_->button_ok->x;
- static int y5 = dialog_->button_ok->y;
- static int x6 = dialog_->button_cancel->x;
- static int y6 = dialog_->button_cancel->y;
-
- if (form()->w != w) {
- minw_ = w;
- fl_set_form_size(form(), minw_, minh_);
- } else
- return;
-
- fl_set_object_position(dialog_->name, x1 - dx, y1);
- fl_set_object_position(dialog_->ref, x2 - dx, y2);
- fl_set_object_position(dialog_->type, x3 - dx, y3);
- fl_set_object_position(dialog_->button_go, x4 - dx, y4);
- fl_set_object_position(dialog_->button_ok, x5 - dx, y5);
- fl_set_object_position(dialog_->button_cancel, x6 - dx, y6);
-
- // These two must be reset apparently
- // Name is irrelevant to LaTeX documents
- if (lv_->buffer()->isLatex()) {
- fl_deactivate_object(dialog_->name);
- fl_set_object_lcol(dialog_->name, FL_INACTIVE);
+ if (cit != refs.end()) {
+ int const i = static_cast<int>(cit - refs.begin());
+ fl_set_browser_topline(dialog_->browser, max(i-5, 1));
+ fl_select_browser_line(dialog_->browser, i+1);
+ }
}
-
- // Can change reference only through browser
- fl_deactivate_object(dialog_->ref);
}
params.setCmdName(getName(type));
params.setOptions(fl_get_input(dialog_->name));
+ params.setContents(fl_get_input(dialog_->ref));
if (inset_ != 0) {
// Only update if contents have changed
}
-#ifdef WITH_WARNINGS
-#warning check use of buttoncontroller
-// Seems okay except that goref and goback shouldn't
-// affect the status of ok.
-#endif
bool FormRef::input(FL_OBJECT *, long data)
{
bool activate(true);
// goto reference / go back
case 1:
{
+ // No change to data
+ activate = false;
+
toggle = static_cast<Goto>(toggle + 1);
if (toggle == GOFIRST ) toggle = GOREF;
unsigned int sel = fl_get_browser(dialog_->browser);
if (sel < 1 || sel > refs.size()) break;
- string s = fl_get_browser_line(dialog_->browser, sel);
- fl_set_input(dialog_->ref, s.c_str());
- params.setContents(s);
+ if (!lv_->buffer()->isReadonly()) {
+ string s = fl_get_browser_line(dialog_->browser, sel);
+ fl_set_input(dialog_->ref, s.c_str());
+ }
toggle = GOBACK;
lv_->getLyXFunc()->Dispatch(LFUN_REF_BACK);
default:
break;
}
+
return activate;
}
GOFIRST
};
- /// Connect signals etc. Set form's max size.
- virtual void connect();
/// Disconnect signals. Also perform any necessary housekeeping.
virtual void disconnect();
///
void updateBrowser(std::vector<string> const &) const;
///
- void showBrowser() const;
- ///
- void hideBrowser() const;
- ///
- void setSize(int, int) const;
- ///
FD_form_ref * build_ref();
///
Type getType() const;
// confusing to the button controller so I've made an IgnorantPolicy to cover
// this situation since the dialog doesn't care about buttons. ARRae 20001013
FormToc::FormToc(LyXView * lv, Dialogs * d)
- : FormCommand(lv, d, _("Table of Contents"), new OkApplyCancelPolicy),
+ : FormCommand(lv, d, _("Table of Contents"), new OkCancelPolicy),
dialog_(0)
{
// let the dialog be shown
#include "lyxfunc.h"
FormUrl::FormUrl(LyXView * lv, Dialogs * d)
- : FormCommand(lv, d, _("Url"), new OkApplyCancelReadOnlyPolicy),
+ : FormCommand(lv, d, _("Url"), new NoRepeatedApplyReadOnlyPolicy),
dialog_(0)
{
// let the dialog be shown
lyxerr[Debug::GUI] << "Command: \""
<< lyxaction.getActionName(item.action())
- << "\", Binding " << accel
- << ", shortcut " << shortcut
- << endl;
-
-
+ << "\", binding \"" << accel
+ << "\", shortcut \"" << shortcut
+ << "\"" << endl;
break;
}
fdui->form = fl_bgn_form(FL_NO_BOX, 435, 665);
fdui->form->u_vdata = this;
fdui->box = obj = fl_add_box(FL_UP_BOX, 0, 0, 435, 665, "");
- fl_set_object_resize(obj, FL_RESIZE_X);
fdui->citeBrsr = obj = fl_add_browser(FL_HOLD_BROWSER, 10, 30, 180, 300, idex(_("Inset keys|#I")));
fl_set_button_shortcut(obj, scex(_("Inset keys|#I")), 1);
fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT);
+ fl_set_object_gravity(obj, FL_NorthWest, FL_South);
fl_set_object_resize(obj, FL_RESIZE_X);
fl_set_object_callback(obj, C_FormBaseInputCB, CITEBRSR);
fdui->bibBrsr = obj = fl_add_browser(FL_HOLD_BROWSER, 240, 30, 180, 300, idex(_("Bibliography keys|#B")));
fl_set_button_shortcut(obj, scex(_("Bibliography keys|#B")), 1);
fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT);
+ fl_set_object_gravity(obj, FL_North, FL_SouthEast);
fl_set_object_resize(obj, FL_RESIZE_X);
fl_set_object_callback(obj, C_FormBaseInputCB, BIBBRSR);
fdui->addBtn = obj = fl_add_button(FL_NORMAL_BUTTON, 200, 30, 30, 30, _("@4->"));
fl_set_button_shortcut(obj, _("#&D"), 1);
+ fl_set_object_gravity(obj, FL_North, FL_North);
fl_set_object_resize(obj, FL_RESIZE_NONE);
fl_set_object_callback(obj, C_FormBaseInputCB, ADD);
fdui->delBtn = obj = fl_add_button(FL_NORMAL_BUTTON, 200, 65, 30, 30, _("@9+"));
fl_set_button_shortcut(obj, _("#X"), 1);
+ fl_set_object_gravity(obj, FL_North, FL_North);
fl_set_object_resize(obj, FL_RESIZE_NONE);
fl_set_object_callback(obj, C_FormBaseInputCB, DELETE);
fdui->upBtn = obj = fl_add_button(FL_NORMAL_BUTTON, 200, 100, 30, 30, _("@8->"));
fl_set_button_shortcut(obj, _("#&A"), 1);
+ fl_set_object_gravity(obj, FL_North, FL_North);
fl_set_object_resize(obj, FL_RESIZE_NONE);
fl_set_object_callback(obj, C_FormBaseInputCB, UP);
fdui->downBtn = obj = fl_add_button(FL_NORMAL_BUTTON, 200, 135, 30, 30, _("@2->"));
fl_set_button_shortcut(obj, _("#&B"), 1);
+ fl_set_object_gravity(obj, FL_North, FL_North);
fl_set_object_resize(obj, FL_RESIZE_NONE);
fl_set_object_callback(obj, C_FormBaseInputCB, DOWN);
fdui->infoBrsr = obj = fl_add_browser(FL_NORMAL_BROWSER, 10, 360, 410, 80, _("Info"));
fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT);
- fl_set_object_resize(obj, FL_RESIZE_X);
+ fl_set_object_gravity(obj, FL_SouthWest, FL_SouthEast);
+ fl_set_object_resize(obj, FL_RESIZE_NONE);
fdui->style = obj = fl_add_choice(FL_NORMAL_CHOICE, 160, 470, 130, 30, idex(_("Citation style|#s")));
fl_set_button_shortcut(obj, scex(_("Citation style|#s")), 1);
fl_set_object_boxtype(obj, FL_DOWN_BOX);
- fl_set_object_resize(obj, FL_RESIZE_X);
+ fl_set_object_gravity(obj, FL_SouthWest, FL_SouthEast);
+ fl_set_object_resize(obj, FL_RESIZE_NONE);
fdui->textBefore = obj = fl_add_input(FL_NORMAL_INPUT, 100, 520, 250, 30, idex(_("Text before|#T")));
fl_set_button_shortcut(obj, scex(_("Text before|#T")), 1);
- fl_set_object_resize(obj, FL_RESIZE_X);
+ fl_set_object_gravity(obj, FL_SouthWest, FL_SouthEast);
+ fl_set_object_resize(obj, FL_RESIZE_NONE);
fdui->textAftr = obj = fl_add_input(FL_NORMAL_INPUT, 100, 570, 250, 30, idex(_("Text after|#e")));
fl_set_button_shortcut(obj, scex(_("Text after|#e")), 1);
- fl_set_object_resize(obj, FL_RESIZE_X);
+ fl_set_object_gravity(obj, FL_SouthWest, FL_SouthEast);
+ fl_set_object_resize(obj, FL_RESIZE_NONE);
fdui->button_restore = obj = fl_add_button(FL_NORMAL_BUTTON, 10, 630, 90, 30, idex(_("Restore|#R")));
fl_set_button_shortcut(obj, scex(_("Restore|#R")), 1);
fl_set_object_gravity(obj, FL_SouthWest, FL_SouthWest);
fdui->form = fl_bgn_form(FL_NO_BOX, 530, 340);
fdui->form->u_vdata = this;
obj = fl_add_box(FL_UP_BOX, 0, 0, 530, 340, "");
- fdui->browser = obj = fl_add_browser(FL_HOLD_BROWSER, 10, 10, 270, 280, "");
+ fdui->browser = obj = fl_add_browser(FL_HOLD_BROWSER, 10, 10, 270, 240, "");
fl_set_object_lalign(obj, FL_ALIGN_TOP);
- fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
- fl_set_object_resize(obj, FL_RESIZE_X);
+ fl_set_object_gravity(obj, FL_NorthWest, FL_South);
fl_set_object_callback(obj, C_FormBaseInputCB, 2);
- fdui->button_update = obj = fl_add_button(FL_NORMAL_BUTTON, 40, 300, 90, 30, idex(_("Update|#U")));
+ fdui->button_update = obj = fl_add_button(FL_NORMAL_BUTTON, 40, 260, 90, 30, idex(_("Update|#U")));
fl_set_button_shortcut(obj, scex(_("Update|#U")), 1);
- fl_set_object_resize(obj, FL_RESIZE_NONE);
+ fl_set_object_gravity(obj, FL_SouthWest, FL_SouthWest);
fl_set_object_callback(obj, C_FormBaseInputCB, 3);
- fdui->sort = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 170, 300, 30, 30, idex(_("Sort|#S")));
+ fdui->sort = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 170, 260, 30, 30, idex(_("Sort|#S")));
fl_set_button_shortcut(obj, scex(_("Sort|#S")), 1);
fl_set_object_lalign(obj, FL_ALIGN_RIGHT);
- fl_set_object_resize(obj, FL_RESIZE_NONE);
+ fl_set_object_gravity(obj, FL_SouthWest, FL_SouthWest);
fl_set_object_callback(obj, C_FormBaseInputCB, 3);
fdui->name = obj = fl_add_input(FL_NORMAL_INPUT, 370, 10, 150, 40, idex(_("Name:|#N")));
fl_set_button_shortcut(obj, scex(_("Name:|#N")), 1);
fl_set_button_shortcut(obj, scex(_("Goto reference|#G")), 1);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
fl_set_object_callback(obj, C_FormBaseInputCB, 1);
- fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 330, 300, 90, 30, _("OK"));
+ fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 230, 300, 90, 30, _("OK"));
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
fl_set_object_callback(obj, C_FormBaseOKCB, 0);
fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 430, 300, 90, 30, idex(_("Cancel|#C^[")));
fl_set_button_shortcut(obj, scex(_("Cancel|#C^[")), 1);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
fl_set_object_callback(obj, C_FormBaseCancelCB, 0);
+ fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 330, 300, 90, 30, idex(_("Apply|#A")));
+ fl_set_button_shortcut(obj, scex(_("Apply|#A")), 1);
+ fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
+ fl_set_object_callback(obj, C_FormBaseApplyCB, 0);
+ fdui->button_restore = obj = fl_add_button(FL_NORMAL_BUTTON, 10, 300, 90, 30, idex(_("Restore|#R")));
+ fl_set_button_shortcut(obj, scex(_("Restore|#R")), 1);
+ fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
+ fl_set_object_callback(obj, C_FormBaseRestoreCB, 0);
fl_end_form();
fdui->form->fdui = fdui;
extern "C" void C_FormBaseInputCB(FL_OBJECT *, long);
extern "C" void C_FormBaseOKCB(FL_OBJECT *, long);
extern "C" void C_FormBaseCancelCB(FL_OBJECT *, long);
+extern "C" void C_FormBaseApplyCB(FL_OBJECT *, long);
+extern "C" void C_FormBaseRestoreCB(FL_OBJECT *, long);
/**** Forms and Objects ****/
FL_OBJECT *button_go;
FL_OBJECT *button_ok;
FL_OBJECT *button_cancel;
+ FL_OBJECT *button_apply;
+ FL_OBJECT *button_restore;
};
#endif /* FD_form_ref_h_ */
lcol: FL_BLACK
label:
shortcut:
-resize: FL_RESIZE_X
+resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: box
callback:
label: Inset keys|#I
shortcut:
resize: FL_RESIZE_X
-gravity: FL_NoGravity FL_NoGravity
+gravity: FL_NorthWest FL_South
name: citeBrsr
callback: C_FormBaseInputCB
argument: CITEBRSR
label: Bibliography keys|#B
shortcut:
resize: FL_RESIZE_X
-gravity: FL_NoGravity FL_NoGravity
+gravity: FL_North FL_SouthEast
name: bibBrsr
callback: C_FormBaseInputCB
argument: BIBBRSR
label: @4->
shortcut: #&D
resize: FL_RESIZE_NONE
-gravity: FL_NoGravity FL_NoGravity
+gravity: FL_North FL_North
name: addBtn
callback: C_FormBaseInputCB
argument: ADD
label: @9+
shortcut: #X
resize: FL_RESIZE_NONE
-gravity: FL_NoGravity FL_NoGravity
+gravity: FL_North FL_North
name: delBtn
callback: C_FormBaseInputCB
argument: DELETE
label: @8->
shortcut: #&A
resize: FL_RESIZE_NONE
-gravity: FL_NoGravity FL_NoGravity
+gravity: FL_North FL_North
name: upBtn
callback: C_FormBaseInputCB
argument: UP
label: @2->
shortcut: #&B
resize: FL_RESIZE_NONE
-gravity: FL_NoGravity FL_NoGravity
+gravity: FL_North FL_North
name: downBtn
callback: C_FormBaseInputCB
argument: DOWN
lcol: FL_BLACK
label: Info
shortcut:
-resize: FL_RESIZE_X
-gravity: FL_NoGravity FL_NoGravity
+resize: FL_RESIZE_NONE
+gravity: FL_SouthWest FL_SouthEast
name: infoBrsr
callback:
argument:
lcol: FL_BLACK
label: Citation style|#s
shortcut:
-resize: FL_RESIZE_X
-gravity: FL_NoGravity FL_NoGravity
+resize: FL_RESIZE_NONE
+gravity: FL_SouthWest FL_SouthEast
name: style
callback:
argument:
lcol: FL_BLACK
label: Text before|#T
shortcut:
-resize: FL_RESIZE_X
-gravity: FL_NoGravity FL_NoGravity
+resize: FL_RESIZE_NONE
+gravity: FL_SouthWest FL_SouthEast
name: textBefore
callback:
argument:
lcol: FL_BLACK
label: Text after|#e
shortcut:
-resize: FL_RESIZE_X
-gravity: FL_NoGravity FL_NoGravity
+resize: FL_RESIZE_NONE
+gravity: FL_SouthWest FL_SouthEast
name: textAftr
callback:
argument:
Name: form_ref
Width: 530
Height: 340
-Number of Objects: 10
+Number of Objects: 12
--------------------
class: FL_BOX
--------------------
class: FL_BROWSER
type: HOLD_BROWSER
-box: 10 10 270 280
+box: 10 10 270 240
boxtype: FL_DOWN_BOX
colors: FL_COL1 FL_YELLOW
alignment: FL_ALIGN_TOP
lcol: FL_BLACK
label:
shortcut:
-resize: FL_RESIZE_X
-gravity: FL_NorthWest FL_NoGravity
+resize: FL_RESIZE_ALL
+gravity: FL_NorthWest FL_South
name: browser
callback: C_FormBaseInputCB
argument: 2
--------------------
class: FL_BUTTON
type: NORMAL_BUTTON
-box: 40 300 90 30
+box: 40 260 90 30
boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER
label: Update|#U
shortcut:
resize: FL_RESIZE_NONE
-gravity: FL_NoGravity FL_NoGravity
+gravity: FL_SouthWest FL_SouthWest
name: button_update
callback: C_FormBaseInputCB
argument: 3
--------------------
class: FL_CHECKBUTTON
type: PUSH_BUTTON
-box: 170 300 30 30
+box: 170 260 30 30
boxtype: FL_NO_BOX
colors: FL_COL1 FL_YELLOW
alignment: FL_ALIGN_RIGHT
label: Sort|#S
shortcut:
resize: FL_RESIZE_NONE
-gravity: FL_NoGravity FL_NoGravity
+gravity: FL_SouthWest FL_SouthWest
name: sort
callback: C_FormBaseInputCB
argument: 3
--------------------
class: FL_BUTTON
type: RETURN_BUTTON
-box: 330 300 90 30
+box: 230 300 90 30
boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER
callback: C_FormBaseCancelCB
argument: 0
+--------------------
+class: FL_BUTTON
+type: NORMAL_BUTTON
+box: 330 300 90 30
+boxtype: FL_UP_BOX
+colors: FL_COL1 FL_COL1
+alignment: FL_ALIGN_CENTER
+style: FL_NORMAL_STYLE
+size: FL_DEFAULT_SIZE
+lcol: FL_BLACK
+label: Apply|#A
+shortcut:
+resize: FL_RESIZE_NONE
+gravity: FL_SouthEast FL_SouthEast
+name: button_apply
+callback: C_FormBaseApplyCB
+argument: 0
+
+--------------------
+class: FL_BUTTON
+type: NORMAL_BUTTON
+box: 10 300 90 30
+boxtype: FL_UP_BOX
+colors: FL_COL1 FL_COL1
+alignment: FL_ALIGN_CENTER
+style: FL_NORMAL_STYLE
+size: FL_DEFAULT_SIZE
+lcol: FL_BLACK
+label: Restore|#R
+shortcut:
+resize: FL_RESIZE_NONE
+gravity: FL_SouthEast FL_SouthEast
+name: button_restore
+callback: C_FormBaseRestoreCB
+argument: 0
+
==============================
create_the_forms