Angus's xforms patch + Preferences redesign -- need help fixing BadDrawable + Abort (core dumped)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1072 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Allan Rae 2000-10-03 05:53:25 +00:00
parent 41d36cfe2b
commit 82ef1fd1de
38 changed files with 428 additions and 356 deletions

View File

@ -1,3 +1,43 @@
2000-10-03 Allan Rae <rae@lyx.org>
* src/frontends/xforms/forms/form_preferences.fd:
* src/frontends/xforms/FormPreferences.[Ch]: redesign of dialog using
nested tabfolders has begun. The old "Miscellaneous" was renamed as
"Look and Feel"->"General" but will need to be split up further into
general output and general input tabs. Current plan is for four outer
tabfolders: "Look and Feel" for colours, bindings, fonts and other HCI
stuff; "Inputs" for input and import configuration; "Outputs" for
output and export configuration; and one more whatever is left over
called "General". The leftovers at present look like being which
viewers to use, spellchecker, language support and might be better
named "Support". I've put "Paths" in "Inputs" for the moment as this
seems reasonable for now at least.
One problem remains: X error kills LyX when you close Preferences.
2000-10-02 Angus Leeming <a.leeming@ic.ac.uk>
* src/frontends/xforms/FormBase.[Ch]: removed "meaningless" const.
qualifier from form()
* src/frontends/xforms/FormCitation.[Ch]:
* src/frontends/xforms/FormCopyright.[Ch]:
* src/frontends/xforms/FormDocument.[Ch]:
* src/frontends/xforms/FormError.[Ch]:
* src/frontends/xforms/FormIndex.[Ch]:
* src/frontends/xforms/FormPreferences.[Ch]:
* src/frontends/xforms/FormPrint.[Ch]:
* src/frontends/xforms/FormRef.[Ch]:
* src/frontends/xforms/FormToc.[Ch]:
* src/frontends/xforms/FormUrl.[Ch]: ditto.
* src/frontends/xforms/FormCitation.[Ch]:
* src/frontends/xforms/FormIndex.[Ch]:
* src/frontends/xforms/FormRef.[Ch]:
* src/frontends/xforms/FormUrl.[Ch]: Renamed a few buttons, consistent
with Allan's naming policy
* src/frontends/xforms/FormCitation.C: some static casts to remove
compiler warnings.
2000-10-02 Juergen Vigna <jug@sad.it>
* src/insets/insettabular.C (LocalDispatch): fixed selection code,

View File

@ -103,7 +103,6 @@ src/LaTeXLog.C
src/layout.C
src/layout_forms.C
src/LColor.C
src/Literate.C
src/log_form.C
src/LyXAction.C
src/lyx.C

View File

@ -103,7 +103,7 @@ protected:
/// delete derived class variables when hide()ing
virtual void clearStore() {}
/// Pointer to the actual instantiation of xform's form
virtual FL_FORM * const form() const = 0;
virtual FL_FORM * form() const = 0;
/// block opening of form twice at the same time
bool dialogIsOpen;

View File

