From 7e64005df63eca3da1353bf585ea40afb061a9aa Mon Sep 17 00:00:00 2001 From: cxl Date: Wed, 20 Jun 2018 18:53:14 +0000 Subject: [PATCH] ide: First nests dlg line now bold (to indicate the main package) git-svn-id: svn://ultimatepp.org/upp/trunk@12008 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/ide/BaseDlg.cpp | 15 +++++++++++++++ uppsrc/ide/Methods.cpp | 10 +--------- uppsrc/ide/ide.h | 2 ++ 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/uppsrc/ide/BaseDlg.cpp b/uppsrc/ide/BaseDlg.cpp index 1146cb7ba..b94af5246 100644 --- a/uppsrc/ide/BaseDlg.cpp +++ b/uppsrc/ide/BaseDlg.cpp @@ -156,6 +156,19 @@ NestEditorDlg::NestEditorDlg() Sync(); } +struct BoldDisplayClass : Display { + virtual void Paint(Draw& w, const Rect& r, const Value& q, + Color ink, Color paper, dword style) const { + w.DrawRect(r, paper); + DrawSmartText(w, r.left, r.top, r.Width(), (String)q, StdFont().Bold(), ink); + } +}; + +Display& BoldDisplay() +{ + return Single(); +} + void NestEditorDlg::Sync() { bool b = nests.GetCount(); @@ -163,6 +176,8 @@ void NestEditorDlg::Sync() remove.Enable(b); up.Enable(b); down.Enable(b); + for(int i = 0; i < nests.GetCount(); i++) + nests.SetDisplay(i, 0, i == 0 ? BoldDisplay() : StdDisplay()); } bool BaseSetup(String& vars) { return BaseSetupDlg().Run(vars); } diff --git a/uppsrc/ide/Methods.cpp b/uppsrc/ide/Methods.cpp index f4131e5ef..62e245aab 100644 --- a/uppsrc/ide/Methods.cpp +++ b/uppsrc/ide/Methods.cpp @@ -605,20 +605,12 @@ bool BuildMethods::Save() return true; } -struct BoldDisplay : Display { - virtual void Paint(Draw& w, const Rect& r, const Value& q, - Color ink, Color paper, dword style) const { - w.DrawRect(r, paper); - DrawSmartText(w, r.left, r.top, r.Width(), (String)q, StdFont().Bold(), ink); - } -}; - void BuildMethods::ShowDefault() { String m = GetDefaultMethod(); for(int i = 0; i < method.GetCount(); i++) if((String)method.Get(i, 0) == m) - method.SetDisplay(i, 0, Single()); + method.SetDisplay(i, 0, BoldDisplay()); else method.SetDisplay(i, 0, StdDisplay()); } diff --git a/uppsrc/ide/ide.h b/uppsrc/ide/ide.h index b47690bbf..e53eab6ee 100644 --- a/uppsrc/ide/ide.h +++ b/uppsrc/ide/ide.h @@ -53,6 +53,8 @@ bool IsTextFile(const String& file, int maxline = INT_MAX); void Puts(const char *s); +Display& BoldDisplay(); + class Console : public LineEdit { public: virtual bool Key(dword key, int count);