mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-24 13:48:59 +00:00
Martin/Angus srcdoc patch, a fix for scrollbar and font size change, fix warning, fix X selection on double/triple click
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4890 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
52ca14b791
commit
a04092ebdb
@ -286,6 +286,7 @@ void BufferView::Pimpl::redoCurrentBuffer()
|
|||||||
lyxerr[Debug::INFO] << "BufferView::redoCurrentBuffer" << endl;
|
lyxerr[Debug::INFO] << "BufferView::redoCurrentBuffer" << endl;
|
||||||
if (buffer_ && bv_->text) {
|
if (buffer_ && bv_->text) {
|
||||||
resizeCurrentBuffer();
|
resizeCurrentBuffer();
|
||||||
|
updateScrollbar();
|
||||||
owner_->updateLayoutChoice();
|
owner_->updateLayoutChoice();
|
||||||
repaint();
|
repaint();
|
||||||
}
|
}
|
||||||
@ -372,9 +373,8 @@ int BufferView::Pimpl::resizeCurrentBuffer()
|
|||||||
switchKeyMap();
|
switchKeyMap();
|
||||||
owner_->allowInput();
|
owner_->allowInput();
|
||||||
|
|
||||||
/// clear the "Formatting Document" message
|
updateScrollbar();
|
||||||
owner_->message("");
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -647,6 +647,7 @@ void BufferView::Pimpl::doubleClick(int /*x*/, int /*y*/, mouse_button::state bu
|
|||||||
/* This will fit the cursor on the screen
|
/* This will fit the cursor on the screen
|
||||||
* if necessary */
|
* if necessary */
|
||||||
update(text, BufferView::SELECT|BufferView::FITCUR);
|
update(text, BufferView::SELECT|BufferView::FITCUR);
|
||||||
|
workarea().haveSelection(bv_->getLyXText()->selection.set());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -676,6 +677,7 @@ void BufferView::Pimpl::tripleClick(int /*x*/, int /*y*/, mouse_button::state bu
|
|||||||
/* This will fit the cursor on the screen
|
/* This will fit the cursor on the screen
|
||||||
* if necessary */
|
* if necessary */
|
||||||
update(text, BufferView::SELECT|BufferView::FITCUR);
|
update(text, BufferView::SELECT|BufferView::FITCUR);
|
||||||
|
workarea().haveSelection(bv_->getLyXText()->selection.set());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
2002-08-07 John Levon <levon@movementarian.org>
|
||||||
|
|
||||||
|
* BufferView_pimpl.C (resizeCurrentBuffer): update scrollbar
|
||||||
|
|
||||||
|
* BufferView_pimpl.C: announce X selection on double/triple
|
||||||
|
click
|
||||||
|
|
||||||
|
* lyx_main.C: use correct bool in batch dispatch
|
||||||
|
|
||||||
|
* counters.h: srcdocs (from Martin Vermeer and Angus Leeming)
|
||||||
|
|
||||||
2002-08-07 André Pönitz <poenitz@gmx.net>
|
2002-08-07 André Pönitz <poenitz@gmx.net>
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
#include <map>
|
#include <map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
///
|
/// This represents a single counter.
|
||||||
class Counter {
|
class Counter {
|
||||||
public:
|
public:
|
||||||
///
|
///
|
||||||
@ -37,31 +37,32 @@ public:
|
|||||||
void step();
|
void step();
|
||||||
///
|
///
|
||||||
void reset();
|
void reset();
|
||||||
///
|
/// Returns the master counter of this counter
|
||||||
string master() const;
|
string master() const;
|
||||||
///
|
/// sets the master counter for this counter
|
||||||
void setMaster(string const & m);
|
void setMaster(string const & m);
|
||||||
///
|
///
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int value_;
|
int value_;
|
||||||
///
|
/// contains master counter name; master counter is the counter
|
||||||
|
/// that, if stepped (incremented) zeroes this counter. E.g.
|
||||||
|
/// "subparagraph"'s master is "paragraph".
|
||||||
string master_;
|
string master_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/** This is a class of (La)TeX type counters. The counters is in a text
|
/// This is a class of (La)TeX type counters.
|
||||||
Style and can be reset by signals emitted from a single counter.
|
/// Every instantiation is an array of counters of type Counter.
|
||||||
*/
|
|
||||||
class Counters {
|
class Counters {
|
||||||
public:
|
public:
|
||||||
///
|
///
|
||||||
Counters();
|
Counters();
|
||||||
///
|
///
|
||||||
//~Counters();
|
//~Counters();
|
||||||
///
|
/// Add a new counter to array.
|
||||||
void newCounter(string const & newc);
|
void newCounter(string const & newc);
|
||||||
///
|
/// Add new counter having oldc as its master.
|
||||||
void newCounter(string const & newc, string const & oldc);
|
void newCounter(string const & newc, string const & oldc);
|
||||||
///
|
///
|
||||||
void set(string const & ctr, int val);
|
void set(string const & ctr, int val);
|
||||||
@ -69,29 +70,39 @@ public:
|
|||||||
void addto(string const & ctr, int val);
|
void addto(string const & ctr, int val);
|
||||||
///
|
///
|
||||||
int value(string const & ctr) const;
|
int value(string const & ctr) const;
|
||||||
///
|
/// Step (increment by one) counter named by arg, and
|
||||||
|
/// zeroes slave counter(s) for which it is the master.
|
||||||
|
/// NOTE sub-slaves not zeroed! That happens at slave's
|
||||||
|
/// first step 0->1. Seems to be sufficient.
|
||||||
void step(string const & ctr);
|
void step(string const & ctr);
|
||||||
///
|
/// Reset counters matched by match string. Empty string matches
|
||||||
void reset(string const & match = "");
|
/// all.
|
||||||
///
|
void reset(string const & match = string());
|
||||||
void copy(Counters & from, Counters & to, string const & match = "");
|
/// Copy counters whose name matches match from the &from to
|
||||||
///
|
/// the &to array of counters. Empty string matches all.
|
||||||
|
void copy(Counters & from, Counters & to, string const & match = string());
|
||||||
|
/// A numeric label's single item, like .1 for subsection number in
|
||||||
|
/// the 2.1.4 subsubsection number label. "first" indicates if this
|
||||||
|
/// is the first item to be displayed, usually chapter or section.
|
||||||
string labelItem(string const & ctr,
|
string labelItem(string const & ctr,
|
||||||
string const & labeltype,
|
string const & labeltype,
|
||||||
string const & langtype = "latin",
|
string const & langtype = "latin",
|
||||||
bool first = false);
|
bool first = false);
|
||||||
///
|
/// A complete numeric label, like 2.1.4 for a subsubsection.
|
||||||
|
/// "head" indicates sequence number of first item to be
|
||||||
|
/// displayed, e.g. 0 for chapter, 1 for section.
|
||||||
string numberLabel(string const & ctr,
|
string numberLabel(string const & ctr,
|
||||||
string const & labeltype,
|
string const & labeltype,
|
||||||
string const & langtype = "latin",
|
string const & langtype = "latin",
|
||||||
int head = 0);
|
int head = 0);
|
||||||
///
|
/// Maps numbers to enumeration of sectioning counter name strings.
|
||||||
std::vector<string> enums, sects;
|
std::vector<string> enums;
|
||||||
|
std::vector<string> sects;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
///
|
/// Maps counter (layout) names to actual counters.
|
||||||
typedef std::map<string, Counter> CounterList;
|
typedef std::map<string, Counter> CounterList;
|
||||||
///
|
/// Instantiate.
|
||||||
CounterList counterList;
|
CounterList counterList;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -141,7 +141,7 @@ LyX::LyX(int & argc, char * argv[])
|
|||||||
// try to dispatch to last loaded buffer first
|
// try to dispatch to last loaded buffer first
|
||||||
bool const dispatched = last_loaded->dispatch(batch_command, &success);
|
bool const dispatched = last_loaded->dispatch(batch_command, &success);
|
||||||
|
|
||||||
if (success) {
|
if (dispatched) {
|
||||||
QuitLyX();
|
QuitLyX();
|
||||||
exit(!success);
|
exit(!success);
|
||||||
}
|
}
|
||||||
|
@ -1427,18 +1427,17 @@ void LyXFunc::dispatch(FuncRequest const & ev, bool verbose)
|
|||||||
case LFUN_SCREEN_FONT_UPDATE:
|
case LFUN_SCREEN_FONT_UPDATE:
|
||||||
{
|
{
|
||||||
// handle the screen font changes.
|
// handle the screen font changes.
|
||||||
//
|
|
||||||
lyxrc.set_font_norm_type();
|
lyxrc.set_font_norm_type();
|
||||||
lyx_gui::update_fonts();
|
lyx_gui::update_fonts();
|
||||||
|
// We also need to empty the textcache so that
|
||||||
|
// the buffer will be formatted correctly after
|
||||||
|
// a zoom change.
|
||||||
|
textcache.clear();
|
||||||
// Of course we should only do the resize and the textcache.clear
|
// Of course we should only do the resize and the textcache.clear
|
||||||
// if values really changed...but not very important right now. (Lgb)
|
// if values really changed...but not very important right now. (Lgb)
|
||||||
// All visible buffers will need resize
|
// All visible buffers will need resize
|
||||||
owner->view()->resize();
|
owner->view()->resize();
|
||||||
owner->view()->repaint();
|
owner->view()->repaint();
|
||||||
// We also need to empty the textcache so that
|
|
||||||
// the buffer will be formatted correctly after
|
|
||||||
// a zoom change.
|
|
||||||
textcache.clear();
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user