mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Rob Lahaye's "iconify dialogs with main window if so desired" patch.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2703 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
8adbe1580e
commit
5bc3841d41
@ -1,3 +1,8 @@
|
||||
2001-09-07 Rob Lahaye <lahaye@users.sourceforge.net>
|
||||
|
||||
* lyxrc.[Ch]: added dialogs_iconify_with_main variable and associated
|
||||
code.
|
||||
|
||||
2001-09-04 José Matos <jamatos@fep.up.pt>
|
||||
* buffer.C
|
||||
* buffer.h
|
||||
|
@ -1,3 +1,7 @@
|
||||
2001-09-07 Rob Lahaye <lahaye@users.sourceforge.net>
|
||||
|
||||
* ControlButtons.[Ch]: added publicly accessible IconifyWithMain method.
|
||||
|
||||
2001-09-04 Angus Leeming <a.leeming@ic.ac.uk>
|
||||
|
||||
* ControlCharacter.C: fix Michael's bug: In the "Character layout"
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include "ControlButtons.h"
|
||||
#include "ButtonControllerBase.h"
|
||||
#include "ViewBase.h"
|
||||
#include "lyxrc.h"
|
||||
|
||||
ControlButtons::ControlButtons()
|
||||
: is_closing_(false)
|
||||
@ -55,3 +56,9 @@ void ControlButtons::RestoreButton()
|
||||
update();
|
||||
bc().restore();
|
||||
}
|
||||
|
||||
|
||||
bool ControlButtons::IconifyWithMain() const
|
||||
{
|
||||
return lyxrc.dialogs_iconify_with_main;
|
||||
}
|
||||
|
@ -57,6 +57,8 @@ public:
|
||||
void CancelButton();
|
||||
///
|
||||
void RestoreButton();
|
||||
///
|
||||
bool IconifyWithMain() const;
|
||||
|
||||
/** Allow the view to access the ButtonController. This method must be
|
||||
instantiated in a daughter class that creates the actual instance
|
||||
|
@ -1,3 +1,19 @@
|
||||
2001-09-07 Rob Lahaye <lahaye@users.sourceforge.net>
|
||||
|
||||
* FormBase.C (show): use controller_.IconifyWithMain() to control
|
||||
the dialog's show policy
|
||||
|
||||
* FormBaseDeprecated.C (show): ditto, but use lyxrc variable directly.
|
||||
|
||||
* FormPreferences.C:
|
||||
* forms/form_preferences.fd: add a check_dialogs_iconify_with_main
|
||||
check button to the Look & Feel->Misc tab and code to modify the lyxrc
|
||||
variable dialogs_iconify_with_main appropriately.
|
||||
|
||||
2001-09-07 Angus Leeming <a.leeming@ic.ac.uk>
|
||||
|
||||
* FormBase.h: clean-up comments. Remove mutable status of minw_, minh_.
|
||||
|
||||
2001-09-06 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
|
||||
|
||||
* Toolbar_pimpl.C (updateLayoutList): do not display obsolete
|
||||
|
@ -85,8 +85,9 @@ void FormBase::show()
|
||||
fl_set_form_maxsize(form(), minw_, minh_);
|
||||
|
||||
fl_show_form(form(),
|
||||
FL_PLACE_MOUSE | FL_FREE_SIZE, 0,
|
||||
title_.c_str());
|
||||
FL_PLACE_MOUSE | FL_FREE_SIZE,
|
||||
(controller_.IconifyWithMain() ? FL_TRANSIENT : 0),
|
||||
title_.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -51,21 +51,19 @@ protected:
|
||||
private:
|
||||
/// Pointer to the actual instantiation of xform's form
|
||||
virtual FL_FORM * form() const = 0;
|
||||
/** Filter the inputs on callback from xforms
|
||||
Return true if inputs are valid. */
|
||||
/// Filter the inputs on callback from xforms
|
||||
virtual ButtonPolicy::SMInput input(FL_OBJECT *, long);
|
||||
|
||||
/** Redraw the form (on receipt of a Signal indicating, for example,
|
||||
that the xform colors have been re-mapped). */
|
||||
virtual void redraw();
|
||||
|
||||
/// Overcome a dumb xforms sizing bug
|
||||
mutable int minw_;
|
||||
/// The dialog's minimum allowable dimensions.
|
||||
int minw_;
|
||||
///
|
||||
mutable int minh_;
|
||||
int minh_;
|
||||
/// Can the dialog be resized after it has been created?
|
||||
bool allow_resize_;
|
||||
|
||||
/// dialog title, displayed by WM.
|
||||
string title_;
|
||||
};
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "LyXView.h"
|
||||
#include "support/LAssert.h"
|
||||
#include "xformsBC.h"
|
||||
#include "lyxrc.h"
|
||||
//#include "debug.h"
|
||||
|
||||
using SigC::slot;
|
||||
@ -112,9 +113,11 @@ void FormBaseDeprecated::show()
|
||||
// calls to fl_set_form_minsize/maxsize apply only to the next
|
||||
// fl_show_form(), so connect() comes first.
|
||||
connect();
|
||||
|
||||
fl_show_form(form(),
|
||||
FL_PLACE_MOUSE | FL_FREE_SIZE, 0,
|
||||
title_.c_str());
|
||||
FL_PLACE_MOUSE | FL_FREE_SIZE,
|
||||
(lyxrc.dialogs_iconify_with_main ? FL_TRANSIENT : 0),
|
||||
title_.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1846,6 +1846,8 @@ void FormPreferences::LnFmisc::apply() const
|
||||
lyxrc.new_ask_filename = fl_get_button(dialog_->check_ask_new_file);
|
||||
lyxrc.cursor_follows_scrollbar =
|
||||
fl_get_button(dialog_->check_cursor_follows_scrollbar);
|
||||
lyxrc.dialogs_iconify_with_main =
|
||||
fl_get_button(dialog_->check_dialogs_iconify_with_main);
|
||||
lyxrc.autosave = static_cast<unsigned int>
|
||||
(fl_get_counter_value(dialog_->counter_autosave));
|
||||
lyxrc.wheel_jump = static_cast<unsigned int>
|
||||
@ -1871,6 +1873,7 @@ void FormPreferences::LnFmisc::build()
|
||||
setPreHandler(dialog_->counter_autosave);
|
||||
setPreHandler(dialog_->check_ask_new_file);
|
||||
setPreHandler(dialog_->check_cursor_follows_scrollbar);
|
||||
setPreHandler(dialog_->check_dialogs_iconify_with_main);
|
||||
setPreHandler(dialog_->counter_wm_jump);
|
||||
}
|
||||
|
||||
@ -1892,6 +1895,8 @@ FormPreferences::LnFmisc::feedback(FL_OBJECT const * const ob) const
|
||||
str = lyxrc.getDescription(LyXRC::RC_NEW_ASK_FILENAME);
|
||||
else if (ob == dialog_->check_cursor_follows_scrollbar)
|
||||
str = lyxrc.getDescription(LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR);
|
||||
else if (ob == dialog_->check_dialogs_iconify_with_main)
|
||||
str = lyxrc.getDescription(LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN);
|
||||
else if (ob == dialog_->counter_autosave)
|
||||
str = lyxrc.getDescription(LyXRC::RC_AUTOSAVE);
|
||||
else if (ob == dialog_->counter_wm_jump)
|
||||
@ -1911,6 +1916,8 @@ void FormPreferences::LnFmisc::update()
|
||||
fl_set_button(dialog_->check_ask_new_file, lyxrc.new_ask_filename);
|
||||
fl_set_button(dialog_->check_cursor_follows_scrollbar,
|
||||
lyxrc.cursor_follows_scrollbar);
|
||||
fl_set_button(dialog_->check_dialogs_iconify_with_main,
|
||||
lyxrc.dialogs_iconify_with_main);
|
||||
fl_set_counter_value(dialog_->counter_autosave, lyxrc.autosave);
|
||||
fl_set_counter_value(dialog_->counter_wm_jump, lyxrc.wheel_jump);
|
||||
}
|
||||
|
@ -402,6 +402,14 @@ FD_form_lnf_misc * FormPreferences::build_lnf_misc()
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0);
|
||||
fl_set_button(obj, 1);
|
||||
{
|
||||
char const * const dummy = N_("Dialogs iconify with main window|#D");
|
||||
fdui->check_dialogs_iconify_with_main = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 15, 195, 30, 30, idex(_(dummy)));
|
||||
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
|
||||
}
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0);
|
||||
fl_set_button(obj, 1);
|
||||
fdui->counter_wm_jump = obj = fl_add_counter(FL_NORMAL_COUNTER, 320, 225, 115, 30, _("Wheel mouse jump"));
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_lalign(obj, FL_ALIGN_LEFT);
|
||||
|
@ -115,6 +115,7 @@ struct FD_form_lnf_misc {
|
||||
FL_OBJECT *check_display_shrtcuts;
|
||||
FL_OBJECT *check_ask_new_file;
|
||||
FL_OBJECT *check_cursor_follows_scrollbar;
|
||||
FL_OBJECT *check_dialogs_iconify_with_main;
|
||||
FL_OBJECT *counter_wm_jump;
|
||||
FL_OBJECT *counter_autosave;
|
||||
};
|
||||
|
@ -938,7 +938,7 @@ argument: 0
|
||||
Name: form_lnf_misc
|
||||
Width: 450
|
||||
Height: 350
|
||||
Number of Objects: 9
|
||||
Number of Objects: 10
|
||||
|
||||
--------------------
|
||||
class: FL_BOX
|
||||
@ -1072,6 +1072,25 @@ callback: C_FormBaseDeprecatedInputCB
|
||||
argument: 0
|
||||
value: 1
|
||||
|
||||
--------------------
|
||||
class: FL_CHECKBUTTON
|
||||
type: PUSH_BUTTON
|
||||
box: 15 195 30 30
|
||||
boxtype: FL_NO_BOX
|
||||
colors: FL_COL1 FL_YELLOW
|
||||
alignment: FL_ALIGN_CENTER
|
||||
style: FL_NORMAL_STYLE
|
||||
size: FL_NORMAL_SIZE
|
||||
lcol: FL_BLACK
|
||||
label: Dialogs iconify with main window|#D
|
||||
shortcut:
|
||||
resize: FL_RESIZE_ALL
|
||||
gravity: FL_NoGravity FL_NoGravity
|
||||
name: check_dialogs_iconify_with_main
|
||||
callback: C_FormBaseDeprecatedInputCB
|
||||
argument: 0
|
||||
value: 1
|
||||
|
||||
--------------------
|
||||
class: FL_COUNTER
|
||||
type: NORMAL_COUNTER
|
||||
|
17
src/lyxrc.C
17
src/lyxrc.C
@ -65,6 +65,7 @@ keyword_item lyxrcTags[] = {
|
||||
{ "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
|
||||
{ "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
|
||||
{ "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
|
||||
{ "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
|
||||
{ "\\display_shortcuts", LyXRC::RC_DISPLAY_SHORTCUTS },
|
||||
{ "\\document_path", LyXRC::RC_DOCUMENTPATH },
|
||||
{ "\\escape_chars", LyXRC::RC_ESC_CHARS },
|
||||
@ -248,6 +249,7 @@ void LyXRC::setDefaults() {
|
||||
date_insert_format = "%A, %e %B %Y";
|
||||
show_banner = true;
|
||||
cursor_follows_scrollbar = false;
|
||||
dialogs_iconify_with_main = false;
|
||||
label_init_length = 3;
|
||||
|
||||
/// These variables are not stored on disk (perhaps they
|
||||
@ -751,6 +753,11 @@ int LyXRC::read(string const & filename)
|
||||
cursor_follows_scrollbar = lexrc.getBool();
|
||||
break;
|
||||
|
||||
case RC_DIALOGS_ICONIFY_WITH_MAIN:
|
||||
if (lexrc.next())
|
||||
dialogs_iconify_with_main = lexrc.getBool();
|
||||
break;
|
||||
|
||||
case RC_ASCIIROFF_COMMAND:
|
||||
if (lexrc.next())
|
||||
ascii_roff_command = lexrc.getString();
|
||||
@ -1117,6 +1124,12 @@ void LyXRC::output(ostream & os) const
|
||||
os << "\\cursor_follows_scrollbar "
|
||||
<< tostr(cursor_follows_scrollbar) << "\n";
|
||||
}
|
||||
case RC_DIALOGS_ICONIFY_WITH_MAIN:
|
||||
if (dialogs_iconify_with_main
|
||||
!= system_lyxrc.dialogs_iconify_with_main) {
|
||||
os << "\\dialogs_iconify_with_main "
|
||||
<< tostr(dialogs_iconify_with_main) << "\n";
|
||||
}
|
||||
case RC_SCREEN_FONT_ROMAN:
|
||||
if (roman_font_name != system_lyxrc.roman_font_name) {
|
||||
os << "\\screen_font_roman \"" << roman_font_name
|
||||
@ -1854,6 +1867,10 @@ string const LyXRC::getDescription(LyXRCTags tag)
|
||||
str = N_("LyX normally doesn't update the cursor position if you move the scrollbar. Set to true if you'd prefer to always have the cursor on screen.");
|
||||
break;
|
||||
|
||||
case RC_DIALOGS_ICONIFY_WITH_MAIN:
|
||||
str = N_("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
|
||||
break;
|
||||
|
||||
case RC_EXIT_CONFIRMATION:
|
||||
str = N_("Sets whether LyX asks for a second confirmation to exit when you have changed documents. (LyX will still ask to save changed documents.)");
|
||||
break;
|
||||
|
@ -94,6 +94,7 @@ enum LyXRCTags {
|
||||
RC_ESC_CHARS,
|
||||
RC_CHKTEX_COMMAND,
|
||||
RC_CURSOR_FOLLOWS_SCROLLBAR,
|
||||
RC_DIALOGS_ICONIFY_WITH_MAIN,
|
||||
RC_EXIT_CONFIRMATION,
|
||||
RC_DISPLAY_SHORTCUTS,
|
||||
RC_MAKE_BACKUP,
|
||||
@ -336,6 +337,8 @@ enum LyXRCTags {
|
||||
///
|
||||
bool cursor_follows_scrollbar;
|
||||
///
|
||||
bool dialogs_iconify_with_main;
|
||||
///
|
||||
int label_init_length;
|
||||
private:
|
||||
/// Is a bind file already (or currently) read?
|
||||
|
Loading…
Reference in New Issue
Block a user