@ -53,6 +53,13 @@ FormCitation::~FormCitation()
}
FL_FORM * FormCitation::form() const
{
if ( dialog_ ) return dialog_->form;
return 0;
}
void FormCitation::clearStore()
{
citekeys.clear();
@ -68,15 +75,6 @@ void FormCitation::build()
}
FL_FORM * const FormCitation::form() const
{
if( dialog_ ) // no need to test for dialog_->form
return dialog_->form;
else
return 0;
}
void FormCitation::update()
{
bibkeys.clear();
@ -107,10 +105,10 @@ void FormCitation::update()
setBibButtons( OFF );
setCiteButtons( OFF );
int noKeys = max( bibkeys.size(), citekeys.size() );
int noKeys = static_cast<int>( max( bibkeys.size(), citekeys.size() ) );
// Place bounds, so that 4 <= noKeys <= 10
noKeys = max( 4, min(10, noKeys) );
noKeys = max(4, min(10, noKeys) );
// Re-size the form to accommodate the new browser size
int size = 20 * noKeys;
@ -160,7 +158,7 @@ void FormCitation::setCiteButtons( State status ) const
int sel = fl_get_browser( dialog_->citeBrsr );
if( sel != 1 ) {
if ( sel != 1 ) {
fl_activate_object( dialog_->upBtn );
fl_set_object_lcol( dialog_->upBtn, FL_BLACK );
} else {
@ -168,7 +166,7 @@ void FormCitation::setCiteButtons( State status ) const
fl_set_object_lcol( dialog_->upBtn, FL_INACTIVE );
}
if( sel != fl_get_browser_maxline(dialog_->citeBrsr)) {
if ( sel != fl_get_browser_maxline(dialog_->citeBrsr)) {
fl_activate_object( dialog_->downBtn );
fl_set_object_lcol( dialog_->downBtn, FL_BLACK );
} else {
@ -216,23 +214,23 @@ void FormCitation::setSize( int hbrsr, bool bibPresent ) const
static int const hinfo = dialog_->infoBrsr->h;
static int const hstyle = dialog_->style->h;
static int const htext = dialog_->textAftr->h;
static int const hok = dialog_->ok->h;
static int const hok = dialog_->button_ok->h;
int const wform = dialog_->form->w;
int hform = dh1 + hbrsr + dh1;
if( bibPresent ) hform += hinfo + dh1;
if( natbib ) hform += hstyle + dh1 + htext + dh2;
if ( bibPresent ) hform += hinfo + dh1;
if ( natbib ) hform += hstyle + dh1 + htext + dh2;
hform += htext + dh1 + hok + dh2;
bool const sizeSet = ( hform != dialog_->form->h );
if( sizeSet ) fl_set_form_size( dialog_->form, wform, hform );
if ( sizeSet ) fl_set_form_size( dialog_->form, wform, hform );
// No vertical resizing is allowed
// min_wform set in build()
fl_set_form_minsize( dialog_->form, min_wform, hform );
fl_set_form_maxsize( dialog_->form, 3*min_wform, hform );
if( !sizeSet ) return;
if ( !sizeSet ) return;
int x = 0;
int y = 0;
@ -255,7 +253,7 @@ void FormCitation::setSize( int hbrsr, bool bibPresent ) const
y = dh1 + hbrsr + dh1; // in position for next element
if( bibPresent ) {
if ( bibPresent ) {
x = dialog_->infoBrsr->x;
fl_set_object_position( dialog_->infoBrsr, x, y );
fl_show_object( dialog_->infoBrsr );
@ -263,7 +261,7 @@ void FormCitation::setSize( int hbrsr, bool bibPresent ) const
} else
fl_hide_object( dialog_->infoBrsr );
if( natbib ) {
if ( natbib ) {
x = dialog_->style->x;
fl_set_object_position( dialog_->style, x, y );
fl_show_object( dialog_->style );
@ -280,11 +278,11 @@ void FormCitation::setSize( int hbrsr, bool bibPresent ) const
x = dialog_->textAftr->x;
fl_set_object_position( dialog_->textAftr, x, y );
x = dialog_->ok->x;
x = dialog_->button_ok->x;
y += htext + dh1;
fl_set_object_position( dialog_->ok, x, y );
x = dialog_->cancel->x;
fl_set_object_position( dialog_->cancel, x, y );
fl_set_object_position( dialog_->button_ok, x, y );
x = dialog_->button_cancel->x;
fl_set_object_position( dialog_->button_cancel, x, y );
}
@ -301,7 +299,7 @@ bool FormCitation::input( long data )
fl_deselect_browser( dialog_->citeBrsr );
unsigned int sel = fl_get_browser( dialog_->bibBrsr );
if( sel < 1 || sel > bibkeys.size() ) break;
if ( sel < 1 || sel > bibkeys.size() ) break;
// Put into infoBrsr the additional info associated with
// the selected bibBrsr key
@ -313,14 +311,14 @@ bool FormCitation::input( long data )
vector<string>::iterator it =
find( citekeys.begin(), citekeys.end(), bibkeys[sel-1] );
if( it != citekeys.end() ) {
int n = it - citekeys.begin();
if ( it != citekeys.end() ) {
int n = static_cast<int>( it - citekeys.begin() );
fl_select_browser_line( dialog_->citeBrsr, n+1 );
fl_set_browser_topline( dialog_->citeBrsr, n+1 );
}
if( !lv_->buffer()->isReadonly() ) {
if( it != citekeys.end() ) {
if ( !lv_->buffer()->isReadonly() ) {
if ( it != citekeys.end() ) {
setBibButtons( OFF );
setCiteButtons( ON );
} else {
@ -333,9 +331,9 @@ bool FormCitation::input( long data )
case CITEBRSR:
{
unsigned int sel = fl_get_browser( dialog_->citeBrsr );
if( sel < 1 || sel > citekeys.size() ) break;
if ( sel < 1 || sel > citekeys.size() ) break;
if( !lv_->buffer()->isReadonly() ) {
if ( !lv_->buffer()->isReadonly() ) {
setBibButtons( OFF );
setCiteButtons( ON );
}
@ -345,7 +343,7 @@ bool FormCitation::input( long data )
find( bibkeys.begin(), bibkeys.end(), citekeys[sel-1] );
if (it != bibkeys.end()) {
int n = it - bibkeys.begin();
int n = static_cast<int>( it - bibkeys.begin() );
fl_select_browser_line( dialog_->bibBrsr, n+1 );
fl_set_browser_topline( dialog_->bibBrsr, n+1 );
@ -359,17 +357,17 @@ bool FormCitation::input( long data )
break;
case ADD:
{
if( lv_->buffer()->isReadonly() ) break;
if ( lv_->buffer()->isReadonly() ) break;
unsigned int sel = fl_get_browser( dialog_->bibBrsr );
if( sel < 1 || sel > bibkeys.size() ) break;
if ( sel < 1 || sel > bibkeys.size() ) break;
// Add the selected bibBrsr key to citeBrsr
fl_addto_browser( dialog_->citeBrsr,
bibkeys[sel-1].c_str() );
citekeys.push_back( bibkeys[sel-1] );
int n = citekeys.size();
int n = static_cast<int>( citekeys.size() );
fl_select_browser_line( dialog_->citeBrsr, n );
setBibButtons( OFF );
@ -378,10 +376,10 @@ bool FormCitation::input( long data )
break;
case DELETE:
{
if( lv_->buffer()->isReadonly() ) break;
if ( lv_->buffer()->isReadonly() ) break;
unsigned int sel = fl_get_browser( dialog_->citeBrsr );
if( sel < 1 || sel > citekeys.size() ) break;
if ( sel < 1 || sel > citekeys.size() ) break;
// Remove the selected key from citeBrsr
fl_delete_browser_line( dialog_->citeBrsr, sel ) ;
@ -393,10 +391,10 @@ bool FormCitation::input( long data )
break;
case UP:
{
if( lv_->buffer()->isReadonly() ) break;
if ( lv_->buffer()->isReadonly() ) break;
unsigned int sel = fl_get_browser( dialog_->citeBrsr );
if( sel < 2 || sel > citekeys.size() ) break;
if ( sel < 2 || sel > citekeys.size() ) break;
// Move the selected key up one line
vector<string>::iterator it = citekeys.begin() + sel-1;
@ -413,10 +411,10 @@ bool FormCitation::input( long data )
break;
case DOWN:
{
if( lv_->buffer()->isReadonly() ) break;
if ( lv_->buffer()->isReadonly() ) break;
unsigned int sel = fl_get_browser( dialog_->citeBrsr );
if( sel < 1 || sel > citekeys.size()-1 ) break;
if ( sel < 1 || sel > citekeys.size()-1 ) break;
// Move the selected key down one line
vector<string>::iterator it = citekeys.begin() + sel-1;
@ -440,7 +438,7 @@ bool FormCitation::input( long data )
void FormCitation::apply()
{
if(lv_->buffer()->isReadonly()) return;
if (lv_->buffer()->isReadonly()) return;
string contents;
for(unsigned int i = 0; i < citekeys.size(); ++i) {
@ -453,7 +451,7 @@ void FormCitation::apply()
if (inset_ != 0) {
// Only update if contents have changed
if(params != inset_->params()) {
if (params != inset_->params()) {
inset_->setParams(params);
lv_->view()->updateInset(inset_, true);
}

View File

@ -58,7 +58,7 @@ private:
/// delete derived class variables from hide()
virtual void clearStore();
/// Pointer to the actual instantiation of the xform's form
virtual FL_FORM * const form() const;
virtual FL_FORM * form() const;
///
void updateBrowser( FL_OBJECT *, std::vector<string> const & ) const;

View File

@ -32,14 +32,14 @@ FormCopyright::~FormCopyright()
}
void FormCopyright::build()
{
dialog_ = build_copyright();
}
FL_FORM * const FormCopyright::form() const
FL_FORM * FormCopyright::form() const
{
if ( dialog_ ) return dialog_->form;
return 0;
}
void FormCopyright::build()
{
dialog_ = build_copyright();
}

View File

@ -38,7 +38,7 @@ private:
/// Build the dialog
virtual void build();
/// Pointer to the actual instantiation of the xform's form
virtual FL_FORM * const form() const;
virtual FL_FORM * form() const;
/// Fdesign generated method
FD_form_copyright * build_copyright();

View File

@ -86,7 +86,7 @@ FormDocument::~FormDocument()
}
FL_FORM * const FormDocument::form() const
FL_FORM * FormDocument::form() const
{
if (dialog_) return dialog_->form;
return 0;

View File

@ -113,7 +113,7 @@ private:
/// Build the popup
virtual void build();
///
virtual FL_FORM * const form() const;
virtual FL_FORM * form() const;
/// Typedefinitions from the fdesign produced Header file
FD_form_tabbed_document * build_tabbed_document();

View File

@ -39,9 +39,23 @@ FormError::~FormError()
}
FL_FORM * FormError::form() const
{
if ( dialog_ ) return dialog_->form;
return 0;
}
void FormError::clearStore()
{
ih_.disconnect();
message_.empty();
}
void FormError::showInset( InsetError * const inset )
{
if( dialogIsOpen || inset == 0 ) return;
if ( dialogIsOpen || inset == 0 ) return;
ih_ = inset->hide.connect(slot(this, &FormError::hide));
@ -65,19 +79,3 @@ void FormError::build()
// Define the min/max dimensions. Actually applied in update()
minw = form()->w; minh = form()->h;
}
void FormError::clearStore()
{
ih_.disconnect();
message_.empty();
}
FL_FORM * const FormError::form() const
{
if( dialog_ ) // no need to test for dialog_->form
return dialog_->form;
else
return 0;
}

View File

@ -39,7 +39,7 @@ private:
/// Reset data when hide() is called
virtual void clearStore();
/// Pointer to the actual instantiation of the xform's form
virtual FL_FORM * const form() const;
virtual FL_FORM * form() const;
/// Fdesign generated method
FD_form_error * build_error();

View File

@ -42,6 +42,13 @@ FormIndex::~FormIndex()
}
FL_FORM * FormIndex::form() const
{
if ( dialog_ ) return dialog_->form;
return 0;
}
void FormIndex::build()
{
dialog_ = build_index();
@ -52,15 +59,6 @@ void FormIndex::build()
}
FL_FORM * const FormIndex::form() const
{
if( dialog_ ) // no need to test for dialog_->form
return dialog_->form;
else
return 0;
}
void FormIndex::update()
{
fl_set_form_minsize(form(), minw, minh);
@ -68,7 +66,7 @@ void FormIndex::update()
fl_set_input(dialog_->key, params.getContents().c_str());
if( lv_->buffer()->isReadonly() ) {
if ( lv_->buffer()->isReadonly() ) {
fl_deactivate_object( dialog_->key );
fl_deactivate_object( dialog_->ok );
fl_set_object_lcol( dialog_->ok, FL_INACTIVE );
@ -82,7 +80,7 @@ void FormIndex::update()
void FormIndex::apply()
{
if(lv_->buffer()->isReadonly()) return;
if (lv_->buffer()->isReadonly()) return;
params.setContents(fl_get_input(dialog_->key));

View File

@ -35,7 +35,7 @@ private:
/// Apply from dialog (modify or create inset)
virtual void apply();
/// Pointer to the actual instantiation of the xform's form
virtual FL_FORM * const form() const;
virtual FL_FORM * form() const;
///
FD_form_index * build_index();
///

View File

@ -29,7 +29,8 @@ using SigC::slot;
FormPreferences::FormPreferences(LyXView * lv, Dialogs * d)
: FormBase(lv, d, BUFFER_INDEPENDENT, _("Preferences"), new PreferencesPolicy),
dialog_(0), bind_(0), misc_(0), screen_fonts_(0), interface_fonts_(0),
dialog_(0), outputs_tab_(0), look_n_feel_tab_(0), inputs_tab_(0),
lnf_general_(0), screen_fonts_(0), interface_fonts_(0),
printer_(0), paths_(0), minw_(0), minh_(0)
{
// let the dialog be shown
@ -42,8 +43,10 @@ FormPreferences::FormPreferences(LyXView * lv, Dialogs * d)
FormPreferences::~FormPreferences()
{
delete dialog_;
delete bind_;
delete misc_;
delete look_n_feel_tab_;
delete inputs_tab_;
delete outputs_tab_;
delete lnf_general_;
delete screen_fonts_;
delete interface_fonts_;
delete printer_;
@ -66,19 +69,24 @@ void FormPreferences::build()
minw_ = dialog_->form->w;
minh_ = dialog_->form->h;
bind_ = build_bind();
// build the tab folders
outputs_tab_ = build_outer_tab();
look_n_feel_tab_ = build_outer_tab();
inputs_tab_ = build_outer_tab();
// build actual tabfolder contents
// these will become nested tabfolders
screen_fonts_ = build_screen_fonts();
interface_fonts_ = build_interface_fonts();
misc_ = build_misc();
lnf_general_ = build_lnf_general();
printer_ = build_printer();
paths_ = build_paths();
// setup the input returns
// Bind tab
fl_set_input_return(bind_->input_bind, FL_RETURN_CHANGED);
// Misc tab
fl_set_counter_return(misc_->counter_autosave, FL_RETURN_CHANGED);
fl_set_counter_return(misc_->counter_line_len, FL_RETURN_CHANGED);
// Lnf_General tab
fl_set_input_return(lnf_general_->input_bind, FL_RETURN_CHANGED);
fl_set_counter_return(lnf_general_->counter_autosave, FL_RETURN_CHANGED);
fl_set_counter_return(lnf_general_->counter_line_len, FL_RETURN_CHANGED);
// Screen fonts
fl_set_input_return(screen_fonts_->input_roman, FL_RETURN_CHANGED);
fl_set_input_return(screen_fonts_->input_sans, FL_RETURN_CHANGED);
@ -132,33 +140,47 @@ void FormPreferences::build()
// Now add them to the tabfolder
fl_addto_tabfolder(dialog_->tabfolder_prefs,
_("Bindings"),
bind_->form);
_("Look and Feel"),
look_n_feel_tab_->form);
fl_addto_tabfolder(dialog_->tabfolder_prefs,
_("Inputs"),
inputs_tab_->form);
fl_addto_tabfolder(dialog_->tabfolder_prefs,
_("Outputs"),
outputs_tab_->form);
// now build the nested tabfolders
// Starting with look and feel
fl_addto_tabfolder(look_n_feel_tab_->tabfolder_outer,
_("Screen Fonts"),
screen_fonts_->form);
fl_addto_tabfolder(dialog_->tabfolder_prefs,
fl_addto_tabfolder(look_n_feel_tab_->tabfolder_outer,
_("Interface Fonts"),
interface_fonts_->form);
fl_addto_tabfolder(dialog_->tabfolder_prefs,
_("Miscellaneous"),
misc_->form);
fl_addto_tabfolder(dialog_->tabfolder_prefs,
_("Printer"),
printer_->form);
fl_addto_tabfolder(dialog_->tabfolder_prefs,
fl_addto_tabfolder(look_n_feel_tab_->tabfolder_outer,
_("General"),
lnf_general_->form);
// then build inputs
// Paths should probably go in a few outer_tab called Files
fl_addto_tabfolder(inputs_tab_->tabfolder_outer,
_("Paths"),
paths_->form);
// then building outputs
fl_addto_tabfolder(outputs_tab_->tabfolder_outer,
_("Printer"),
printer_->form);
// deactivate the various browse buttons because they
// currently aren't implemented
fl_deactivate_object(bind_->button_bind_file_browse);
fl_deactivate_object(lnf_general_->button_bind_file_browse);
fl_deactivate_object(paths_->button_document_browse);
fl_deactivate_object(paths_->button_template_browse);
fl_deactivate_object(paths_->button_temp_dir_browse);
fl_deactivate_object(paths_->button_lastfiles_browse);
fl_deactivate_object(paths_->button_backup_path_browse);
fl_set_object_lcol(bind_->button_bind_file_browse, FL_INACTIVE);
fl_set_object_lcol(lnf_general_->button_bind_file_browse, FL_INACTIVE);
fl_set_object_lcol(paths_->button_document_browse, FL_INACTIVE);
fl_set_object_lcol(paths_->button_template_browse, FL_INACTIVE);
fl_set_object_lcol(paths_->button_temp_dir_browse, FL_INACTIVE);
@ -167,7 +189,7 @@ void FormPreferences::build()
}
FL_FORM * const FormPreferences::form() const
FL_FORM * FormPreferences::form() const
{
if (dialog_) return dialog_->form;
return 0;
@ -195,19 +217,18 @@ void FormPreferences::apply()
// like update the screen fonts because that flushes the textcache
// and other stuff which may cost us a lot on slower/high-load machines.
// Bind tab
lyxrc.bind_file = fl_get_input(bind_->input_bind);
// Misc tab
lyxrc.show_banner = fl_get_button(misc_->check_banner);
lyxrc.auto_region_delete = fl_get_button(misc_->
// Look 'n Feel General tab
lyxrc.show_banner = fl_get_button(lnf_general_->check_banner);
lyxrc.auto_region_delete = fl_get_button(lnf_general_->
check_auto_region_delete);
lyxrc.exit_confirmation = fl_get_button(misc_->check_exit_confirm);
lyxrc.exit_confirmation = fl_get_button(lnf_general_->check_exit_confirm);
lyxrc.display_shortcuts =
fl_get_button(misc_->check_display_shortcuts);
fl_get_button(lnf_general_->check_display_shortcuts);
lyxrc.bind_file = fl_get_input(lnf_general_->input_bind);
lyxrc.autosave = static_cast<unsigned int>
(fl_get_counter_value(misc_->counter_autosave));
(fl_get_counter_value(lnf_general_->counter_autosave));
lyxrc.ascii_linelen = static_cast<unsigned int>
(fl_get_counter_value(misc_->counter_line_len));
(fl_get_counter_value(lnf_general_->counter_line_len));
// Interface fonts
lyxrc.popup_font_name =
fl_get_input(interface_fonts_->input_popup_font);
@ -325,20 +346,20 @@ void FormPreferences::update()
{
if (dialog_) {
// read lyxrc entries
// Bind tab
fl_set_input(bind_->input_bind, lyxrc.bind_file.c_str());
// Misc tab
fl_set_button(misc_->check_banner,
// Lnf_General tab
fl_set_button(lnf_general_->check_banner,
lyxrc.show_banner);
fl_set_button(misc_->check_auto_region_delete,
fl_set_button(lnf_general_->check_auto_region_delete,
lyxrc.auto_region_delete);
fl_set_button(misc_->check_exit_confirm,
fl_set_button(lnf_general_->check_exit_confirm,
lyxrc.exit_confirmation);
fl_set_button(misc_->check_display_shortcuts,
fl_set_button(lnf_general_->check_display_shortcuts,
lyxrc.display_shortcuts);
fl_set_counter_value(misc_->counter_autosave,
fl_set_input(lnf_general_->input_bind,
lyxrc.bind_file.c_str());
fl_set_counter_value(lnf_general_->counter_autosave,
lyxrc.autosave);
fl_set_counter_value(misc_->counter_line_len,
fl_set_counter_value(lnf_general_->counter_line_len,
lyxrc.ascii_linelen);
// Screen fonts
fl_set_input(screen_fonts_->input_roman,

View File

@ -27,12 +27,12 @@ class LyXView;
class Dialogs;
struct FD_form_preferences;
struct FD_form_bind;
struct FD_form_misc;
struct FD_form_lnf_general;
struct FD_form_screen_fonts;
struct FD_form_interface_fonts;
struct FD_form_printer;
struct FD_form_paths;
struct FD_form_outer_tab;
/** This class provides an XForms implementation of the FormPreferences Dialog.
The preferences dialog allows users to set/save their preferences.
@ -59,13 +59,13 @@ private:
/// Build the dialog
virtual void build();
///
virtual FL_FORM * const form() const;
virtual FL_FORM * form() const;
///
FD_form_preferences * build_preferences();
///
FD_form_bind * build_bind();
FD_form_outer_tab * build_outer_tab();
///
FD_form_misc * build_misc();
FD_form_lnf_general * build_lnf_general();
///
FD_form_screen_fonts * build_screen_fonts();
///
@ -77,10 +77,14 @@ private:
/// Real GUI implementation.
FD_form_preferences * dialog_;
/// Outputs tabfolder
FD_form_outer_tab * outputs_tab_;
/// HCI configuration
FD_form_outer_tab * look_n_feel_tab_;
/// reLyX and other import/input stuff
FD_form_outer_tab * inputs_tab_;
///
FD_form_bind * bind_;
///
FD_form_misc * misc_;
FD_form_lnf_general * lnf_general_;
///
FD_form_screen_fonts * screen_fonts_;
///

View File

@ -116,7 +116,7 @@ void FormPrint::connect()
}
FL_FORM * const FormPrint::form() const
FL_FORM * FormPrint::form() const
{
if (dialog_) return dialog_->form;
return 0;

View File

@ -48,7 +48,7 @@ private:
///
virtual void connect();
/// Pointer to the actual instantiation of the xform's form
virtual FL_FORM * const form() const;
virtual FL_FORM * form() const;
/// Build the dialog
virtual void build();

View File

@ -50,6 +50,13 @@ FormRef::~FormRef()
}
FL_FORM * FormRef::form() const
{
if ( dialog_ ) return dialog_->form;
return 0;
}
void FormRef::clearStore()
{
refs.clear();
@ -68,7 +75,7 @@ void FormRef::build()
formw = form()->w, formh = form()->h;
// Name is irrelevant to LaTeX documents
if( lv_->buffer()->isLatex() ) {
if ( lv_->buffer()->isLatex() ) {
fl_deactivate_object( dialog_->name );
fl_set_object_lcol( dialog_->name, FL_INACTIVE );
}
@ -76,22 +83,13 @@ void FormRef::build()
// Can change reference only through browser
fl_deactivate_object( dialog_->ref );
bc_.setOK( dialog_->ok );
bc_.setCancel( dialog_->cancel );
bc_.setOK( dialog_->button_ok );
bc_.setCancel( dialog_->button_cancel );
bc_.addReadOnly( dialog_->type );
bc_.refresh();
}
FL_FORM * const FormRef::form() const
{
if ( dialog_ ) // no need to test for dialog_->form_ref
return dialog_->form;
else
return 0;
}
void FormRef::update()
{
fl_set_input(dialog_->ref, params.getContents().c_str());
@ -101,10 +99,10 @@ void FormRef::update()
fl_set_choice( dialog_->type, type+1 );
toggle = GOBACK;
fl_set_object_label(dialog_->go, _("Goto reference"));
fl_set_object_label(dialog_->button_go, _("Goto reference"));
refs.clear();
if( inset_ == 0 ) {
if ( inset_ == 0 ) {
refs = lv_->buffer()->getLabelList();
updateBrowser( refs );
showBrowser();
@ -117,7 +115,7 @@ void FormRef::update()
void FormRef::updateBrowser( vector<string> keys ) const
{
if( fl_get_button( dialog_->sort ) )
if ( fl_get_button( dialog_->sort ) )
sort( keys.begin(), keys.end() );
fl_clear_browser( dialog_->browser );
@ -125,22 +123,22 @@ void FormRef::updateBrowser( vector<string> keys ) const
it != keys.end(); ++it )
fl_add_browser_line( dialog_->browser, (*it).c_str());
if( keys.empty() ) {
if ( keys.empty() ) {
fl_add_browser_line( dialog_->browser,
_("*** No labels found in document ***"));
fl_deactivate_object( dialog_->browser );
fl_deactivate_object( dialog_->update );
fl_deactivate_object( dialog_->button_update );
fl_deactivate_object( dialog_->sort );
fl_set_object_lcol( dialog_->browser, FL_INACTIVE );
fl_set_object_lcol( dialog_->update, FL_INACTIVE );
fl_set_object_lcol( dialog_->button_update, FL_INACTIVE );
fl_set_object_lcol( dialog_->sort, FL_INACTIVE );
} else {
fl_set_browser_topline( dialog_->browser, 1 );
fl_activate_object( dialog_->browser );
fl_set_object_lcol( dialog_->browser, FL_BLACK );
fl_activate_object( dialog_->update );
fl_set_object_lcol( dialog_->update, FL_BLACK );
fl_activate_object( dialog_->button_update );
fl_set_object_lcol( dialog_->button_update, FL_BLACK );
fl_activate_object( dialog_->sort );
fl_set_object_lcol( dialog_->sort, FL_BLACK );
}
@ -150,15 +148,15 @@ void FormRef::updateBrowser( vector<string> keys ) const
void FormRef::showBrowser() const
{
fl_show_object( dialog_->browser );
fl_show_object( dialog_->update );
fl_show_object( dialog_->button_update );
fl_show_object( dialog_->sort );
setSize( formw, formh, 0 );
fl_deactivate_object( dialog_->type );
fl_set_object_lcol( dialog_->type, FL_INACTIVE );
fl_deactivate_object( dialog_->go );
fl_set_object_lcol( dialog_->go, 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);
}
@ -167,15 +165,15 @@ void FormRef::showBrowser() const
void FormRef::hideBrowser() const
{
fl_hide_object( dialog_->browser );
fl_hide_object( dialog_->update );
fl_hide_object( dialog_->button_update );
fl_hide_object( dialog_->sort );
setSize( 250, formh, 280 );
fl_activate_object( dialog_->type );
fl_set_object_lcol( dialog_->type, FL_BLACK );
fl_activate_object( dialog_->go );
fl_set_object_lcol( dialog_->go, 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();
}
@ -189,31 +187,31 @@ void FormRef::setSize( int w, int h, int dx ) const
static int y2 = dialog_->ref->y;
static int x3 = dialog_->type->x;
static int y3 = dialog_->type->y;
static int x4 = dialog_->go->x;
static int y4 = dialog_->go->y;
static int x5 = dialog_->ok->x;
static int y5 = dialog_->ok->y;
static int x6 = dialog_->cancel->x;
static int y6 = dialog_->cancel->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 )
if ( form()->w != w )
fl_set_form_size( form(), w, h );
fl_set_form_minsize( form(), w, h );
fl_set_form_maxsize( form(), 2*w, h );
if( form()->w == w ) return;
if ( form()->w == w ) 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_->go, x4-dx, y4 );
fl_set_object_position( dialog_->ok, x5-dx, y5 );
fl_set_object_position( dialog_->cancel, x6-dx, y6 );
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() ) {
if ( lv_->buffer()->isLatex() ) {
fl_deactivate_object( dialog_->name );
fl_set_object_lcol( dialog_->name, FL_INACTIVE );
}
@ -235,7 +233,7 @@ void FormRef::apply()
if (inset_ != 0) {
// Only update if contents have changed
if(params != inset_->params()) {
if (params != inset_->params()) {
inset_->setParams(params);
lv_->view()->updateInset(inset_, true);
}
@ -259,7 +257,7 @@ bool FormRef::input( long data )
case 1:
{
toggle = static_cast<Goto>(toggle + 1);
if( toggle == GOFIRST ) toggle = GOREF;
if ( toggle == GOFIRST ) toggle = GOREF;
switch (toggle) {
case GOREF:
@ -267,14 +265,14 @@ bool FormRef::input( long data )
lv_->getLyXFunc()->
Dispatch(LFUN_REF_GOTO,
params.getContents());
fl_set_object_label(dialog_->go, _("Go back"));
fl_set_object_label(dialog_->button_go, _("Go back"));
}
break;
case GOBACK:
{
lv_->getLyXFunc()->Dispatch(LFUN_REF_BACK);
fl_set_object_label(dialog_->go, _("Goto reference"));
fl_set_object_label(dialog_->button_go, _("Goto reference"));
}
break;
@ -288,7 +286,7 @@ bool FormRef::input( long data )
case 2:
{
unsigned int sel = fl_get_browser( dialog_->browser );
if( sel < 1 || sel > refs.size() ) break;
if ( sel < 1 || sel > refs.size() ) break;
string s = fl_get_browser_line( dialog_->browser, sel );
fl_set_input( dialog_->ref, s.c_str());
@ -296,12 +294,12 @@ bool FormRef::input( long data )
toggle = GOBACK;
lv_->getLyXFunc()->Dispatch(LFUN_REF_BACK);
fl_set_object_label(dialog_->go, _("Goto reference"));
fl_set_object_label(dialog_->button_go, _("Goto reference"));
fl_activate_object( dialog_->type );
fl_set_object_lcol( dialog_->type, FL_BLACK );
fl_activate_object( dialog_->go );
fl_set_object_lcol( dialog_->go, 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 );
}
break;
@ -319,7 +317,7 @@ bool FormRef::input( long data )
case 4:
{
Type type = static_cast<Type>( fl_get_choice(dialog_->type)-1 );
if( params.getCmdName() == getName( type )
if ( params.getCmdName() == getName( type )
&& inset_ ) {
activate = false;
}
@ -337,16 +335,16 @@ FormRef::Type FormRef::getType() const
{
Type type;
if( params.getCmdName() == "ref" )
if ( params.getCmdName() == "ref" )
type = REF;
else if( params.getCmdName() == "pageref" )
else if ( params.getCmdName() == "pageref" )
type = PAGEREF;
else if( params.getCmdName() == "vref" )
else if ( params.getCmdName() == "vref" )
type = VREF;
else if( params.getCmdName() == "vpageref" )
else if ( params.getCmdName() == "vpageref" )
type = VPAGEREF;
else

View File

@ -62,7 +62,7 @@ private:
/// delete derived class variables from hide()
virtual void clearStore();
/// Pointer to the actual instantiation of the xform's form
virtual FL_FORM * const form() const;
virtual FL_FORM * form() const;
///
void updateBrowser( std::vector<string> ) const;

View File

@ -44,6 +44,13 @@ FormToc::~FormToc()
}
FL_FORM * FormToc::form() const
{
if ( dialog_ ) return dialog_->form;
return 0;
}
void FormToc::clearStore()
{
toclist.clear();
@ -60,26 +67,17 @@ void FormToc::build()
}
FL_FORM * const FormToc::form() const
{
if ( dialog_ ) // no need to test for dialog_->form
return dialog_->form;
else
return 0;
}
void FormToc::update()
{
Buffer::TocType type;
if( params.getCmdName() == "tableofcontents" )
if ( params.getCmdName() == "tableofcontents" )
type = Buffer::TOC_TOC;
else if( params.getCmdName() == "listofalgorithms" )
else if ( params.getCmdName() == "listofalgorithms" )
type = Buffer::TOC_LOA;
else if( params.getCmdName() == "listoffigures" )
else if ( params.getCmdName() == "listoffigures" )
type = Buffer::TOC_LOF;
else

View File

@ -38,7 +38,7 @@ private:
/// delete derived class variables from hide()
virtual void clearStore();
/// Pointer to the actual instantiation of the xform's form
virtual FL_FORM * const form() const;
virtual FL_FORM * form() const;
///
void updateToc();
///

View File

@ -52,12 +52,10 @@ void FormUrl::build()
}
FL_FORM * const FormUrl::form() const
FL_FORM * FormUrl::form() const
{
if( dialog_ ) // no need to test for dialog_->form
return dialog_->form;
else
return 0;
if ( dialog_ ) return dialog_->form;
return 0;
}
@ -74,25 +72,25 @@ void FormUrl::update()
else
fl_set_button(dialog_->radio_html, 1);
if( lv_->buffer()->isReadonly() ) {
if ( lv_->buffer()->isReadonly() ) {
fl_deactivate_object( dialog_->url );
fl_deactivate_object( dialog_->name );
fl_deactivate_object( dialog_->radio_html );
fl_deactivate_object( dialog_->ok );
fl_set_object_lcol( dialog_->ok, FL_INACTIVE );
fl_deactivate_object( dialog_->button_ok );
fl_set_object_lcol( dialog_->button_ok, FL_INACTIVE );
} else {
fl_activate_object( dialog_->url );
fl_activate_object( dialog_->name );
fl_activate_object( dialog_->radio_html );
fl_activate_object( dialog_->ok );
fl_set_object_lcol( dialog_->ok, FL_BLACK );
fl_activate_object( dialog_->button_ok );
fl_set_object_lcol( dialog_->button_ok, FL_BLACK );
}
}
void FormUrl::apply()
{
if(lv_->buffer()->isReadonly()) return;
if (lv_->buffer()->isReadonly()) return;
params.setContents(fl_get_input(dialog_->url));
params.setOptions(fl_get_input(dialog_->name));
@ -102,9 +100,9 @@ void FormUrl::apply()
else
params.setCmdName("url");
if(inset_ != 0) {
if (inset_ != 0) {
// Only update if contents have changed
if(params != inset_->params()) {
if (params != inset_->params()) {
inset_->setParams(params);
lv_->view()->updateInset(inset_, true);
}

View File

@ -35,7 +35,7 @@ private:
/// Apply from dialog (modify or create inset)
virtual void apply();
/// Pointer to the actual instantiation of the xform's form
virtual FL_FORM * const form() const;
virtual FL_FORM * form() const;
///
FD_form_url * build_url();
///

View File

@ -56,10 +56,10 @@ FD_form_citation * FormCitation::build_citation()
fl_set_object_resize(obj, FL_RESIZE_X);
fdui->textAftr = obj = fl_add_input(FL_NORMAL_INPUT, 100, 570, 250, 30, _("Text after"));
fl_set_object_resize(obj, FL_RESIZE_X);
fdui->ok = obj = fl_add_button(FL_RETURN_BUTTON, 230, 630, 90, 30, _("OK"));
fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 230, 630, 90, 30, _("OK"));
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
fl_set_object_callback(obj, C_FormBaseOKCB, 0);
fdui->cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 330, 630, 90, 30, _("Cancel"));
fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 330, 630, 90, 30, _("Cancel"));
fl_set_button_shortcut(obj, _("^["), 1);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
fl_set_object_callback(obj, C_FormBaseCancelCB, 0);

View File

@ -26,8 +26,8 @@ struct FD_form_citation {
FL_OBJECT *style;
FL_OBJECT *textBefore;
FL_OBJECT *textAftr;
FL_OBJECT *ok;
FL_OBJECT *cancel;
FL_OBJECT *button_ok;
FL_OBJECT *button_cancel;
};
#endif /* FD_form_citation_h_ */

View File

@ -29,7 +29,7 @@ FD_form_index * FormIndex::build_index()
fl_set_input_shortcut(obj, scex(_("Keyword|#K#k")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_resize(obj, FL_RESIZE_X);
fdui->cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 410, 60, 100, 30, _("Cancel"));
fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 410, 60, 100, 30, _("Cancel"));
fl_set_button_shortcut(obj, _("^["), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);

View File

@ -15,7 +15,7 @@ struct FD_form_index {
FL_FORM *form;
FL_OBJECT *key;
FL_OBJECT *cancel;
FL_OBJECT *button_cancel;
FL_OBJECT *ok;
};

View File

@ -10,45 +10,17 @@
#include "form_preferences.h"
#include "FormPreferences.h"
FD_form_bind::~FD_form_bind()
FD_form_lnf_general::~FD_form_lnf_general()
{
if( form->visible ) fl_hide_form( form );
fl_free_form( form );
}
FD_form_bind * FormPreferences::build_bind()
FD_form_lnf_general * FormPreferences::build_lnf_general()
{
FL_OBJECT *obj;
FD_form_bind *fdui = new FD_form_bind;
fdui->form = fl_bgn_form(FL_NO_BOX, 450, 320);
fdui->form->u_vdata = this;
obj = fl_add_box(FL_FLAT_BOX, 0, 0, 450, 320, "");
fdui->input_bind = obj = fl_add_input(FL_NORMAL_INPUT, 145, 80, 190, 30, _("Bind file"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormBaseInputCB, 0);
fdui->button_bind_file_browse = obj = fl_add_button(FL_NORMAL_BUTTON, 335, 80, 80, 30, _("Browse..."));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_end_form();
fdui->form->fdui = fdui;
return fdui;
}
/*---------------------------------------*/
FD_form_misc::~FD_form_misc()
{
if( form->visible ) fl_hide_form( form );
fl_free_form( form );
}
FD_form_misc * FormPreferences::build_misc()
{
FL_OBJECT *obj;
FD_form_misc *fdui = new FD_form_misc;
FD_form_lnf_general *fdui = new FD_form_lnf_general;
fdui->form = fl_bgn_form(FL_NO_BOX, 450, 320);
fdui->form->u_vdata = this;
@ -85,6 +57,11 @@ FD_form_misc * FormPreferences::build_misc()
fl_set_counter_bounds(obj, 0, 120);
fl_set_counter_value(obj, 75);
fl_set_counter_step(obj, 1, 1);
fdui->input_bind = obj = fl_add_input(FL_NORMAL_INPUT, 140, 175, 190, 30, _("Bind file"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormBaseInputCB, 0);
fdui->button_bind_file_browse = obj = fl_add_button(FL_NORMAL_BUTTON, 330, 175, 80, 30, _("Browse..."));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_end_form();
fdui->form->fdui = fdui;
@ -360,9 +337,9 @@ FD_form_preferences * FormPreferences::build_preferences()
FL_OBJECT *obj;
FD_form_preferences *fdui = new FD_form_preferences;
fdui->form = fl_bgn_form(FL_NO_BOX, 625, 435);
fdui->form = fl_bgn_form(FL_NO_BOX, 485, 435);
fdui->form->u_vdata = this;
obj = fl_add_box(FL_UP_BOX, 0, 0, 625, 435, "");
obj = fl_add_box(FL_UP_BOX, 0, 0, 485, 435, "");
fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 275, 395, 90, 30, idex(_("Apply|#A")));
fl_set_button_shortcut(obj, scex(_("Apply|#A")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
@ -374,7 +351,7 @@ FD_form_preferences * FormPreferences::build_preferences()
fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 175, 395, 90, 30, _("Save"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormBaseOKCB, 0);
fdui->tabfolder_prefs = obj = fl_add_tabfolder(FL_TOP_TABFOLDER, 5, 5, 585, 385, "");
fdui->tabfolder_prefs = obj = fl_add_tabfolder(FL_TOP_TABFOLDER, 5, 5, 470, 385, "");
fl_set_object_boxtype(obj, FL_FLAT_BOX);
fdui->button_restore = obj = fl_add_button(FL_NORMAL_BUTTON, 10, 395, 90, 30, idex(_("Restore|#R")));
fl_set_button_shortcut(obj, scex(_("Restore|#R")), 1);
@ -388,3 +365,28 @@ FD_form_preferences * FormPreferences::build_preferences()
}
/*---------------------------------------*/
FD_form_outer_tab::~FD_form_outer_tab()
{
if( form->visible ) fl_hide_form( form );
fl_free_form( form );
}
FD_form_outer_tab * FormPreferences::build_outer_tab()
{
FL_OBJECT *obj;
FD_form_outer_tab *fdui = new FD_form_outer_tab;
fdui->form = fl_bgn_form(FL_NO_BOX, 475, 365);
fdui->form->u_vdata = this;
obj = fl_add_box(FL_FLAT_BOX, 0, 0, 475, 365, "");
fdui->tabfolder_outer = obj = fl_add_tabfolder(FL_TOP_TABFOLDER, 10, 10, 455, 345, "");
fl_set_object_boxtype(obj, FL_FLAT_BOX);
fl_end_form();
fdui->form->fdui = fdui;
return fdui;
}
/*---------------------------------------*/

View File

@ -1,8 +1,8 @@
// File modified by fdfix.sh for use by lyx (with xforms >= 0.88) and gettext
/** Header file generated with fdesign **/
#ifndef FD_form_bind_h_
#define FD_form_bind_h_
#ifndef FD_form_lnf_general_h_
#define FD_form_lnf_general_h_
/** Callbacks, globals and object handlers **/
extern "C" void C_FormBaseInputCB(FL_OBJECT *, long);
@ -15,24 +15,16 @@ extern "C" void C_FormBaseInputCB(FL_OBJECT *, long);
extern "C" void C_FormBaseInputCB(FL_OBJECT *, long);
extern "C" void C_FormBaseInputCB(FL_OBJECT *, long);
extern "C" void C_FormBaseApplyCB(FL_OBJECT *, long);
extern "C" void C_FormBaseCancelCB(FL_OBJECT *, long);
extern "C" void C_FormBaseOKCB(FL_OBJECT *, long);
extern "C" void C_FormBaseRestoreCB(FL_OBJECT *, long);
/**** Forms and Objects ****/
struct FD_form_bind {
~FD_form_bind();
FL_FORM *form;
FL_OBJECT *input_bind;
FL_OBJECT *button_bind_file_browse;
};
struct FD_form_misc {
~FD_form_misc();
/**** Forms and Objects ****/
struct FD_form_lnf_general {
~FD_form_lnf_general();
FL_FORM *form;
FL_OBJECT *check_banner;
@ -41,6 +33,8 @@ struct FD_form_misc {
FL_OBJECT *check_display_shortcuts;
FL_OBJECT *counter_autosave;
FL_OBJECT *counter_line_len;
FL_OBJECT *input_bind;
FL_OBJECT *button_bind_file_browse;
};
struct FD_form_screen_fonts {
~FD_form_screen_fonts();
@ -123,5 +117,11 @@ struct FD_form_preferences {
FL_OBJECT *tabfolder_prefs;
FL_OBJECT *button_restore;
};
struct FD_form_outer_tab {
~FD_form_outer_tab();
#endif /* FD_form_bind_h_ */
FL_FORM *form;
FL_OBJECT *tabfolder_outer;
};
#endif /* FD_form_lnf_general_h_ */

View File

@ -29,7 +29,7 @@ FD_form_ref * FormRef::build_ref()
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
fl_set_object_resize(obj, FL_RESIZE_X);
fl_set_object_callback(obj, C_FormBaseInputCB, 2);
fdui->update = obj = fl_add_button(FL_NORMAL_BUTTON, 40, 300, 90, 30, _("Update"));
fdui->button_update = obj = fl_add_button(FL_NORMAL_BUTTON, 40, 300, 90, 30, _("Update"));
fl_set_button_shortcut(obj, scex(_("Update|#U#u")), 1);
fl_set_object_resize(obj, FL_RESIZE_NONE);
fl_set_object_callback(obj, C_FormBaseInputCB, 3);
@ -47,14 +47,14 @@ FD_form_ref * FormRef::build_ref()
fl_set_object_lalign(obj, FL_ALIGN_TOP);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
fl_set_object_callback(obj, C_FormBaseInputCB, 4);
fdui->go = obj = fl_add_button(FL_NORMAL_BUTTON, 340, 200, 140, 40, _("Goto reference"));
fdui->button_go = obj = fl_add_button(FL_NORMAL_BUTTON, 340, 200, 140, 40, _("Goto reference"));
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->ok = obj = fl_add_button(FL_RETURN_BUTTON, 330, 300, 90, 30, _("OK"));
fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 330, 300, 90, 30, _("OK"));
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
fl_set_object_callback(obj, C_FormBaseOKCB, 0);
fdui->cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 430, 300, 90, 30, _("Cancel"));
fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 430, 300, 90, 30, _("Cancel"));
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
fl_set_object_callback(obj, C_FormBaseCancelCB, 0);
fl_end_form();

View File

@ -16,14 +16,14 @@ struct FD_form_ref {
FL_FORM *form;
FL_OBJECT *browser;
FL_OBJECT *update;
FL_OBJECT *button_update;
FL_OBJECT *sort;
FL_OBJECT *name;
FL_OBJECT *ref;
FL_OBJECT *type;
FL_OBJECT *go;
FL_OBJECT *ok;
FL_OBJECT *cancel;
FL_OBJECT *button_go;
FL_OBJECT *button_ok;
FL_OBJECT *button_cancel;
};
#endif /* FD_form_ref_h_ */

View File

@ -40,12 +40,12 @@ FD_form_url * FormUrl::build_url()
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
fl_set_object_resize(obj, FL_RESIZE_X);
fdui->cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 410, 100, 100, 30, _("Cancel"));
fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 410, 100, 100, 30, _("Cancel"));
fl_set_button_shortcut(obj, _("^["), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
fl_set_object_callback(obj, C_FormBaseCancelCB, 0);
fdui->ok = obj = fl_add_button(FL_RETURN_BUTTON, 300, 100, 100, 30, _("OK"));
fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 300, 100, 100, 30, _("OK"));
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
fl_set_object_callback(obj, C_FormBaseOKCB, 0);
fl_end_form();

View File

@ -17,8 +17,8 @@ struct FD_form_url {
FL_OBJECT *url;
FL_OBJECT *name;
FL_OBJECT *radio_html;
FL_OBJECT *cancel;
FL_OBJECT *ok;
FL_OBJECT *button_cancel;
FL_OBJECT *button_ok;
};
#endif /* FD_form_url_h_ */

View File

@ -224,7 +224,7 @@ label: OK
shortcut: ^M
resize: FL_RESIZE_ALL
gravity: FL_SouthEast FL_SouthEast
name: ok
name: button_ok
callback: C_FormBaseOKCB
argument: 0
@ -242,7 +242,7 @@ label: Cancel
shortcut: ^[
resize: FL_RESIZE_ALL
gravity: FL_SouthEast FL_SouthEast
name: cancel
name: button_cancel
callback: C_FormBaseCancelCB
argument: 0

View File

@ -62,7 +62,7 @@ label: Cancel
shortcut: ^[
resize: FL_RESIZE_NONE
gravity: FL_SouthEast FL_SouthEast
name: cancel
name: button_cancel
callback: C_FormBaseCancelCB
argument: 0

View File

@ -8,70 +8,10 @@ Unit of measure: FL_COORD_PIXEL
SnapGrid: 5
=============== FORM ===============
Name: form_bind
Name: form_lnf_general
Width: 450
Height: 320
Number of Objects: 3
--------------------
class: FL_BOX
type: FLAT_BOX
box: 0 0 450 320
boxtype: FL_FLAT_BOX
colors: FL_COL1 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_INPUT
type: NORMAL_INPUT
box: 145 80 190 30
boxtype: FL_DOWN_BOX
colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_LEFT
style: FL_NORMAL_STYLE
size: FL_NORMAL_SIZE
lcol: FL_BLACK
label: Bind file
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: input_bind
callback: C_FormBaseInputCB
argument: 0
--------------------
class: FL_BUTTON
type: NORMAL_BUTTON
box: 335 80 80 30
boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER
style: FL_NORMAL_STYLE
size: FL_NORMAL_SIZE
lcol: FL_BLACK
label: Browse...
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: button_bind_file_browse
callback:
argument:
=============== FORM ===============
Name: form_misc
Width: 450
Height: 320
Number of Objects: 7
Number of Objects: 9
--------------------
class: FL_BOX
@ -211,6 +151,42 @@ argument: 0
value: 75
sstep: 1
--------------------
class: FL_INPUT
type: NORMAL_INPUT
box: 140 175 190 30
boxtype: FL_DOWN_BOX
colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_LEFT
style: FL_NORMAL_STYLE
size: FL_NORMAL_SIZE
lcol: FL_BLACK
label: Bind file
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: input_bind
callback: C_FormBaseInputCB
argument: 0
--------------------
class: FL_BUTTON
type: NORMAL_BUTTON
box: 330 175 80 30
boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER
style: FL_NORMAL_STYLE
size: FL_NORMAL_SIZE
lcol: FL_BLACK
label: Browse...
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: button_bind_file_browse
callback:
argument:
=============== FORM ===============
Name: form_screen_fonts
Width: 450
@ -1239,14 +1215,14 @@ argument:
=============== FORM ===============
Name: form_preferences
Width: 625
Width: 485
Height: 435
Number of Objects: 6
--------------------
class: FL_BOX
type: UP_BOX
box: 0 0 625 435
box: 0 0 485 435
boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER
@ -1318,7 +1294,7 @@ argument: 0
--------------------
class: FL_TABFOLDER
type: TOP_TABFOLDER
box: 5 5 585 385
box: 5 5 470 385
boxtype: FL_FLAT_BOX
colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_TOP_LEFT
@ -1351,5 +1327,47 @@ name: button_restore
callback: C_FormBaseRestoreCB
argument: 0
=============== FORM ===============
Name: form_outer_tab
Width: 475
Height: 365
Number of Objects: 2
--------------------
class: FL_BOX
type: FLAT_BOX
box: 0 0 475 365
boxtype: FL_FLAT_BOX
colors: FL_COL1 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_TABFOLDER
type: TOP_TABFOLDER
box: 10 10 455 345
boxtype: FL_FLAT_BOX
colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_TOP_LEFT
style: FL_NORMAL_STYLE
size: FL_DEFAULT_SIZE
lcol: FL_BLACK
label:
shortcut:
resize: FL_RESIZE_NONE
gravity: FL_NoGravity FL_NoGravity
name: tabfolder_outer
callback:
argument:
==============================
create_the_forms

View File

@ -62,7 +62,7 @@ label: Update
shortcut: Update|#U#u
resize: FL_RESIZE_NONE
gravity: FL_NoGravity FL_NoGravity
name: update
name: button_update
callback: C_FormBaseInputCB
argument: 3
@ -152,7 +152,7 @@ label: Goto reference
shortcut: Goto reference|#G
resize: FL_RESIZE_NONE
gravity: FL_SouthEast FL_SouthEast
name: go
name: button_go
callback: C_FormBaseInputCB
argument: 1
@ -170,7 +170,7 @@ label: OK
shortcut: ^M
resize: FL_RESIZE_NONE
gravity: FL_SouthEast FL_SouthEast
name: ok
name: button_ok
callback: C_FormBaseOKCB
argument: 0
@ -188,7 +188,7 @@ label: Cancel
shortcut:
resize: FL_RESIZE_NONE
gravity: FL_SouthEast FL_SouthEast
name: cancel
name: button_cancel
callback: C_FormBaseCancelCB
argument: 0

View File

@ -98,7 +98,7 @@ label: Cancel
shortcut: ^[
resize: FL_RESIZE_NONE
gravity: FL_SouthEast FL_SouthEast
name: cancel
name: button_cancel
callback: C_FormBaseCancelCB
argument: 0
@ -116,7 +116,7 @@ label: OK
shortcut: ^M
resize: FL_RESIZE_ALL
gravity: FL_SouthEast FL_SouthEast
name: ok
name: button_ok
callback: C_FormBaseOKCB
argument: 0