diff --git a/uppsrc/CtrlLib/FileSel.cpp b/uppsrc/CtrlLib/FileSel.cpp index ef9c700a4..b2c963d88 100644 --- a/uppsrc/CtrlLib/FileSel.cpp +++ b/uppsrc/CtrlLib/FileSel.cpp @@ -16,11 +16,10 @@ struct FileIconMaker : ImageMaker { Color c = White(); Image m[2]; for(int i = 0; i < 2; i++) { - SHFILEINFOW info; - WString wfile = file.ToWString(); - SHGetFileInfoW(~wfile, dir ? FILE_ATTRIBUTE_DIRECTORY : FILE_ATTRIBUTE_NORMAL, - &info, sizeof(info), - SHGFI_ICON|SHGFI_SMALLICON|(exe ? 0 : SHGFI_USEFILEATTRIBUTES)); + SHFILEINFO info; + SHGetFileInfo(ToSystemCharset(file), dir ? FILE_ATTRIBUTE_DIRECTORY : FILE_ATTRIBUTE_NORMAL, + &info, sizeof(info), + SHGFI_ICON|SHGFI_SMALLICON|(exe ? 0 : SHGFI_USEFILEATTRIBUTES)); HICON icon = info.hIcon; ICONINFO iconinfo; if(!icon || !GetIconInfo(icon, &iconinfo)) diff --git a/uppsrc/CtrlLib/TabCtrl.cpp b/uppsrc/CtrlLib/TabCtrl.cpp index 90b7caa70..09a82857f 100644 --- a/uppsrc/CtrlLib/TabCtrl.cpp +++ b/uppsrc/CtrlLib/TabCtrl.cpp @@ -202,7 +202,7 @@ void TabCtrl::Paint(Draw& w) ChPaint(w, 0, th, sz.cx, sz.cy - th, style->body); } -int TabCtrl::GetTab(Point p) +int TabCtrl::GetTab(Point p) const { if(p.y >= 0 && p.y < style->tabheight) for(int i = 0; i < tab.GetCount(); i++) diff --git a/uppsrc/CtrlLib/TabCtrl.h b/uppsrc/CtrlLib/TabCtrl.h index 6472077fd..e5c643289 100644 --- a/uppsrc/CtrlLib/TabCtrl.h +++ b/uppsrc/CtrlLib/TabCtrl.h @@ -33,7 +33,7 @@ public: void Layout(int x, int y, int cy); void Paint(Draw& w, int state); - int Right() { return x + cx; } + int Right() const { return x + cx; } public: Item& Text(const String& _text); @@ -85,7 +85,6 @@ private: static Image Fade(int i); - int GetTab(Point p); void PaintTabs(Draw& w); void ScrollInto(int i); void Left(); @@ -112,6 +111,8 @@ public: void Remove(int i); + int GetTab(Point p) const; + int GetCount() const { return tab.GetCount(); } Item& GetItem(int i) { return tab[i]; } const Item& GetItem(int i) const { return tab[i]; } diff --git a/uppsrc/IconDes/Bar.cpp b/uppsrc/IconDes/Bar.cpp index 9f357035e..64ac19dce 100644 --- a/uppsrc/IconDes/Bar.cpp +++ b/uppsrc/IconDes/Bar.cpp @@ -103,7 +103,7 @@ void IconDes::SettingBar(Bar& bar) paste_opaque ? IconDesImg::PasteOpaque() : IconDesImg::PasteTransparent(), THISBACK(TogglePaste)) - .Key(K_CTRL_T); + .Key(K_ALT_T); } void IconDes::SelectBar(Bar& bar) diff --git a/uppsrc/RichText/TextData.cpp b/uppsrc/RichText/TextData.cpp index e25ff8e71..099289ce6 100644 --- a/uppsrc/RichText/TextData.cpp +++ b/uppsrc/RichText/TextData.cpp @@ -280,17 +280,19 @@ void RichText::ApplyFormatInfo(int pos, const FormatInfo& fi, int count) void RichText::ReplaceStyle(int pos, const Uuid& id) { - int p = FindPart(pos); - RichPara pa = RichTxt::Get(p, id, style); - Put(p, pa, style); + RichTxt& txt = GetUpdateText(pos); + int p = txt.FindPart(pos); + RichPara pa = txt.Get(p, id, style); + txt.Set(p, pa, style); } void RichText::ReStyle(int pos, const Uuid& id) { - int p = FindPart(pos); - RichPara pa = Get(p); + RichTxt& txt = GetUpdateText(pos); + int p = txt.FindPart(pos); + RichPara pa = txt.Get(p, style); pa.format.styleid = id; - Put(p, pa, style); + txt.Set(p, pa, style); } RichText::Formating RichText::SaveFormat(int pos, int count) const diff --git a/uppsrc/ide/Assist.cpp b/uppsrc/ide/Assist.cpp index 87820ff9e..34e5bb8fa 100644 --- a/uppsrc/ide/Assist.cpp +++ b/uppsrc/ide/Assist.cpp @@ -1,8 +1,14 @@ #include "ide.h" -#define LDUMP(x) // DDUMP(x) -#define LDUMPC(x) // DDUMPC(x) -#define LLOG(x) // DLOG(x) +#if 0 +#define LDUMP(x) DDUMP(x) +#define LDUMPC(x) DDUMPC(x) +#define LLOG(x) DLOG(x) +#else +#define LDUMP(x) +#define LDUMPC(x) +#define LLOG(x) +#endif class IndexSeparatorFrameCls : public CtrlFrame { virtual void FrameLayout(Rect& r) { r.right -= 1; } @@ -160,6 +166,8 @@ String AssistEditor::CompleteIdBack(int& q) id = "::" + id; } else { + if(iscib(*id)) + break; String nid = IdBack(q); if(IsNull(nid)) break; @@ -298,10 +306,11 @@ void AssistEditor::Assist() if(Ch(q - 1) == '(') { --q; String id = IdBack(q); - if(id == "THISBACK") + if(id == "THISBACK") { GatherItems(parser.current_scope, false, in_types, false, true); + PopUpAssist(); + } } - else if(Ch(q - 1) == ':') { while(Ch(q - 1) == ':') q--; @@ -324,13 +333,13 @@ void AssistEditor::Assist() GatherItems("", false, in_types2, true, false); } } - if(assist_item.GetCount() == 0) - return; PopUpAssist(); } void AssistEditor::PopUpAssist(bool auto_insert) { + if(assist_item.GetCount() == 0) + return; int lcy = max(16, BrowserFont().Info().GetHeight()); type.Clear(); type.Add(AttrText("").Ink(SColorHighlight())); @@ -513,9 +522,7 @@ bool AssistEditor::Key(dword key, int count) else if(auto_assist && InCode()) { if(key == '.' || key == '>' && Ch(GetCursor() - 2) == '-' || - key == ':' && Ch(GetCursor() - 2) == ':') - Assist(); - if(key == '(') + key == ':' && Ch(GetCursor() - 2) == ':' || key == '(') Assist(); } if(key == ',') { diff --git a/uppsrc/ide/Cpp.cpp b/uppsrc/ide/Cpp.cpp index a9e0b1ae3..7cb77c8d2 100644 --- a/uppsrc/ide/Cpp.cpp +++ b/uppsrc/ide/Cpp.cpp @@ -1,8 +1,14 @@ #include "ide.h" -#define LDUMP(x) // DDUMP(x) -#define LDUMPC(x) // DDUMPC(x) -#define LLOG(x) // DLOG(x) +#if 0 +#define LDUMP(x) DDUMP(x) +#define LDUMPC(x) DDUMPC(x) +#define LLOG(x) DLOG(x) +#else +#define LDUMP(x) +#define LDUMPC(x) +#define LLOG(x) +#endif static Array sEmpty; @@ -141,8 +147,7 @@ void AssistEditor::ExpressionType(const String& ttype, const Vector& xp, const Array& n = GetTypeItems(type); String id = xp[ii]; int q = id.ReverseFind(':'); - if(q > 0 && id[q - 1] == ':') { - id = id.Mid(q + 1); + if(q > 0 && id[q - 1] == ':') { // problem here!!! ExpressionType(ResolveTParam(Qualify("", id.Mid(0, q - 1)), tparam), xp, ii + 1, typeset); return; } diff --git a/uppsrc/ide/Navigator.cpp b/uppsrc/ide/Navigator.cpp index 68c6c6eea..bc23ad686 100644 --- a/uppsrc/ide/Navigator.cpp +++ b/uppsrc/ide/Navigator.cpp @@ -173,6 +173,7 @@ void AssistEditor::IndexClick() void AssistEditor::SyncCursor() { + browser.search.NullText(String("Find (") + GetKeyDesc(IdeKeys::AK_SEARCHCODE().key[0]) + ") "); if(navigator == NAV_INDEX) { if(!index.IsCursor()) index.SetCursor(0); diff --git a/uppsrc/ide/icon.ico b/uppsrc/ide/icon.ico index 1b29c0346..1e6c67600 100644 Binary files a/uppsrc/ide/icon.ico and b/uppsrc/ide/icon.ico differ diff --git a/uppsrc/ide/ide.key b/uppsrc/ide/ide.key index c3064dbf7..8fef4593a 100644 --- a/uppsrc/ide/ide.key +++ b/uppsrc/ide/ide.key @@ -89,4 +89,4 @@ KEY(CLEARMARKERSFILE, "Remove change markers in file", K_ALT_R) KEY(CLEARMARKERSALL, "Remove all change markers", K_SHIFT|K_ALT_R) KEY(TOGGLEINDEX, "File index", K_CTRL_F12) KEY(SEARCHINDEX, "File index search", K_F12) -KEY(SEARCHCODE, "Search code", K_CTRL_D) +KEY(SEARCHCODE, "Search code", K_CTRL_Q)