mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
ide, CtrlLib: BeginnerInfo renamed to BasicHints, tuned mouse move
This commit is contained in:
parent
2cde5203ad
commit
413fbbf40b
8 changed files with 33 additions and 33 deletions
|
|
@ -4,17 +4,17 @@ namespace Upp {
|
|||
|
||||
static bool s_beginner_info_enabled = true;
|
||||
|
||||
void EnableBeginnerInfo(bool b)
|
||||
void EnableBasicHints(bool b)
|
||||
{
|
||||
s_beginner_info_enabled = b;
|
||||
}
|
||||
|
||||
bool IsBeginnerInfoEnabled()
|
||||
bool IsBasicHintsEnabled()
|
||||
{
|
||||
return s_beginner_info_enabled;
|
||||
}
|
||||
|
||||
void PaintBeginnerInfo(Draw& w, const Rect& cr, const char *qtf)
|
||||
void PaintBasicHints(Draw& w, const Rect& cr, const char *qtf)
|
||||
{
|
||||
if(!s_beginner_info_enabled)
|
||||
return;
|
||||
|
|
@ -33,12 +33,12 @@ void PaintBeginnerInfo(Draw& w, const Rect& cr, const char *qtf)
|
|||
text.Paint(w, r.left + DPI(4), r.top + DPI(4), cx);
|
||||
}
|
||||
|
||||
void PaintBeginnerInfoTopic(Draw& w, Size sz, const char *topic)
|
||||
void PaintBasicHintsTopic(Draw& w, Size sz, const char *topic)
|
||||
{
|
||||
PaintBeginnerInfo(w, sz, GetTopic(topic));
|
||||
PaintBasicHints(w, sz, GetTopic(topic));
|
||||
}
|
||||
|
||||
void PaintBeginnerInfo(Ctrl *ctrl, Draw& w, const Rect& cr, const char *qtf, const char *key)
|
||||
void PaintBasicHints(Ctrl *ctrl, Draw& w, const Rect& cr, const char *qtf, const char *key)
|
||||
{
|
||||
static Index<String> done_keys;
|
||||
|
||||
|
|
@ -48,7 +48,7 @@ void PaintBeginnerInfo(Ctrl *ctrl, Draw& w, const Rect& cr, const char *qtf, con
|
|||
struct Record : Moveable<Record> {
|
||||
Ptr<Ctrl> ctrl;
|
||||
String key;
|
||||
Point mousepos;
|
||||
int movecount;
|
||||
int tm;
|
||||
};
|
||||
|
||||
|
|
@ -66,7 +66,7 @@ void PaintBeginnerInfo(Ctrl *ctrl, Draw& w, const Rect& cr, const char *qtf, con
|
|||
Record& r = records.Add();
|
||||
r.ctrl = ctrl;
|
||||
r.key = key;
|
||||
r.mousepos = GetMousePos();
|
||||
r.movecount = 0;
|
||||
r.tm = msecs();
|
||||
}
|
||||
|
||||
|
|
@ -82,7 +82,7 @@ void PaintBeginnerInfo(Ctrl *ctrl, Draw& w, const Rect& cr, const char *qtf, con
|
|||
if(testmousepos)
|
||||
mousepos = GetMousePos();
|
||||
for(Record& r : records) {
|
||||
if(testmousepos && Distance(r.mousepos, mousepos) < DPI(200))
|
||||
if(testmousepos && r.movecount++ < 40)
|
||||
continue;
|
||||
if(tm - r.tm > 250) {
|
||||
if(r.ctrl) {
|
||||
|
|
@ -110,22 +110,22 @@ void PaintBeginnerInfo(Ctrl *ctrl, Draw& w, const Rect& cr, const char *qtf, con
|
|||
});
|
||||
}
|
||||
|
||||
PaintBeginnerInfo(w, cr, qtf);
|
||||
PaintBasicHints(w, cr, qtf);
|
||||
}
|
||||
|
||||
void PaintBeginnerInfo(Ctrl *ctrl, Draw& w, const char *qtf, const char *key)
|
||||
void PaintBasicHints(Ctrl *ctrl, Draw& w, const char *qtf, const char *key)
|
||||
{
|
||||
PaintBeginnerInfo(ctrl, w, ctrl->GetSize(), qtf, key);
|
||||
PaintBasicHints(ctrl, w, ctrl->GetSize(), qtf, key);
|
||||
}
|
||||
|
||||
void PaintBeginnerInfoTopic(Ctrl *ctrl, Draw& w, const Rect& cr, const char *topic)
|
||||
void PaintBasicHintsTopic(Ctrl *ctrl, Draw& w, const Rect& cr, const char *topic)
|
||||
{
|
||||
PaintBeginnerInfo(ctrl, w, cr, GetTopic(topic), topic);
|
||||
PaintBasicHints(ctrl, w, cr, GetTopic(topic), topic);
|
||||
}
|
||||
|
||||
void PaintBeginnerInfoTopic(Ctrl *ctrl, Draw& w, const char *topic)
|
||||
void PaintBasicHintsTopic(Ctrl *ctrl, Draw& w, const char *topic)
|
||||
{
|
||||
PaintBeginnerInfo(ctrl, w, ctrl->GetSize(), GetTopic(topic), topic);
|
||||
PaintBasicHints(ctrl, w, ctrl->GetSize(), GetTopic(topic), topic);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -537,16 +537,16 @@ void DrawRoundRect(Draw& w, const Rect& r, int radius, Color fill,
|
|||
void DrawRoundRect(Draw& w, int x, int y, int cx, int cy, int radius, Color fill,
|
||||
int stroke_width, Color stroke);
|
||||
|
||||
void EnableBeginnerInfo(bool b);
|
||||
bool IsBeginnerInfoEnabled();
|
||||
void EnableBasicHints(bool b);
|
||||
bool IsBasicHintsEnabled();
|
||||
|
||||
void PaintBeginnerInfo(Draw& w, const Rect& cr, const char *qtf);
|
||||
void PaintBeginnerInfoTopic(Draw& w, Size sz, const char *topic);
|
||||
void PaintBasicHints(Draw& w, const Rect& cr, const char *qtf);
|
||||
void PaintBasicHintsTopic(Draw& w, Size sz, const char *topic);
|
||||
|
||||
void PaintBeginnerInfo(Ctrl *ctrl, Draw& w, const Rect& cr, const char *qtf, const char *key);
|
||||
void PaintBeginnerInfo(Ctrl *ctrl, Draw& w, const char *qtf, const char *key);
|
||||
void PaintBeginnerInfoTopic(Ctrl *ctrl, Draw& w, const Rect& cr, const char *topic);
|
||||
void PaintBeginnerInfoTopic(Ctrl *ctrl, Draw& w, const char *topic);
|
||||
void PaintBasicHints(Ctrl *ctrl, Draw& w, const Rect& cr, const char *qtf, const char *key);
|
||||
void PaintBasicHints(Ctrl *ctrl, Draw& w, const char *qtf, const char *key);
|
||||
void PaintBasicHintsTopic(Ctrl *ctrl, Draw& w, const Rect& cr, const char *topic);
|
||||
void PaintBasicHintsTopic(Ctrl *ctrl, Draw& w, const char *topic);
|
||||
|
||||
void Set(ArrayCtrl& array, int ii, IdCtrls& m);
|
||||
void Get(ArrayCtrl& array, int ii, IdCtrls& m);
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ void DiagramEditor::Paint(Draw& w)
|
|||
if(!fast)
|
||||
paint_ms = msecs() - t0;
|
||||
|
||||
PaintBeginnerInfo(this, w, "Right-click to insert item(s)&Double-click to edit text", "#DiagramEditor");
|
||||
PaintBasicHints(this, w, "Right-click to insert item(s)&Double-click to edit text", "#DiagramEditor");
|
||||
}
|
||||
|
||||
void DiagramEditor::Sync()
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ void AssistEditor::EndBeginnerInfo()
|
|||
void AssistEditor::Paint(Draw& w)
|
||||
{
|
||||
CodeEditor::Paint(w);
|
||||
PaintBeginnerInfoTopic(this, w, "ide/app/EditorBeginnerInfo_en-us");
|
||||
PaintBasicHintsTopic(this, w, "ide/app/EditorBeginnerInfo_en-us");
|
||||
}
|
||||
|
||||
class IndexSeparatorFrameCls : public CtrlFrame {
|
||||
|
|
|
|||
|
|
@ -390,9 +390,9 @@ void Ide::Serialize(Stream& s)
|
|||
s % blk0_header;
|
||||
|
||||
if(version >= 34) {
|
||||
bool b = IsBeginnerInfoEnabled();
|
||||
bool b = IsBasicHintsEnabled();
|
||||
s % b;
|
||||
EnableBeginnerInfo(b);
|
||||
EnableBasicHints(b);
|
||||
}
|
||||
|
||||
#ifdef PLATFORM_WIN32
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ void IconDes::Paint(Draw& w)
|
|||
Size sz = GetSize();
|
||||
if(!IsCurrent()) {
|
||||
w.DrawRect(sz, SColorPaper());
|
||||
PaintBeginnerInfoTopic(this, w, "ide/app/ImlBeginnerInfo_en-us");
|
||||
PaintBasicHintsTopic(this, w, "ide/app/ImlBeginnerInfo_en-us");
|
||||
return;
|
||||
}
|
||||
const Image& image = Current().image;
|
||||
|
|
@ -269,5 +269,5 @@ void IconDes::Paint(Draw& w)
|
|||
PaintHotSpot(image.Get2ndSpot(), LtBlue());
|
||||
}
|
||||
|
||||
PaintBeginnerInfoTopic(this, w, "ide/app/ImlBeginnerInfo_en-us");
|
||||
PaintBasicHintsTopic(this, w, "ide/app/ImlBeginnerInfo_en-us");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -338,7 +338,7 @@ void LayDes::Paint(Draw& w)
|
|||
}
|
||||
}
|
||||
|
||||
PaintBeginnerInfoTopic(this, w, "ide/app/LayBeginnerInfo_en-us");
|
||||
PaintBasicHintsTopic(this, w, "ide/app/LayBeginnerInfo_en-us");
|
||||
}
|
||||
|
||||
void LayDes::SaveState()
|
||||
|
|
|
|||
|
|
@ -385,7 +385,7 @@ void Ide::SetupFormat() {
|
|||
}
|
||||
#endif
|
||||
|
||||
bool show_basic_hints = IsBeginnerInfoEnabled();
|
||||
bool show_basic_hints = IsBasicHintsEnabled();
|
||||
|
||||
rtvr
|
||||
(hlt.hilite_scope, hs)
|
||||
|
|
@ -541,7 +541,7 @@ void Ide::SetupFormat() {
|
|||
|
||||
web_search.Save();
|
||||
|
||||
EnableBeginnerInfo(show_basic_hints);
|
||||
EnableBasicHints(show_basic_hints);
|
||||
|
||||
if(c == IDEXIT)
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue