mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-26 03:11:59 +00:00
iThe cursor now behaves properly in the dialogs...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3740 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
eea39a8e42
commit
ff6f729817
@ -1,3 +1,18 @@
|
||||
2002-03-13 Angus Leeming <a.leeming@ic.ac.uk>
|
||||
|
||||
* FormBase.C (show):
|
||||
* FormBaseDeprecated.C (show): set the initial state of the cursor.
|
||||
|
||||
* FormPreferences.C (Colors::apply()): use the helper function
|
||||
setCursorColor.
|
||||
|
||||
* Tooltips.C (toggleTooltips): proper fix for those Bad Window messages.
|
||||
Can only set the cursor if the dialog is visible.
|
||||
|
||||
* xforms_helpers.[Ch] (setCursorColor): new helper function to set the
|
||||
color of all cursors used by LyX.
|
||||
(XformsColor::read): use it.
|
||||
|
||||
2002-03-12 Angus Leeming <a.leeming@ic.ac.uk>
|
||||
|
||||
* forms/*.fd (except form_filedialog.fd which is v. scary :-():
|
||||
|
@ -101,6 +101,13 @@ void FormBase::show()
|
||||
(controller_.IconifyWithMain() ? FL_TRANSIENT : 0),
|
||||
title_.c_str());
|
||||
}
|
||||
|
||||
// Set the initial state of the cursor
|
||||
if (form()->visible) {
|
||||
int const cursor = Tooltips::enabled() ?
|
||||
XC_question_arrow : FL_DEFAULT_CURSOR;
|
||||
fl_set_cursor(form()->window, cursor);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -121,6 +121,13 @@ void FormBaseDeprecated::show()
|
||||
(lyxrc.dialogs_iconify_with_main ? FL_TRANSIENT : 0),
|
||||
title_.c_str());
|
||||
}
|
||||
|
||||
// Set the initial state of the cursor
|
||||
if (form()->visible) {
|
||||
int const cursor = Tooltips::enabled() ?
|
||||
XC_question_arrow : FL_DEFAULT_CURSOR;
|
||||
fl_set_cursor(form()->window, cursor);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -425,10 +425,7 @@ void FormPreferences::Colors::apply()
|
||||
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);
|
||||
fl_set_cursor_color(XC_question_arrow,
|
||||
GUI_COLOR_CURSOR, FL_WHITE);
|
||||
setCursorColor(GUI_COLOR_CURSOR);
|
||||
}
|
||||
}
|
||||
Dialogs::redrawGUI();
|
||||
|
@ -70,16 +70,21 @@ void Tooltips::toggleTooltips()
|
||||
fl_set_object_helper(ob, c_str);
|
||||
}
|
||||
|
||||
// Set the cursor to a question mark or back to the default.
|
||||
FL_OBJECT * const ob = tooltipsMap.begin()->first;
|
||||
|
||||
// The dialog is not visible
|
||||
if (!ob->form->window)
|
||||
return;
|
||||
|
||||
// Set the cursor to a question mark or back to the default.
|
||||
int const cursor = enabled_ ? XC_question_arrow : FL_DEFAULT_CURSOR;
|
||||
fl_set_cursor(FL_ObjWin(ob), cursor);
|
||||
fl_set_cursor(ob->form->window, cursor);
|
||||
}
|
||||
|
||||
|
||||
void Tooltips::initTooltip(FL_OBJECT * ob, string const & tip)
|
||||
{
|
||||
lyx::Assert(ob);
|
||||
lyx::Assert(ob && ob->form);
|
||||
|
||||
// Paranoia check!
|
||||
TooltipsMap::const_iterator it = tooltipsMap.find(ob);
|
||||
@ -152,16 +157,21 @@ void Tooltips::toggleTooltips()
|
||||
// just go away. Don't change the cursor to a question mark.
|
||||
return;
|
||||
|
||||
// Set the cursor to a question mark or back to the default.
|
||||
FL_OBJECT * const ob = tooltipsMap.begin()->first;
|
||||
|
||||
// The dialog is not visible
|
||||
if (!ob->form->window)
|
||||
return;
|
||||
|
||||
// Set the cursor to a question mark or back to the default.
|
||||
int const cursor = enabled_ ? XC_question_arrow : FL_DEFAULT_CURSOR;
|
||||
fl_set_cursor(FL_ObjWin(ob), cursor);
|
||||
fl_set_cursor(ob->form->window, cursor);
|
||||
}
|
||||
|
||||
|
||||
void Tooltips::initTooltip(FL_OBJECT * ob, string const & tip)
|
||||
{
|
||||
lyx::Assert(ob);
|
||||
lyx::Assert(ob && ob->form);
|
||||
|
||||
// Paranoia check!
|
||||
TooltipsMap::const_iterator it = tooltipsMap.find(ob);
|
||||
@ -176,7 +186,6 @@ void Tooltips::initTooltip(FL_OBJECT * ob, string const & tip)
|
||||
tooltipsMap[ob] = formatted(_(str), 400);
|
||||
|
||||
if (!tooltip_timer_) {
|
||||
lyx::Assert(ob->form);
|
||||
if (fl_current_form && ob->form != fl_current_form)
|
||||
fl_end_form();
|
||||
|
||||
|
@ -19,13 +19,13 @@
|
||||
|
||||
#include "xforms_helpers.h"
|
||||
#include "lyxlex.h"
|
||||
#include "gettext.h"
|
||||
#include "lyxlength.h"
|
||||
#include "lyxgluelength.h"
|
||||
#include "support/LAssert.h"
|
||||
#include "support/FileInfo.h"
|
||||
#include "support/filetools.h"
|
||||
#include "support/lstrings.h" // frontStrip, strip
|
||||
#include "gettext.h"
|
||||
#include "support/LAssert.h"
|
||||
#include "lyxlength.h"
|
||||
#include "lyxgluelength.h"
|
||||
|
||||
using std::ofstream;
|
||||
using std::pair;
|
||||
@ -364,6 +364,16 @@ string formatted(string const & sin, int w, int size, int style)
|
||||
}
|
||||
|
||||
|
||||
void setCursorColor(int color)
|
||||
{
|
||||
fl_set_cursor_color(FL_DEFAULT_CURSOR, color, FL_WHITE);
|
||||
fl_set_cursor_color(XC_question_arrow, color, FL_WHITE);
|
||||
fl_set_cursor_color(XC_xterm, color, FL_WHITE);
|
||||
fl_set_cursor_color(XC_watch, color, FL_WHITE);
|
||||
fl_set_cursor_color(XC_sb_right_arrow, color, FL_WHITE);
|
||||
}
|
||||
|
||||
|
||||
namespace {
|
||||
|
||||
// sorted by hand to prevent LyXLex from complaining on read().
|
||||
@ -420,13 +430,10 @@ bool XformsColor::read(string const & filename)
|
||||
fl_mapcolor(le, col.r, col.g, col.b);
|
||||
|
||||
if (tag == "\\gui_pointer") {
|
||||
fl_set_cursor_color(FL_DEFAULT_CURSOR,
|
||||
FL_FREE_COL16, FL_WHITE);
|
||||
fl_set_cursor_color(XC_question_arrow,
|
||||
FL_FREE_COL16, FL_WHITE);
|
||||
setCursorColor(FL_FREE_COL16);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -81,6 +81,11 @@ void updateWidgetsFromLength(FL_OBJECT * input, FL_OBJECT * choice,
|
||||
LyXLength const & len,
|
||||
string const & default_unit);
|
||||
|
||||
|
||||
/// Called from Preferences when the cursor color is changed.
|
||||
void setCursorColor(int color);
|
||||
|
||||
|
||||
/// struct holding xform-specific colors
|
||||
struct XformsColor : public NamedColor {
|
||||
int colorID;
|
||||
|
Loading…
Reference in New Issue
Block a user