diff --git a/uppsrc/CodeEditor/CodeEditor.cpp b/uppsrc/CodeEditor/CodeEditor.cpp index 3922f7788..e04c23aa6 100644 --- a/uppsrc/CodeEditor/CodeEditor.cpp +++ b/uppsrc/CodeEditor/CodeEditor.cpp @@ -871,7 +871,7 @@ void CodeEditor::DefaultHlStyles() SetHlStyle(INK_IFDEF, Color(170, 170, 170)); SetHlStyle(PAPER_BRACKET0, LtYellow); - SetHlStyle(PAPER_BRACKET, Yellow); + SetHlStyle(PAPER_BRACKET, Yellow, true); SetHlStyle(INK_NORMAL, SColorText); SetHlStyle(INK_DISABLED, SColorDisabled); diff --git a/uppsrc/Core/Value.cpp b/uppsrc/Core/Value.cpp index 94b05cc9e..bdb11db68 100644 --- a/uppsrc/Core/Value.cpp +++ b/uppsrc/Core/Value.cpp @@ -633,19 +633,27 @@ int StdValueCompareDesc(const Value& a, const Value& b) } StdValueOrder::StdValueOrder(int l) : language(l) {} -StdValueOrder::~StdValueOrder() {} bool StdValueOrder::operator()(const Value& a, const Value& b) const { return StdValueCompare(a, b, language) < 0; } -FnValueOrder::FnValueOrder(int (*fn)(const Value& a, const Value& b)) : fn(fn) {} -FnValueOrder::~FnValueOrder() {} - bool FnValueOrder::operator()(const Value& a, const Value& b) const { return (*fn)(a, b) < 0; } +bool StdValuePairOrder::operator()(const Value& k1, const Value& v1, const Value& k2, const Value& v2) const +{ + int q = StdValueCompare(k1, k2, language); + if(q) return q < 0; + return StdValueCompare(v1, v2, language); +} + +bool FnValuePairOrder::operator()(const Value& keya, const Value& valuea, const Value& keyb, const Value& valueb) const +{ + return (*fn)(keya, valuea, keyb, valueb) < 0; +} + END_UPP_NAMESPACE diff --git a/uppsrc/Core/Value.h b/uppsrc/Core/Value.h index c0c947948..dfef7afbe 100644 --- a/uppsrc/Core/Value.h +++ b/uppsrc/Core/Value.h @@ -230,7 +230,6 @@ struct StdValueOrder : ValueOrder { virtual bool operator()(const Value& a, const Value& b) const; StdValueOrder(int l = -1); - virtual ~StdValueOrder(); }; struct FnValueOrder : ValueOrder { @@ -238,8 +237,28 @@ struct FnValueOrder : ValueOrder { virtual bool operator()(const Value& a, const Value& b) const; - FnValueOrder(int (*fn)(const Value& a, const Value& b)); - virtual ~FnValueOrder(); + FnValueOrder(int (*fn)(const Value& a, const Value& b)) : fn(fn) {} +}; + +struct ValuePairOrder { + virtual bool operator()(const Value& keya, const Value& valuea, const Value& keyb, const Value& valueb) const = 0; + virtual ~ValuePairOrder() {} +}; + +struct StdValuePairOrder : ValuePairOrder { + int language; + + virtual bool operator()(const Value& keya, const Value& valuea, const Value& keyb, const Value& valueb) const; + + StdValuePairOrder(int l = -1); +}; + +struct FnValuePairOrder : ValuePairOrder { + int (*fn)(const Value& k1, const Value& v1, const Value& k2, const Value& v2); + + virtual bool operator()(const Value& keya, const Value& valuea, const Value& keyb, const Value& valueb) const; + + FnValuePairOrder(int (*fn)(const Value& k1, const Value& v1, const Value& k2, const Value& v2)) : fn(fn) {} }; template diff --git a/uppsrc/CtrlLib/Help.cpp b/uppsrc/CtrlLib/Help.cpp index 5ab006e76..ccc0e2520 100644 --- a/uppsrc/CtrlLib/Help.cpp +++ b/uppsrc/CtrlLib/Help.cpp @@ -154,6 +154,17 @@ void HelpWindow::SortTree(int id) tree.SortDeep(id); } +void HelpWindow::SortTree(int id, int (*cmp)(const Value& v1, const Value& v2)) +{ + tree.SortDeep(id, cmp); +} + +void HelpWindow::SortTree(int id, int (*cmp)(const Value& k1, const Value& v1, + const Value& k2, const Value& v2)) +{ + tree.SortDeep(id, cmp); +} + void HelpWindow::FinishTree() { tree.FindSetCursor(topic); diff --git a/uppsrc/CtrlLib/RichText.h b/uppsrc/CtrlLib/RichText.h index 2129f88f8..5fa4298e2 100644 --- a/uppsrc/CtrlLib/RichText.h +++ b/uppsrc/CtrlLib/RichText.h @@ -187,7 +187,10 @@ public: void ClearTree(); int AddTree(int parent, const Image& img, const String& topic, const String& title); - void SortTree(int id = 0); + void SortTree(int id, int (*cmp)(const Value& k1, const Value& v1, + const Value& k2, const Value& v2)); + void SortTree(int id, int (*cmp)(const Value& v1, const Value& v2)); + void SortTree(int id); void FinishTree(); void OpenDeep(int id = 0); void CurrentOrHome(); diff --git a/uppsrc/CtrlLib/TreeCtrl.cpp b/uppsrc/CtrlLib/TreeCtrl.cpp index 01675e1b7..25673ea9e 100644 --- a/uppsrc/CtrlLib/TreeCtrl.cpp +++ b/uppsrc/CtrlLib/TreeCtrl.cpp @@ -1156,15 +1156,18 @@ void TreeCtrl::ChildRemoved(Ctrl *) } struct TreeCtrl::SortOrder { - TreeCtrl *tree; - const ValueOrder *order; - bool byvalue; + TreeCtrl *tree; + const ValueOrder *order; + const ValuePairOrder *pairorder; + bool byvalue; bool operator()(int a, int b) const { - return byvalue ? (*order)(tree->GetValue(a), tree->GetValue(b)) - : (*order)(tree->Get(a), tree->Get(b)); + return pairorder ? (*pairorder)(tree->Get(a), tree->GetValue(a), tree->Get(b), tree->GetValue(b)) + : byvalue ? (*order)(tree->GetValue(a), tree->GetValue(b)) + : (*order)(tree->Get(a), tree->Get(b)); } + SortOrder() { pairorder = NULL; } }; void TreeCtrl::Sort0(int id, const ValueOrder& order, bool byvalue) @@ -1228,6 +1231,48 @@ void TreeCtrl::SortDeepByValue(int id, int (*compare)(const Value& v1, const Val SortDeep(id, compare, true); } +void TreeCtrl::Sort0(int id, const ValuePairOrder& order) +{ + SortOrder so; + so.tree = this; + so.pairorder = ℴ + UPP::Sort(item[id].child, so); +} + +void TreeCtrl::Sort(int id, const ValuePairOrder& order) +{ + SyncTree(); + Sort0(id, order); + Dirty(id); +} + +void TreeCtrl::SortDeep0(int id, const ValuePairOrder& order) +{ + Sort0(id, order); + Item& m = item[id]; + for(int i = 0; i < m.child.GetCount(); i++) + SortDeep0(m.child[i], order); +} + +void TreeCtrl::SortDeep(int id, const ValuePairOrder& order) +{ + SyncTree(); + SortDeep0(id, order); + Dirty(id); +} + +void TreeCtrl::Sort(int id, int (*compare)(const Value& k1, const Value& v1, + const Value& k2, const Value& v2)) +{ + SortDeep(id, FnValuePairOrder(compare)); +} + +void TreeCtrl::SortDeep(int id, int (*compare)(const Value& k1, const Value& v1, + const Value& k2, const Value& v2)) +{ + SortDeep(id, FnValuePairOrder(compare)); +} + void TreeCtrl::SetData(const Value& data) { FindSetCursor(data); diff --git a/uppsrc/CtrlLib/TreeCtrl.h b/uppsrc/CtrlLib/TreeCtrl.h index 9a183d88a..ffcf759b6 100644 --- a/uppsrc/CtrlLib/TreeCtrl.h +++ b/uppsrc/CtrlLib/TreeCtrl.h @@ -135,6 +135,8 @@ private: bool Tab(int d); void Sort0(int id, const ValueOrder& order, bool byvalue); void SortDeep0(int id, const ValueOrder& order, bool byvalue); + void Sort0(int id, const ValuePairOrder& order); + void SortDeep0(int id, const ValuePairOrder& order); void GatherOpened(int id, Vector& o); void SelClear(int id); void UpdateSelect(); @@ -246,6 +248,11 @@ public: void SortByValue(int id, int (*compare)(const Value& v1, const Value& v2) = StdValueCompare); void SortDeepByValue(int id, int (*compare)(const Value& v1, const Value& v2) = StdValueCompare); + void Sort(int id, const ValuePairOrder& order); + void SortDeep(int id, const ValuePairOrder& order); + void Sort(int id, int (*compare)(const Value& k1, const Value& v1, const Value& k2, const Value& v2)); + void SortDeep(int id, int (*compare)(const Value& k1, const Value& v1, const Value& k2, const Value& v2)); + void Clear(); void ClearSelection(); diff --git a/uppsrc/CtrlLib/src.tpp/DocEdit$en-us.tpp b/uppsrc/CtrlLib/src.tpp/DocEdit$en-us.tpp index 2d4b9d4c4..bc4860bd3 100644 --- a/uppsrc/CtrlLib/src.tpp/DocEdit$en-us.tpp +++ b/uppsrc/CtrlLib/src.tpp/DocEdit$en-us.tpp @@ -1,12 +1,66 @@ -TITLE("DocEdit") -COMPRESSED -120,156,165,87,251,79,83,121,22,255,87,110,226,140,1,151,97,239,189,109,105,41,217,68,179,206,100,205,108,102,147,85,51,63,16,144,82,46,210,88,122,73,239,69,198,221,172,225,37,143,218,130,32,47,139,5,236,67,40,84,1,41,104,97,160,64,165,173,149,34,133,130,229,81,16,129,2,173,20,121,43,8,236,247,182,60,202,232,74,226,66,210,126,243,253,158,243,57,231,124,206,249,158,239,105,36,10,125,247,29,28,2,159,130,79,248,99,159,199,226,57,201,124,50,42,146,71,167,179,34,56,40,35,226,218,207,255,8,143,56,115,54,40,140,30,76,161,32,0,133,198,68,104,44,6,13,161,163,97,224,3,161,33,40,3,165,209,17,22,26,78,103,209,104,44,152,205,229,115,8,34,42,146,143,178,88,17,148,18,26,130,158,66,153,12,20,97,210,89,116,22,66,99,178,80,160,139,194,48,10,51,81,6,66,167,177,80,6,59,14,35,184,81,145,28,22,45,226,204,63,195,128,18,141,178,4,192,97,36,12,165,51,233,40,76,131,81,58,48,133,176,88,116,132,201,96, -209,194,195,194,216,92,78,18,201,195,5,251,182,120,8,130,34,17,177,8,51,2,248,124,243,230,205,80,132,14,251,61,160,3,48,4,166,3,87,17,176,7,211,81,38,194,8,135,195,25,44,132,5,211,0,56,131,9,51,216,73,28,33,39,241,127,135,206,56,49,116,38,204,230,145,24,128,56,243,39,4,97,2,149,176,144,176,83,8,157,9,2,101,209,232,12,22,19,6,198,81,20,165,209,80,132,134,134,135,163,140,48,6,147,157,128,113,226,48,97,84,228,191,175,252,231,251,31,127,249,225,242,69,40,146,160,69,64,231,113,238,143,113,60,242,116,84,36,129,68,252,204,142,1,255,251,91,212,210,71,49,59,154,90,94,194,126,35,255,74,10,249,209,80,228,247,48,252,3,12,71,71,159,13,130,67,225,80,148,193,8,134,246,115,113,112,2,93,57,90,159,133,15,140,4,158,179,3,37,142,112,146,146,99,249,60,238,151,128,160,3,7,162,40,95,209,67,207,33,30,1,197,227,194,68,8,143,135,132,156,20,136,4,98,16,6,14,112,33,68,38,112,192,185,128,196, -132,73,66,140,36,32,62,79,128,17,16,135,128,168,28,92,21,114,146,18,8,40,40,5,124,19,64,20,75,12,14,221,135,222,255,58,123,150,151,200,185,138,177,89,76,198,105,58,147,145,158,33,78,237,77,77,77,205,208,238,129,207,212,15,77,247,23,157,99,121,99,13,121,226,222,220,205,138,246,238,190,165,254,124,249,235,181,180,119,187,101,34,215,3,75,137,120,209,107,72,43,80,22,230,232,228,186,194,66,79,154,105,233,117,190,126,114,93,53,168,111,233,126,91,100,252,168,180,73,103,77,11,69,149,235,50,99,253,230,59,137,108,184,180,229,249,182,94,86,178,163,92,205,202,124,172,200,235,109,216,179,78,23,84,244,109,246,244,58,154,114,26,138,189,198,166,188,123,205,242,182,137,201,177,28,175,182,116,44,115,217,227,212,111,189,180,20,212,180,184,45,57,89,243,67,185,149,59,142,135,15,69,11,93,115,165,246,28,67,213,171,145,7,18,119,79,211,180,186,70,83,92,61,181,218,244,184,246,237,188,73,58,60,227,53,223,238,104,218,150,213,87,235,95,116,223, -221,90,105,153,233,106,29,121,95,43,213,213,90,50,108,245,29,181,94,131,102,74,35,26,94,121,244,204,248,208,51,52,214,92,249,108,204,84,208,210,178,41,215,73,236,101,142,237,34,163,204,176,190,56,242,118,42,219,62,183,144,105,205,157,175,169,146,75,103,39,76,139,69,203,170,133,188,234,141,93,155,189,40,237,105,169,69,247,82,227,42,20,235,109,183,181,47,106,108,202,182,214,57,243,116,254,64,141,222,162,248,100,172,145,172,24,22,158,235,211,74,139,39,36,174,140,15,15,218,13,61,79,102,250,238,52,27,122,58,87,151,188,214,142,76,215,102,111,209,210,189,198,21,113,227,120,230,172,116,78,182,182,158,213,37,169,40,23,77,201,251,245,149,139,123,86,183,183,91,209,150,182,168,206,111,45,219,22,229,213,43,155,149,203,202,220,180,244,143,253,133,38,187,109,234,67,153,75,54,149,83,144,222,214,95,38,201,21,149,180,54,214,190,237,40,207,176,153,155,123,22,228,221,245,230,137,186,236,92,141,205,124,107,198,114,191,212,163,85,102,189,107,87,117,107,85, -138,187,93,51,179,79,85,5,179,157,143,87,7,204,26,137,162,64,100,152,41,51,186,100,61,45,233,183,135,158,172,137,221,107,85,123,226,93,103,111,79,67,249,184,71,252,98,88,227,176,138,223,59,84,163,19,75,221,253,247,157,162,123,111,59,139,229,83,58,113,177,212,91,155,97,215,25,20,85,163,163,53,69,198,252,42,237,150,238,85,63,72,116,97,83,227,144,170,127,114,252,86,157,169,207,147,55,146,245,194,59,91,84,255,194,174,150,20,90,197,179,13,238,222,226,37,111,243,70,254,98,121,83,254,162,109,99,109,101,90,237,168,144,123,77,226,236,180,252,86,143,124,101,178,113,163,247,77,241,162,56,215,53,231,49,119,230,182,127,108,168,144,14,246,217,29,14,209,148,243,83,137,59,179,87,43,150,181,148,142,246,171,51,171,156,133,29,93,94,77,189,237,247,103,118,165,221,216,149,170,22,61,234,168,213,180,15,14,253,62,53,169,180,221,233,242,204,172,185,52,25,74,237,142,180,85,210,218,151,243,122,92,52,63,52,239,46,25,49,165,15,122,151,167,135,68, -6,93,157,180,184,228,190,90,90,95,110,46,239,179,61,106,211,89,26,198,149,21,13,47,173,166,204,42,241,144,44,171,174,99,173,189,103,112,78,124,215,208,41,106,115,107,106,222,81,73,5,57,21,41,138,141,235,170,30,219,128,191,172,93,26,93,181,195,177,171,116,58,205,111,196,67,214,156,118,207,210,135,153,154,213,44,137,222,234,110,207,50,103,56,245,38,241,130,213,149,173,208,201,11,30,75,134,141,107,35,50,237,68,241,244,166,73,219,175,24,92,145,45,15,59,164,205,0,117,218,61,250,212,240,126,91,250,228,225,92,199,163,229,97,203,78,198,251,17,83,117,163,178,118,107,32,187,113,88,209,42,150,204,45,223,107,236,200,86,123,205,83,183,139,84,182,93,251,200,170,61,255,141,43,115,79,151,63,183,62,33,30,168,233,214,15,184,159,111,234,183,222,221,125,60,80,231,237,186,227,234,186,149,169,175,90,144,201,165,139,221,89,211,154,150,201,189,55,175,94,175,126,152,217,253,88,91,100,221,150,170,68,139,15,211,92,109,247,27,107,231,53,233,109,233,155, -250,241,87,67,170,113,171,123,235,142,219,220,90,161,109,116,110,85,75,26,77,205,207,246,140,31,107,11,116,159,58,21,15,222,60,31,245,244,102,76,238,228,101,87,86,139,74,44,189,158,225,249,129,249,237,87,59,230,162,254,77,185,202,114,87,86,216,95,218,100,90,191,183,177,60,237,174,19,173,108,220,234,88,208,25,186,165,221,98,181,215,161,174,168,84,171,11,156,89,165,146,117,119,197,35,163,126,111,71,99,172,27,186,37,45,94,145,231,105,45,190,27,211,230,99,87,161,213,91,242,235,171,247,122,86,75,156,5,158,250,206,217,233,212,74,170,79,193,254,118,197,248,188,121,159,139,7,141,47,38,8,244,191,152,96,246,97,215,14,16,138,254,99,99,134,98,78,31,246,91,208,182,47,98,228,79,184,224,232,52,40,42,16,132,58,138,134,142,9,28,41,211,160,248,195,221,224,131,142,125,145,234,193,160,209,130,126,45,32,33,18,135,98,49,40,153,192,226,160,216,27,80,10,47,238,42,70,134,126,61,34,202,33,30,255,48,170,160,152,51,49,193,190,37,196,5, -139,111,15,210,135,249,121,152,1,239,18,47,48,74,96,247,203,129,158,168,201,13,62,36,227,96,239,144,20,110,2,120,148,184,192,17,40,222,239,207,129,200,25,159,145,80,232,28,159,127,36,68,64,215,176,27,4,41,196,175,81,47,154,16,112,202,19,18,36,196,161,52,253,140,146,9,212,203,152,44,224,82,163,11,196,17,196,249,185,198,5,252,27,16,47,222,103,82,136,17,96,12,163,94,80,1,78,66,255,194,132,248,9,9,56,151,76,226,127,227,197,97,23,99,99,130,98,113,156,255,141,156,31,193,124,149,116,202,194,23,107,235,72,237,74,204,95,174,144,194,100,236,144,214,11,130,0,116,40,17,143,195,66,32,130,43,196,249,252,88,142,144,138,212,23,255,117,30,193,139,229,99,80,74,2,38,128,252,51,132,0,195,226,0,61,65,190,249,33,1,227,93,77,240,109,199,242,174,94,197,124,147,132,192,71,217,254,9,238,39,48,133,39,136,195,83,130,67,161,75,20,217,148,53,74,7,36,136,119,29,163,114,16,231,31,116,79,96,245,114,210,121,60,69,240,119, -140,115,29,251,191,104,13,192,249,54,94,147,191,202,107,0,252,62,177,151,147,168,42,132,192,144,69,145,65,226,73,62,94,40,2,193,240,69,9,7,30,199,226,36,137,39,30,20,91,146,16,231,98,196,254,229,223,15,43,4,228,131,199,77,0,87,6,34,147,133,2,40,17,227,8,136,253,33,14,92,113,144,1,208,48,142,41,130,57,14,3,183,159,26,11,67,41,23,47,225,73,191,250,82,18,226,47,255,20,30,184,51,137,56,112,216,223,118,184,201,4,213,119,192,52,120,157,135,131,245,159,65,218,127,243,235,251,237,92,32,126,229,8,64,215,3,130,39,36,237,23,252,88,218,190,49,101,199,80,142,146,118,212,50,57,137,24,53,176,6,72,5,197,115,248,4,22,124,130,123,23,136,63,184,199,197,5,4,201,14,168,130,3,99,129,213,224,251,21,2,5,58,120,12,231,184,88,80,240,209,112,238,67,63,112,250,18,70,144,196,103,229,114,224,112,212,127,1,182,100,50,32, - +topic "DocEdit"; +[2 $$0,0#00000000000000000000000000000000:Default] +[i448;a25;kKO9;*@(64)2 $$1,0#37138531426314131252341829483380:class] +[l288;2 $$2,2#27521748481378242620020725143825:desc] +[a83;*R6 $$3,0#31310162474203024125188417583966:caption] +[l288;i1121;b17;O9;~~~.1408;2 $$4,0#10431211400427159095818037425705:param] +[i448;a25;kKO9;*@(64)2 $$5,0#37138531426314131252341829483370:item] +[*+117 $$6,6#14700283458701402223321329925657:header] +[0 $$7,0#96390100711032703541132217272105:end] +[H6;0 $$8,0#05600065144404261032431302351956:begin] +[{_}%EN-US +[s3; DocEdit&] +[s1;K:`:`:DocEdit`:`:class:%- [@(0.0.255) class]_[@0 DocEdit]_:_[@(0.0.255) public]_[^`:`:TextCtrl^ T +extCtrl]&] +[s2; DocEdit is form of raw text editor that interprets lines as +paragraphs (wraps them).&] +[s2; &] +[s2; +@@image:875&475 +̀ێ۰̉ЏʖÁ׏ӿ +њ锟Ư썝֗󆄮̰㑞سƳۈۄݿʑʈ +ՉئԈà١ų㩨󳮪ǚȋ“𪚹ʃѯìᬊ +Ʀ۵ǑԘƝ͉訠鎧Ԕʹˬ撌ыɨѤ +ҨʣƨĿލŲΐ;̔܄п£ +񤉁ВሑИ⾛ȵ¯ޫȅʜ봤콥´ +工ȬŶղŰ֬͌إМ݊ṌԹã +ڨƏКǒե܅ن唯ԩ͌̕훳؞nj߱ +팉؊̴ЩݒѼԤռߤѐ欃 +Έ܊ǂՊùțѭʰܤDŽ՝猓ꬨʣ +Қ锟欹͈󆍿꽆ȃݿnj懣ٝޕǴУ +ؚڷ羭ǧ֣҇񙱾ዔԏތҨ¿ +쓮ҫ面†㬶滜謂եȺǵ +̃ȔʓЗ꫊šŒة݆ +ꞭƿƫՅ򢎴ʏҨʻ򣴿ʏݑ〟 +&] +[s0; &] +[s5;K:`:`:DocEdit`:`:After`(int`):%- [^`:`:DocEdit^ DocEdit]`&_[@0 SetFont]([^`:`:Font^ Fon +t]_[@3 f])&] +[s2; Sets the font to be used by widget.&] +[s0; &] +[s5;K:`:`:DocEdit`:`:SetFilter`(int`(`*`)`(int c`)`):%- [^`:`:DocEdit^ DocEdit]`&_[@0 Set +Filter]([@(0.0.255) int]_(`*[@3 f])([@(0.0.255) int]_c))&] +[s2; [%- Sets the character filter] [%-*@3 f]. All characters keystrokes +are first altered by this function and used only if the result +is not zero.&] +[s0; &] +[s5;K:`:`:DocEdit`:`:AutoHideSb`(bool`):%- [^`:`:DocEdit^ DocEdit]`&_[@0 AutoHideSb]([@(0.0.255) b +ool]_[@3 b]_`=_true)&] +[s2; In AutoHideSb mode, scrollbar is only visible when it is needed +(text height is bigger than the height of the window). This mode +is active by default.&] +[s0; &] +[s5;K:`:`:DocEdit`:`:UpDownLeave`(bool`):%- [^`:`:DocEdit^ DocEdit]`&_[@0 UpDownLeave]([@(0.0.255) b +ool]_[@3 u]_`=_true)&] +[s2; In UpDownLeave mode, Up key at the top of text or Down key at +the bottom is not processed by DocEdit, which in turn means that +it can be processed by parent Ctrl. In TopWindow, this will move +the focus to previous / next Ctrl that IsWantFocus.&] +[s0; &] +[s5;K:`:`:DocEdit`:`:NoUpDownLeave`(`):%- [^`:`:DocEdit^ DocEdit]`&_[@0 NoUpDownLeave]()&] +[s2; Same as UpDownLeave(false).&] +[s0; &] +[s5;K:`:`:DocEdit`:`:IsUpDownLeave`(`)const:%- [@(0.0.255) bool]_[@0 IsUpDownLeave]()_[@(0.0.255) c +onst]&] +[s2; Tests UpDownLeave mode.&] +[s0; ] \ No newline at end of file diff --git a/uppsrc/CtrlLib/src.tpp/LineEdit$en-us.tpp b/uppsrc/CtrlLib/src.tpp/LineEdit$en-us.tpp index 139d03d7f..f31cc9b4a 100644 --- a/uppsrc/CtrlLib/src.tpp/LineEdit$en-us.tpp +++ b/uppsrc/CtrlLib/src.tpp/LineEdit$en-us.tpp @@ -1,15 +1,252 @@ -TITLE("LineEdit") -COMPRESSED -120,156,205,91,141,114,219,54,18,126,21,140,219,203,72,169,170,138,148,100,201,114,219,233,212,73,83,95,147,54,19,39,215,233,104,100,139,34,33,9,19,138,96,73,202,138,115,119,125,246,219,93,0,36,40,137,38,29,103,230,218,78,19,138,196,254,125,88,236,46,22,232,212,101,95,126,217,235,244,190,232,213,252,51,121,198,151,222,54,204,102,83,49,24,140,207,61,119,120,254,254,151,223,206,206,159,254,208,58,29,180,145,139,3,92,250,35,167,63,30,246,157,129,123,10,127,56,125,199,29,186,253,129,51,118,207,6,227,126,127,220,155,248,161,151,166,179,105,232,142,199,231,72,228,118,220,47,220,209,208,117,70,131,241,96,236,244,71,99,23,104,221,94,207,237,141,220,161,51,232,143,221,225,36,224,169,63,155,122,227,254,249,211,55,167,64,212,71,73,192,188,231,156,186,131,209,192,237,245,123,238,0,68,57,227,241,192,25,13,199,253,179,211,211,137,239,197,153,144,145,150,37,28,199,117,206,23,206,232,28,116,254,235,175,191,186,206,160,167,52,24,0,51,167,55,0, -85,29,120,215,27,184,35,103,120,214,59,27,142,157,113,175,15,204,135,163,222,112,18,123,137,183,169,54,125,88,107,250,168,55,17,25,7,22,79,191,114,156,17,144,156,118,78,191,112,6,35,48,116,220,31,12,199,163,30,8,119,93,183,223,119,157,190,123,118,230,14,79,135,163,201,154,123,1,79,102,211,127,223,252,151,77,83,231,252,151,201,28,254,125,41,34,254,60,16,25,62,19,158,147,107,124,124,203,63,100,23,89,18,94,179,233,245,245,15,173,94,183,215,117,135,195,54,211,144,95,95,179,27,252,243,135,30,51,12,212,203,137,122,93,16,196,219,69,40,124,77,97,184,62,153,77,83,247,156,225,95,206,121,232,186,131,35,202,252,44,86,235,16,254,163,31,105,150,108,253,108,194,166,22,103,245,110,118,51,181,148,152,79,10,186,25,40,51,61,212,228,102,74,6,190,146,183,220,91,132,252,154,153,167,217,183,200,169,32,255,30,213,27,54,82,47,246,98,158,76,128,90,241,190,144,161,76,174,105,66,25,61,207,166,234,199,205,140,70,54,103,44,162,247,141,216, -194,184,230,76,151,50,202,10,174,63,193,47,205,20,31,11,158,56,172,57,83,127,109,1,176,243,215,158,209,148,158,11,174,48,14,153,246,20,83,102,61,11,231,12,124,226,237,90,164,122,106,183,9,103,1,95,130,68,120,115,23,101,222,7,182,54,34,69,180,98,113,34,1,204,76,192,103,185,100,41,188,10,57,67,105,158,159,241,132,249,60,12,187,236,138,35,147,212,79,4,173,96,28,105,27,101,249,71,115,91,81,172,151,201,100,254,29,252,219,242,101,148,102,213,227,159,204,219,52,98,98,137,90,72,25,230,136,160,215,217,28,13,86,173,25,209,21,227,174,43,133,104,168,11,223,213,68,243,39,200,190,207,214,230,69,251,70,49,85,11,208,130,125,250,143,231,191,126,253,238,138,61,255,115,235,133,34,187,99,190,220,64,156,18,169,140,186,51,53,73,204,250,107,120,31,68,248,114,222,18,81,54,239,224,251,127,113,31,45,251,182,26,162,239,1,164,14,142,111,147,11,41,85,111,69,146,129,46,108,102,175,225,91,41,130,194,151,74,18,115,212,236,241,194,118,104, -68,34,132,145,230,77,135,105,76,149,134,26,68,245,195,140,249,246,83,96,255,254,0,247,14,187,95,173,88,166,249,20,177,217,124,10,174,157,129,30,60,152,207,116,172,52,19,68,235,99,195,179,181,12,152,239,69,108,193,25,196,175,36,17,65,192,35,150,73,230,5,193,209,213,2,159,178,53,207,35,101,151,93,102,12,88,249,94,24,242,128,201,200,231,108,41,19,198,61,127,77,40,177,216,3,53,233,19,17,194,18,226,60,234,130,33,79,115,28,181,78,200,7,135,16,153,136,2,254,129,181,150,34,73,51,253,38,101,189,118,71,19,174,11,170,132,199,9,79,121,148,165,123,171,54,5,38,57,195,115,200,57,2,6,129,71,6,160,197,90,110,195,0,199,71,43,14,99,128,183,151,36,222,29,89,238,175,5,191,229,68,105,155,110,68,19,200,123,42,43,109,33,40,20,26,44,19,185,161,111,11,190,18,81,132,216,193,247,12,82,87,247,208,6,17,137,76,0,132,184,96,0,115,17,65,44,2,147,55,18,98,87,26,123,190,29,144,50,80,218,200,245,229,22,76,178, -229,238,25,173,76,11,96,166,32,106,193,50,176,16,82,179,190,77,97,110,192,234,148,103,68,230,197,49,135,33,56,143,168,46,188,1,112,73,4,77,130,183,84,42,0,127,15,94,231,236,186,236,15,185,101,94,152,42,207,33,197,45,157,180,215,236,219,221,101,186,130,99,98,19,135,124,3,243,227,81,120,5,165,249,38,206,238,74,65,227,88,180,248,149,239,174,252,68,134,225,107,153,206,91,15,93,249,54,181,89,248,53,11,231,66,57,250,110,13,203,36,37,218,133,151,176,21,7,239,139,248,14,157,131,160,126,188,101,47,120,134,137,244,74,124,228,104,216,65,240,87,1,5,63,235,248,129,143,179,82,58,176,88,228,217,160,28,186,115,179,222,112,200,147,145,114,170,20,198,227,132,99,230,222,91,82,172,101,84,100,252,67,12,8,65,16,145,145,84,46,186,10,239,226,117,202,230,95,51,98,179,19,65,182,46,175,9,12,20,40,220,139,178,118,19,0,94,208,172,82,10,160,184,126,0,2,188,221,183,24,105,138,220,87,30,0,1,39,178,98,233,254,71,63,60,158, -224,14,80,154,159,172,18,47,94,11,136,122,243,147,124,206,209,86,29,214,162,98,105,171,101,19,5,250,19,202,48,159,124,25,110,55,224,42,20,140,51,239,61,199,197,75,17,72,173,107,47,130,128,228,45,182,33,230,244,242,18,207,242,53,222,4,199,87,18,150,185,90,33,240,226,181,108,12,166,33,44,0,85,110,71,44,180,223,209,243,94,30,170,193,241,133,14,54,248,159,92,46,49,246,148,252,36,14,193,159,2,230,101,38,228,22,17,163,129,181,23,4,107,81,62,84,173,157,123,141,32,243,11,78,213,30,101,231,220,250,181,149,123,131,154,123,202,149,20,200,115,219,11,163,237,60,163,93,2,179,8,146,148,60,35,237,50,165,40,174,175,15,144,213,55,11,224,3,128,66,228,134,8,132,52,100,94,39,207,163,141,162,79,97,252,167,120,78,137,250,161,238,243,32,72,243,229,135,192,172,196,45,4,102,13,46,226,76,38,31,2,10,241,89,194,114,51,43,141,166,161,192,179,1,58,151,152,241,63,135,143,229,140,62,187,139,29,41,74,172,218,32,119,61,5,89, -37,68,145,204,62,7,76,159,226,67,54,241,223,214,133,30,129,143,170,61,222,197,84,184,176,131,50,133,90,18,102,204,172,213,222,51,64,125,81,6,96,89,105,182,174,164,238,54,110,40,253,153,220,69,245,242,113,212,3,53,8,128,164,137,135,224,207,43,218,20,188,129,122,226,254,213,132,35,244,156,227,227,193,90,42,243,186,167,10,176,150,91,117,138,82,134,121,139,20,92,33,51,59,23,8,170,62,212,47,104,230,145,188,111,111,103,106,141,127,43,227,139,109,146,194,166,246,30,252,243,65,13,224,135,210,129,50,103,177,198,119,2,74,48,159,232,49,238,171,221,148,14,2,183,130,239,106,117,188,128,194,149,39,245,106,218,227,30,173,169,167,170,3,159,120,154,109,72,35,117,177,9,247,46,86,62,77,101,35,182,72,170,181,46,134,207,90,251,27,235,27,116,148,104,214,41,145,34,59,245,37,229,240,48,255,238,102,9,123,30,190,111,47,242,213,27,52,101,145,114,143,189,170,48,133,85,138,241,108,239,147,192,157,196,10,118,11,183,188,205,128,150,22,18,187,52, -62,134,130,75,219,207,100,203,59,248,150,170,113,171,72,92,240,108,135,14,11,229,118,66,69,0,198,50,30,5,248,168,213,202,119,43,77,112,125,201,151,176,60,235,1,197,113,101,56,239,67,173,74,218,27,106,233,52,16,71,3,31,47,15,163,112,19,103,121,188,36,229,157,245,178,14,221,242,83,164,189,246,86,13,109,83,35,63,143,196,166,54,154,177,143,151,250,179,220,240,38,18,113,220,227,165,61,143,130,38,194,96,216,227,101,225,105,199,143,216,67,106,34,49,31,252,121,228,54,180,83,15,109,46,19,66,205,215,255,57,136,146,144,152,210,152,251,98,41,96,243,23,8,204,180,152,94,91,56,103,223,0,127,230,37,86,59,237,27,136,101,166,47,213,238,230,177,247,255,27,40,47,163,148,39,217,5,48,87,213,110,176,147,73,160,186,23,71,115,145,1,169,199,10,74,128,241,58,167,189,102,244,151,2,242,61,191,219,75,72,121,166,162,2,148,80,198,95,78,101,222,242,189,8,27,189,187,68,100,188,58,129,41,101,82,102,154,22,84,221,230,104,90,216,169,239, -168,87,177,85,205,14,80,43,38,165,36,254,112,118,242,111,108,131,109,218,150,151,82,99,114,113,135,125,74,96,8,59,90,172,49,181,126,40,183,109,55,50,107,167,231,25,204,126,198,245,244,84,186,116,49,234,176,148,81,223,210,242,134,253,161,94,242,163,231,191,167,158,217,125,90,228,131,14,149,184,220,107,170,225,30,164,84,219,97,145,213,97,129,214,85,100,228,210,27,90,111,90,87,108,47,231,5,236,2,68,53,196,78,109,121,235,176,163,253,108,37,118,222,97,201,215,18,75,84,83,219,66,125,161,40,188,51,71,1,185,77,245,93,195,139,109,86,167,162,30,114,164,76,133,93,91,161,30,212,168,126,40,226,133,244,146,64,181,108,60,172,97,11,3,155,236,110,74,205,233,79,238,17,228,92,30,210,198,5,239,192,246,183,106,82,55,247,77,16,135,89,217,244,157,39,118,163,89,245,152,111,180,86,102,216,33,144,182,26,48,193,9,158,187,96,253,174,90,203,48,159,123,7,53,245,123,213,50,146,69,27,161,114,219,106,131,214,178,113,214,16,223,168,62,229,129, -11,152,109,223,30,108,152,104,208,130,14,227,221,85,215,156,103,220,122,225,22,60,117,129,39,54,144,178,32,76,217,147,213,4,106,124,188,223,59,108,2,61,90,251,138,254,117,224,45,123,239,155,248,10,199,142,126,110,171,181,224,208,210,133,58,3,130,181,17,176,208,163,195,158,231,165,241,120,200,155,136,180,8,46,184,90,138,195,17,51,174,209,52,231,128,28,61,15,55,95,159,220,59,243,6,128,82,57,66,252,204,181,141,99,160,218,183,63,12,135,249,147,27,211,77,170,244,148,50,118,182,51,96,192,192,108,85,204,9,101,194,98,63,142,177,206,218,141,235,211,53,5,54,157,56,210,91,188,201,64,96,2,215,20,29,15,50,142,138,149,150,12,229,117,151,81,38,213,38,252,1,88,95,45,62,7,218,87,139,191,37,222,239,162,80,188,231,150,158,29,64,93,227,153,82,65,25,243,100,41,147,141,58,6,93,241,172,168,70,205,42,111,210,121,216,199,191,190,167,86,140,61,12,160,175,149,78,41,219,136,72,108,138,40,174,53,44,213,204,182,150,108,126,242,74,81, -204,79,216,134,123,180,188,209,93,108,175,155,159,44,56,112,231,48,196,16,30,241,52,96,139,5,131,161,211,82,138,243,248,14,203,83,246,252,132,28,119,126,210,209,47,144,48,48,36,116,80,220,244,164,234,2,102,36,83,177,253,49,9,179,96,83,23,5,161,196,173,171,40,66,126,127,185,72,3,142,84,19,198,97,41,142,54,59,244,253,13,234,223,223,177,254,125,5,229,111,221,206,171,52,184,106,239,37,169,200,199,234,186,114,179,119,153,238,137,109,114,213,104,143,168,14,230,203,168,172,46,213,247,224,46,81,188,205,236,253,68,194,139,190,32,94,133,192,202,65,0,59,238,209,94,111,193,113,125,11,170,254,27,148,251,111,248,18,130,233,26,43,249,84,163,217,154,63,157,183,169,57,200,124,120,168,4,215,38,61,134,45,240,161,72,5,73,81,248,144,20,103,237,195,14,162,223,222,247,137,11,42,33,245,89,66,78,154,251,34,29,237,133,225,222,109,142,82,5,133,169,149,46,31,192,74,75,76,6,135,217,133,31,164,48,36,225,86,234,175,121,176,13,225,17,25, -2,164,120,5,7,128,107,31,92,107,83,151,119,96,235,180,220,134,74,122,112,139,119,63,2,117,77,6,67,173,4,37,90,84,244,104,9,180,45,198,123,131,52,33,192,142,142,173,217,219,53,191,124,246,92,147,212,215,233,111,189,133,42,49,77,25,87,202,19,69,114,80,41,161,199,244,248,202,62,109,245,234,203,15,208,177,248,108,18,131,114,213,154,157,82,25,205,26,150,91,102,54,31,168,215,143,50,9,120,162,78,85,173,91,113,116,129,179,9,126,54,125,5,136,48,169,216,54,176,46,137,234,251,161,234,43,5,146,43,122,243,19,76,122,235,192,185,139,110,129,213,120,209,175,172,23,245,117,9,94,90,81,85,62,61,53,176,78,19,153,74,159,46,163,170,123,168,164,251,178,218,61,240,146,75,151,149,174,0,82,71,161,8,68,120,110,34,241,244,124,45,119,28,98,88,167,116,73,102,239,126,12,12,14,96,123,152,108,76,77,146,211,179,22,84,123,92,165,227,139,127,254,194,68,192,229,42,241,54,170,8,201,118,242,224,246,218,14,134,180,187,100,134,185,176,182, -224,197,125,155,160,91,220,71,121,138,98,138,59,71,36,15,228,94,200,109,34,120,210,114,78,27,93,183,209,184,87,165,221,202,43,190,214,93,163,135,108,58,8,250,218,11,94,242,103,153,124,188,50,155,9,43,39,214,184,196,30,97,85,126,92,148,243,99,57,101,209,228,81,39,106,13,5,249,71,188,154,23,90,27,27,58,169,1,143,192,217,217,217,87,190,240,38,241,178,190,100,4,42,8,30,105,115,155,12,69,101,163,53,107,146,237,11,185,205,18,125,46,181,62,199,23,128,129,243,98,165,26,136,20,214,209,93,106,29,139,171,190,207,18,115,18,211,215,168,210,7,99,247,59,240,200,91,61,77,225,179,136,170,221,161,18,184,95,101,185,183,84,235,127,149,125,166,99,64,169,230,146,38,81,25,190,104,121,66,134,197,255,223,97,254,213,31,120,32,168,30,95,150,49,43,26,59,179,255,1,53,61,134,19, +topic "LineEdit"; +[2 $$0,0#00000000000000000000000000000000:Default] +[i448;a25;kKO9;*@(64)2 $$1,0#37138531426314131252341829483380:class] +[l288;2 $$2,2#27521748481378242620020725143825:desc] +[a83;*R6 $$3,0#31310162474203024125188417583966:caption] +[l288;i1121;b17;O9;~~~.1408;2 $$4,0#10431211400427159095818037425705:param] +[i448;a25;kKO9;*@(64)2 $$5,0#37138531426314131252341829483370:item] +[*+117 $$6,6#14700283458701402223321329925657:header] +[0 $$7,0#96390100711032703541132217272105:end] +[H6;0 $$8,0#05600065144404261032431302351956:begin] +[{_} +[s1;K:`:`:LineEdit`:`:class: [@(0.0.255) class]_[@0 LineEdit]_:_[@(0.0.255) public]_[^`:`:TextCtrl^ T +extCtrl]&] +[s2; &] +[s1;l224;K:`:`:LineEdit`:`:Highlight`:`:struct: [@(0.0.255) struct]_[@0 LineEdit`::Highlig +ht]_:_[@(0.0.255) public]_[^`:`:Moveable^ Moveable]<[@0 Highlight]>&] +[s5;l224;K:`:`:LineEdit`:`:Highlight`:`:paper: [^`:`:Color^ Color]_[@0 paper]&] +[s5;l224;K:`:`:LineEdit`:`:Highlight`:`:ink: [^`:`:Color^ Color]_[@0 ink]&] +[s5;l224;K:`:`:LineEdit`:`:Highlight`:`:font: [^`:`:Font^ Font]_[@0 font]&] +[s5;l224;K:`:`:LineEdit`:`:Highlight`:`:chr: [^`:`:wchar^ wchar]_[@0 chr]&] +[s0;l224; &] +[s0;l224;i192; This structure defines syntax highlighting properties +of single character cell. See description of &] +[s5;l224;K@(0.0.255) &] +[s5;l224;K:`:`:LineEdit`:`:Highlight`:`:operator`=`=`(const`:`:LineEdit`:`:Highlight`&`)const: [@(0.0.255) b +ool]_[@0 operator`=`=]([@(0.0.255) const]_[^`:`:LineEdit`:`:Highlight^ Highlight]`&_[@3 h +])_[@(0.0.255) const]&] +[s2;l224;i192;%% Equality comparison.&] +[s0; &] +[s0; &] +[s5;K:`:`:LineEdit`:`:HighlightLine`(int`,`:`:Vector`<`:`:LineEdit`:`:Highlight`>`&`,int`): v +irtual [@(0.0.255) void]_[@0 HighlightLine]([@(0.0.255) int]_[@3 line], +[^`:`:Vector^ Vector]<[^`:`:LineEdit`:`:Highlight^ Highlight]>`&_[@3 h], +[@(0.0.255) int]_[@3 pos]) [@0 `[protected`]]&] +[s2;%% This method can be overridden to add syntax highlighting to +the LineEdit. It is called once for each line painted on the +screen. [%-*@3 line] is the line index (first line is 0), [%-*@3 h] +represents character cells in the line; client code should change +this array to achieve the highlighting, [%-*@3 pos] is the index +of character from the beginning of text. [%-*@3 h] initially contains +one more space character than is the count of characters in the +line; this additional character can be used to set the appearance +of the rest of line after the last character. You also add more +characters to the [%-*@3 h]. Default implementation is empty.&] +[s0; &] +[s5;K:`:`:LineEdit`:`:NewScrollPos`(`): virtual [@(0.0.255) void]_[@0 NewScrollPos]() +[@0 `[protected`]]&] +[s2;%% Called when scrollbar gets new position. Default implementation +is empty.&] +[s0; &] +[s5;K:`:`:LineEdit`:`:GetFontSize`(`)const: [^`:`:Size^ Size]_[@0 GetFontSize]()_[@(0.0.255) c +onst]&] +[s2;%% Returns the size of font character cell (LineEdit expects +monospace glyphs `- the width of character is constant).&] +[s0; &] +[s5;K:`:`:LineEdit`:`:GetGPos`(int`,int`)const: [@(0.0.255) int]_[@0 GetGPos]([@(0.0.255) i +nt]_[@3 ln], [@(0.0.255) int]_[@3 cl])_[@(0.0.255) const]&] +[s2;%% Returns `"graphical`" position of [%-*@3 ln] line and [%-*@3 cl] +column. This takes into account any tabulator characters int +the line.&] +[s0; &] +[s5;K:`:`:LineEdit`:`:GetMousePos`(`:`:Point`)const: [@(0.0.255) int]_[@0 GetMousePos]([^`:`:Point^ P +oint]_[@3 p])_[@(0.0.255) const]&] +[s2;%% Get the the offset of character placed at [%-*@3 p].&] +[s0; &] +[s5;K:`:`:LineEdit`:`:GetColumnLine`(int`)const: [^`:`:Point^ Point]_[@0 GetColumnLine]([@(0.0.255) i +nt]_[@3 pos])_[@(0.0.255) const]&] +[s2;%% Returns the line and column for the character at [%-*@3 pos] +accounting for any tabulators. Column is x member of resulting +Point, line is y.&] +[s0; &] +[s5;K:`:`:LineEdit`:`:GetColumnLinePos`(`:`:Point`)const: [@(0.0.255) int]_[@0 GetColumnL +inePos]([^`:`:Point^ Point]_[@3 pos])_[@(0.0.255) const]&] +[s2;%% Returns the position for given column and line [%-*@3 pos]. +Does account for tabulators.&] +[s0; &] +[s5;K:`:`:LineEdit`:`:GetIndexLine`(int`)const: [^`:`:Point^ Point]_[@0 GetIndexLine]([@(0.0.255) i +nt]_[@3 pos])_[@(0.0.255) const]&] +[s2;%% Returns the line and index of character in the line for the +given [%-*@3 pos]. Does not account for tabulators.&] +[s0; &] +[s5;K:`:`:LineEdit`:`:GetIndexLinePos`(`:`:Point`)const: [@(0.0.255) int]_[@0 GetIndexLin +ePos]([^`:`:Point^ Point]_[@3 pos])_[@(0.0.255) const]&] +[s2;%% Returns the position for given column and line [%-*@3 pos]. +Does not account for tabulators.&] +[s0; &] +[s5;K:`:`:LineEdit`:`:ScrollUp`(`): [@(0.0.255) void]_[@0 ScrollUp]()&] +[s2;%% Scrolls the text single line up.&] +[s0; &] +[s5;K:`:`:LineEdit`:`:ScrollDown`(`): [@(0.0.255) void]_[@0 ScrollDown]()&] +[s2;%% Scrolls the text single line down.&] +[s0; &] +[s5;K:`:`:LineEdit`:`:GetLineScreenRect`(int`)const: [^`:`:Rect^ Rect]_[@0 GetLineScreenR +ect]([@(0.0.255) int]_[@3 line])_[@(0.0.255) const]&] +[s2;%% Gets the absolute screen rectangle position of [%-*@3 line].&] +[s0; &] +[s5;K:`:`:LineEdit`:`:TopCursor`(`): [@(0.0.255) void]_[@0 TopCursor]()&] +[s2;%% Scrolls the text to place the line with cursor is first in +the view.&] +[s0; &] +[s5;K:`:`:LineEdit`:`:CenterCursor`(`): [@(0.0.255) void]_[@0 CenterCursor]()&] +[s2;%% Scrolls the text to place the line with cursor at the center +of the view.&] +[s0; &] +[s5;K:`:`:LineEdit`:`:MoveUpDown`(int`,bool`): [@(0.0.255) void]_[@0 MoveUpDown]([@(0.0.255) i +nt]_[@3 n], [@(0.0.255) bool]_[@3 sel]_`=_false)&] +[s2;%% Moves the cursor [%-*@3 n] lines up ([%-*@3 n] is negative) or +down. If [%-*@3 sel] is true, selects characters between starting +and ending cursor position.&] +[s0; &] +[s5;K:`:`:LineEdit`:`:MoveLeft`(bool`): [@(0.0.255) void]_[@0 MoveLeft]([@(0.0.255) bool]_[@3 s +el]_`=_false)&] +[s5;K:`:`:LineEdit`:`:MoveRight`(bool`): [@(0.0.255) void]_[@0 MoveRight]([@(0.0.255) bool]_ +[@3 sel]_`=_false)&] +[s5;K:`:`:LineEdit`:`:MoveUp`(bool`): [@(0.0.255) void]_[@0 MoveUp]([@(0.0.255) bool]_[@3 sel +]_`=_false)&] +[s5;K:`:`:LineEdit`:`:MoveDown`(bool`): [@(0.0.255) void]_[@0 MoveDown]([@(0.0.255) bool]_[@3 s +el]_`=_false)&] +[s5;K:`:`:LineEdit`:`:MovePageUp`(bool`): [@(0.0.255) void]_[@0 MovePageUp]([@(0.0.255) boo +l]_[@3 sel]_`=_false)&] +[s5;K:`:`:LineEdit`:`:MovePageDown`(bool`): [@(0.0.255) void]_[@0 MovePageDown]([@(0.0.255) b +ool]_[@3 sel]_`=_false)&] +[s5;K:`:`:LineEdit`:`:MoveHome`(bool`): [@(0.0.255) void]_[@0 MoveHome]([@(0.0.255) bool]_[@3 s +el]_`=_false)&] +[s5;K:`:`:LineEdit`:`:MoveEnd`(bool`): [@(0.0.255) void]_[@0 MoveEnd]([@(0.0.255) bool]_[@3 s +el]_`=_false)&] +[s5;K:`:`:LineEdit`:`:MoveTextBegin`(bool`): [@(0.0.255) void]_[@0 MoveTextBegin]([@(0.0.255) b +ool]_[@3 sel]_`=_false)&] +[s5;K:`:`:LineEdit`:`:MoveTextEnd`(bool`): [@(0.0.255) void]_[@0 MoveTextEnd]([@(0.0.255) b +ool]_[@3 sel]_`=_false)&] +[s0;%% [%- -|Moves the cursor in specified direction (Home/End are beginning/end +of line). ]If [%-*@3 sel] is true, selects characters between starting +and ending cursor position.&] +[s0; &] +[s5;K:`:`:LineEdit`:`:InsertChar`(`:`:dword`,int`,bool`): [@(0.0.255) bool]_[@0 InsertCha +r]([^`:`:dword^ dword]_[@3 key], [@(0.0.255) int]_[@3 count]_`=_[@3 1], +[@(0.0.255) bool]_[@3 canoverwrite]_`=_false)&] +[s2;%% Inserts [%-*@3 count ]characters [%-*@3 key] at cursor position. +If [%-*@3 canoverwrite] is true, overwrite mode (as set by user +pressing Insert key) can be used.&] +[s0; &] +[s5;K:`:`:LineEdit`:`:DeleteChar`(`): [@(0.0.255) void]_[@0 DeleteChar]()&] +[s2;%% Deletes character at cursor position.&] +[s0; &] +[s5;K:`:`:LineEdit`:`:Backspace`(`): [@(0.0.255) void]_[@0 Backspace]()&] +[s2;%% If character is not first in the text, deletes it and moves +cursor one position back.&] +[s0; &] +[s5;K:`:`:LineEdit`:`:DeleteLine`(`): [@(0.0.255) void]_[@0 DeleteLine]()&] +[s2;%% Deletes a line with cursor (if it is not the only line in +the text).&] +[s0; &] +[s5;K:`:`:LineEdit`:`:CutLine`(`): [@(0.0.255) void]_[@0 CutLine]()&] +[s2;%% Stores a line to clipboard and calls DeleteLine.&] +[s0; &] +[s5;K:`:`:LineEdit`:`:GetScrollPos`(`)const: [^`:`:Point^ Point]_[@0 GetScrollPos]()_[@(0.0.255) c +onst]&] +[s2;%% Returns the actual scroll position.&] +[s0; &] +[s5;K:`:`:LineEdit`:`:GetPageSize`(`): [^`:`:Size^ Size]_[@0 GetPageSize]()&] +[s2;%% Returns the current view size in character cells.&] +[s0; &] +[s5;K:`:`:LineEdit`:`:SetScrollPos`(`:`:Point`): [@(0.0.255) void]_[@0 SetScrollPos]([^`:`:Point^ P +oint]_[@3 p])&] +[s2;%% Sets the scroll position of view, e.g. to the value obtained +by GetScrollPos.&] +[s0; &] +[s5;K:`:`:LineEdit`:`:GetEditPos`(`)const: [^`:`:LineEdit`:`:EditPos^ EditPos]_[@0 GetEdi +tPos]()_[@(0.0.255) const]&] +[s2;%% Returns the edit position in the text to be restored later. +Edit position comprises cursor and scrollbar positions.&] +[s0; &] +[s5;K:`:`:LineEdit`:`:SetEditPos`(const`:`:LineEdit`:`:EditPos`&`): [@(0.0.255) void]_[@0 S +etEditPos]([@(0.0.255) const]_[^`:`:LineEdit`:`:EditPos^ LineEdit`::EditPos]`&_[@3 pos]) +&] +[s2;%% Sets the edit position obtained by calling GetEditPos. If +cursor is not in the view after restoring, view is scrolled so +that it is by calling ScrollIntoCursor.&] +[s0; &] +[s5;K:`:`:LineEdit`:`:SetEditPosSb`(const`:`:LineEdit`:`:EditPos`&`): [@(0.0.255) void]_ +[@0 SetEditPosSb]([@(0.0.255) const]_[^`:`:LineEdit`:`:EditPos^ LineEdit`::EditPos]`&_[@3 p +os])&] +[s2;%% Sets the edit position obtained by calling GetEditPos. Unlike +SetEditPos, no scrolls are performed to get cursor into the view.&] +[s0; &] +[s5;K:`:`:LineEdit`:`:ScrollIntoCursor`(`): [@(0.0.255) void]_[@0 ScrollIntoCursor]()&] +[s2;%% Performs minimal scroll to get the cursor into the view. `"Minimal`" +means that if cursor is `"before`" the view, view is scrolled +to move cursor to the first line, if it is `"after`", it is moved +to the last line.&] +[s0; &] +[s5;K:`:`:LineEdit`:`:GetCaretPoint`(`)const: [^`:`:Point^ Point]_[@0 GetCaretPoint]()_[@(0.0.255) c +onst]&] +[s2;%% &] +[s0; &] +[s5;K:`:`:LineEdit`:`:Clear`(`): [@(0.0.255) void]_[@0 Clear]()&] +[s2;%% Sets the text empty.&] +[s0; &] +[s5;K:`:`:LineEdit`:`:OverWriteMode`(bool`): [@(0.0.255) void]_[@0 OverWriteMode]([@(0.0.255) b +ool]_[@3 o]_`=_true)&] +[s5;K:`:`:LineEdit`:`:IsOverWriteMode`(`)const: [@(0.0.255) bool]_[@0 IsOverWriteMode]()_ +[@(0.0.255) const]&] +[s2;%% In OverWriteMode mode, input characters replace the content +instead of being inserted.&] +[s0; &] +[s5;K:`:`:LineEdit`:`:RefreshChars`(bool`(`*`)`(int c`)`): [@(0.0.255) void]_[@0 RefreshC +hars]([@(0.0.255) bool]_(`*[@3 predicate])([@(0.0.255) int]_c))&] +[s2;%% Calls [%-*@3 predicate] for all characters in current view and +when it returns true refreshes (schedules for repainting) character +cell. It is useful for advanced code editors (e.g. refreshing +color of braces in TheIDE editor).&] +[s0; &] +[s5;K:`:`:LineEdit`:`:TabSize`(int`): [^`:`:LineEdit^ LineEdit]`&_[@0 TabSize]([@(0.0.255) i +nt]_[@3 n])&] +[s2;%% Sets the tabulator size.&] +[s0; &] +[s5;K:`:`:LineEdit`:`:GetTabSize`(`)const: [@(0.0.255) int]_[@0 GetTabSize]()_[@(0.0.255) c +onst]&] +[s2;%% Returns current tabulator size.&] +[s0; &] +[s5;K:`:`:LineEdit`:`:BorderColumn`(int`,`:`:Color`): [^`:`:LineEdit^ LineEdit]`&_[@0 Bor +derColumn]([@(0.0.255) int]_[@3 col], [^`:`:Color^ Color]_[@3 c]_`=_SColorFace())&] +[s2;%% [%-*@3 col] [%-*@3 c] &] +[s0; &] +[s5;K:`:`:LineEdit`:`:SetFont`(`:`:Font`): [^`:`:LineEdit^ LineEdit]`&_[@0 SetFont]([^`:`:Font^ F +ont]_[@3 f])&] +[s2;%% Sets the font. HighlightLine can replace this font, however, +the size of character cell is determined by this font (note that +CJK ideograms are two character cells wide). Font should be monospaced. +Returns `*this. Default font is Courier(16).&] +[s0; &] +[s5;K:`:`:LineEdit`:`:GetFont`(`)const: [^`:`:Font^ Font]_[@0 GetFont]()_[@(0.0.255) const]&] +[s2;%% Returns the font.&] +[s0; &] +[s5;K:`:`:LineEdit`:`:NoHorzScrollbar`(bool`): [^`:`:LineEdit^ LineEdit]`&_[@0 NoHorzScro +llbar]([@(0.0.255) bool]_[@3 b]_`=_true)&] +[s2;%% In this mode horizontal scrollbar is never shown. Default +is off.&] +[s0; &] +[s5;K:`:`:LineEdit`:`:ShowTabs`(bool`): [^`:`:LineEdit^ LineEdit]`&_[@0 ShowTabs]([@(0.0.255) b +ool]_[@3 st]_`=_true)&] +[s5;K:`:`:LineEdit`:`:IsShowTabs`(`)const: [@(0.0.255) bool]_[@0 IsShowTabs]()_[@(0.0.255) c +onst]&] +[s2;%% In this mode widget displays tabulators with faint graphics. +Default is off.&] +[s0; &] +[s5;K:`:`:LineEdit`:`:WithCutLine`(bool`): [^`:`:LineEdit^ LineEdit]`&_[@0 WithCutLine]([@(0.0.255) b +ool]_[@3 b])&] +[s5;K:`:`:LineEdit`:`:NoCutLine`(`): [^`:`:LineEdit^ LineEdit]`&_[@0 NoCutLine]()&] +[s2;%% In this mode widget calls CutLine when user presses Ctrl`+Y +or Ctrl`+L. Default is on.&] +[s0; ] \ No newline at end of file diff --git a/uppsrc/ide/Help.cpp b/uppsrc/ide/Help.cpp index 9a35a6d74..1688da0a5 100644 --- a/uppsrc/ide/Help.cpp +++ b/uppsrc/ide/Help.cpp @@ -91,7 +91,39 @@ void TopicCtrl::LoadMap() lang.SetIndex(0); } -const char *sTopicHome = "\3topic://ide/app/index$en-us"; +static String sTopicHome = "\3topic://ide/app/index$en-us"; +static String s_idehelp = "TheIDE help"; +static String s_usedpackages = "Used packages"; +static String s_otherpackages = "Other packages"; +static String s_documents = "Documents"; +static String s_reference = "Reference"; +static String s_implementation = "Implementation"; + +inline int sFindN(const String& s) +{ + if(s == s_idehelp) return 0; + if(s == s_usedpackages) return 1; + if(s == s_otherpackages) return 2; + if(s == s_documents) return 3; + if(s == s_reference) return 4; + if(s == s_implementation) return 5; + return 6; +} + +int TopicSortOrder(const Value& k1, const Value& v1, const Value& k2, const Value& v2) +{ + String s1 = v1; + String s2 = v2; + bool bk1 = IsNull(k1); + bool bk2 = IsNull(k2); + int q = (int)bk1 - (int)bk2; + if(q) return q; + if(bk1) { + int q = sFindN(s1) - sFindN(s2); + if(q) return q; + } + return StdValueCompare(v1, v2); +} void TopicCtrl::SyncDocTree() { @@ -107,19 +139,19 @@ void TopicCtrl::SyncDocTree() ClearTree(); - String hdx = sTopicHome + 1; + String hdx = sTopicHome.Mid(1); if(idelink.GetCount() == 0) GatherLinks(idelink, hdx); int ide; bool idefirst = true; if(MatchTopicLink(hdx, sdx)) { - ide = AddTree(0, IdeImg::Package(), "\3" + hdx, "TheIDE help"); + ide = AddTree(0, IdeImg::Package(), "\3" + hdx, s_idehelp); idefirst = false; } for(int i = 0; i < idelink.GetCount(); i++) { if(idelink[i] != hdx && MatchTopicLink(idelink[i], sdx)) { if(idefirst) { - ide = AddTree(0, IdeImg::Package(), "\3" + hdx, "TheIDE help"); + ide = AddTree(0, IdeImg::Package(), "\3" + hdx, s_idehelp); idefirst = false; } AddTree(ide, TopicImg::Topic(), "\3" + idelink[i], GetTopic(idelink[i]).title); @@ -148,11 +180,11 @@ void TopicCtrl::SyncDocTree() if(all || tl.group == "src" || tl.group == "srcdoc" || tl.group == "srcimp") { String n = tl.group; if(n == "src") - n = "Reference"; + n = s_reference; if(n == "srcdoc") - n = "Documents"; + n = s_documents; if(n == "srcimp") - n = "Implementation"; + n = s_implementation; int gid; bool groupfirst = true; const Index& topic = group[i]; @@ -167,18 +199,14 @@ void TopicCtrl::SyncDocTree() int pd; if(used.Find(tl.package) >= 0) { if(usedfirst) { - usid = AddTree(0, IdeImg::Package(), Null, "Used packages"); + usid = AddTree(0, IdeImg::Package(), Null, s_usedpackages); usedfirst = false; } pd = usid; } else { if(otherfirst) { - if(usedfirst) { - usid = AddTree(0, IdeImg::Package(), Null, "Used packages"); - usedfirst = false; - } - otid = AddTree(0, IdeImg::Package(), Null, "Other packages"); + otid = AddTree(0, IdeImg::Package(), Null, s_otherpackages); otherfirst = false; } pd = otid; @@ -199,12 +227,7 @@ void TopicCtrl::SyncDocTree() } } } - if(!idefirst) - SortTree(ide); - if(!usedfirst) - SortTree(usid); - if(!otherfirst) - SortTree(otid); + SortTree(0, TopicSortOrder); FinishTree(); if(sdx.GetCount()) { OpenDeep();