diff --git a/uppsrc/TabBar/FileTabs.cpp b/uppsrc/TabBar/FileTabs.cpp index b95a1f399..b70d9ce04 100644 --- a/uppsrc/TabBar/FileTabs.cpp +++ b/uppsrc/TabBar/FileTabs.cpp @@ -71,6 +71,16 @@ Size FileTabs::GetStackedSize(const Tab &t) return GetTextSize(s.ToWString(), GetStyle().font) + Size(TB_SPACEICON, 0); } +void FileTabs::Serialize(Stream& s) +{ + TabBar::Serialize(s); + if(s.IsLoading() && icons) + { + for(int i = 0; i < tabs.GetCount(); i++) + tabs[i].img = NativePathIcon(String(tabs[i].value)); + } +} + void FileTabs::AddFile(const WString &file, bool make_active) { AddFile(file, NativePathIcon(file.ToString()), make_active); @@ -167,7 +177,7 @@ greyedicons(true), filecolor(SColorText), extcolor(LtBlue) { - + } END_UPP_NAMESPACE diff --git a/uppsrc/TabBar/FileTabs.h b/uppsrc/TabBar/FileTabs.h index 4d596e7eb..9c4436c24 100644 --- a/uppsrc/TabBar/FileTabs.h +++ b/uppsrc/TabBar/FileTabs.h @@ -16,9 +16,12 @@ protected: virtual void ComposeTab(Tab& tab, const Font &font, Color ink, int style); virtual void ComposeStackedTab(Tab& tab, const Tab& stacked_tab, const Font &font, Color ink, int style); virtual Size GetStackedSize(const Tab &t); + public: FileTabs(); + virtual void Serialize(Stream& s); + void AddFile(const WString &file, bool make_active = true); void AddFile(const WString &file, Image img, bool make_active = true); void InsertFile(int ix, const WString &file, bool make_active = true); diff --git a/uppsrc/TabBar/TabBar.cpp b/uppsrc/TabBar/TabBar.cpp index e82bb7165..5eba4ff08 100644 --- a/uppsrc/TabBar/TabBar.cpp +++ b/uppsrc/TabBar/TabBar.cpp @@ -429,6 +429,7 @@ void TabBar::Tab::Set(const Tab& t) id = t.id; img = t.img; + col = t.col; key = t.key; value = t.value; group = t.group; @@ -825,29 +826,29 @@ Point TabBar::GetTextPosition(int align, const Rect& r, int cy, int space) const return p; } -Point TabBar::GetImagePosition(int align, const Rect& r, int cx, int cy, int space, int side) const +Point TabBar::GetImagePosition(int align, const Rect& r, int cx, int cy, int space, int side, int offset) const { Point p; if (align == LEFT) { - p.x = r.left + (r.GetWidth() - cy) / 2; + p.x = r.left + (r.GetWidth() - cy) / 2 + offset; p.y = side == LEFT ? r.bottom - space - cx : r.top + space; } else if (align == RIGHT) { - p.x = r.right - (r.GetWidth() + cy) / 2; + p.x = r.right - (r.GetWidth() + cy) / 2 - offset; p.y = side == LEFT ? r.top + space : r.bottom - space - cx; } else if (align == TOP) { p.x = side == LEFT ? r.left + space : r.right - cx - space; - p.y = r.top + (r.GetHeight() - cy) / 2; + p.y = r.top + (r.GetHeight() - cy) / 2 + offset; } else if (align == BOTTOM) { p.x = side == LEFT ? r.left + space : r.right - cx - space; - p.y = r.bottom - (r.GetHeight() + cy) / 2; + p.y = r.bottom - (r.GetHeight() + cy) / 2 - offset; } return p; } @@ -959,6 +960,11 @@ void TabBar::PaintTab(Draw &w, const Size &sz, int n, bool enable, bool dragsamp const Value& sv = (cnt == 1 ? s.both : c == 0 ? s.first : c == cnt - 1 ? s.last : s.normal)[ndx]; Image img = AlignValue(align, sv, t.tab_size); + + if(!IsNull(t.col)) + { + img = Colorize(img, t.col); + } if(dragsample) { @@ -1196,7 +1202,7 @@ Size TabBar::GetStackedSize(const Tab &t) Size TabBar::GetStdSize(const Tab &t) { - return (PaintIcons() && t.HasIcon()) ? (GetStdSize(t.value) + Size(TB_ICON+2, 0)) : GetStdSize(t.value); + return (PaintIcons() && t.HasIcon()) ? (GetStdSize(t.value) + Size(TB_ICON + 2, 0)) : GetStdSize(t.value); } TabBar& TabBar::Add(const Value &value, Image icon, String group, bool make_active) @@ -1907,10 +1913,7 @@ void TabBar::LeftDown(Point p, dword keyflags) UpdateActionRefresh(); } else - if (SetCursor0(highlight)) { - CursorChanged(); - UpdateAction(); - } + SetCursor0(highlight, true); } } @@ -2026,6 +2029,12 @@ void TabBar::SetHighlight(int n) Refresh(); } +void TabBar::SetColor(int n, Color c) +{ + tabs[n].col = c; + Refresh(); +} + void TabBar::MouseMove(Point p, dword keyflags) { if(HasCapture() && (keyflags & K_SHIFT)) @@ -2175,7 +2184,7 @@ void TabBar::DragRepeat(Point p) } } -bool TabBar::SetCursor0(int n) +bool TabBar::SetCursor0(int n, bool action) { if(tabs.GetCount() == 0) return false; @@ -2184,6 +2193,8 @@ bool TabBar::SetCursor0(int n) { n = max(0, FindId(GetGroupActive())); active = -1; + highlight = -1; + drag_highlight = -1; if (allownullcursor) return true; } @@ -2222,6 +2233,12 @@ bool TabBar::SetCursor0(int n) if(cx > 0) sc.AddPos(cx + 10); } + + if(action) + { + CursorChanged(); + UpdateAction(); + } Refresh(); @@ -2235,8 +2252,7 @@ bool TabBar::SetCursor0(int n) void TabBar::SetCursor(int n) { - if (SetCursor0(n)) - CursorChanged(); + SetCursor0(n, true); } void TabBar::SetTabGroup(int n, const String &group) @@ -2277,6 +2293,9 @@ void TabBar::Close(int n) active--; Refresh(); if (n == highlight && Ctrl::HasMouse()) { + //TODO: That must be refactored + highlight = -1; + drag_highlight = -1; Sync(); MouseMove(GetMouseViewPos(), 0); } @@ -2306,6 +2325,14 @@ TabBar::Style& TabBar::Style::Variant1Crosses() return *this; } +TabBar::Style& TabBar::Style::Variant2Crosses() +{ + crosses[0] = TabBarImg::VARIANT2_CR0(); + crosses[1] = TabBarImg::VARIANT2_CR1(); + crosses[2] = TabBarImg::VARIANT2_CR2(); + return *this; +} + TabBar::Style& TabBar::Style::GroupSeparators(Value horz, Value vert) { group_separators[0] = horz; @@ -2395,6 +2422,7 @@ void TabBar::Serialize(Stream& s) cross = -1; highlight = -1; + drag_highlight = -1; target = -1; int n = groups.GetCount(); @@ -2414,14 +2442,20 @@ void TabBar::Serialize(Stream& s) int g = GetGroup(); s % g; group = g; - - Repos(); } CH_STYLE(TabBar, Style, StyleDefault) { Assign(TabCtrl::StyleDefault()); - DefaultCrosses().DefaultGroupSeparators(); + #ifdef PLATFORM_LINUX + DefaultCrosses(); + #else + if(IsWinVista()) + Variant2Crosses(); + else + DefaultCrosses(); + #endif + DefaultGroupSeparators(); } END_UPP_NAMESPACE diff --git a/uppsrc/TabBar/TabBar.h b/uppsrc/TabBar/TabBar.h index 621d2321b..f5c6c33ea 100644 --- a/uppsrc/TabBar/TabBar.h +++ b/uppsrc/TabBar/TabBar.h @@ -108,6 +108,7 @@ public: Style& DefaultCrosses(); Style& Variant1Crosses(); + Style& Variant2Crosses(); Style& DefaultGroupSeparators(); Style& GroupSeparators(Value horz, Value vert); @@ -149,6 +150,7 @@ public: int id; Image img; + Color col; Value key; Value value; String group; @@ -231,7 +233,6 @@ protected: int active; int id; -private: int highlight; int drag_highlight; int target; @@ -286,7 +287,7 @@ private: int GetWidth() const; int GetHeight(bool scrollbar = true) const; - bool SetCursor0(int n); + bool SetCursor0(int n, bool action = false); void DoStacking(); void DoUnstacking(); @@ -360,7 +361,7 @@ protected: // Paint helpers int GetTextAngle(); Point GetTextPosition(int align, const Rect& r, int cy, int space) const; - Point GetImagePosition(int align, const Rect& r, int cx, int cy, int space, int side) const; + Point GetImagePosition(int align, const Rect& r, int cx, int cy, int space, int side, int offset = 2) const; bool PaintIcons() { return icons; } // Sub-class menu overrides @@ -455,6 +456,8 @@ public: void SetKey(int n, const Value &newkey); void SetIcon(int n, Image icon); void SetTabGroup(int n, const String& group); + + void SetColor(int n, Color c); const Tab& operator[] (int n) const { return tabs[n]; } diff --git a/uppsrc/TabBar/TabBar.iml b/uppsrc/TabBar/TabBar.iml index 2ef2895ec..550c6185f 100644 --- a/uppsrc/TabBar/TabBar.iml +++ b/uppsrc/TabBar/TabBar.iml @@ -1,5 +1,8 @@ PREMULTIPLIED IMAGE_ID(CHK) +IMAGE_ID(VARIANT2_CR0) +IMAGE_ID(VARIANT2_CR1) +IMAGE_ID(VARIANT2_CR2) IMAGE_ID(CR0) IMAGE_ID(CR1) IMAGE_ID(CR2) @@ -11,75 +14,78 @@ IMAGE_ID(SEPV) IMAGE_ID(STSEP) IMAGE_BEGIN_DATA -IMAGE_DATA(120,156,221,87,11,80,85,215,21,61,66,226,32,218,106,35,202,136,90,73,38,198,233,116,146,209,233,76,53,13,49,133) -IMAGE_DATA(10,35,26,80,162,216,128,17,153,40,254,81,11,209,74,148,140,198,241,219,88,27,141,159,136,63,254,8,130,252,68,249) -IMAGE_DATA(137,124,5,84,16,34,159,247,4,2,143,199,95,68,160,32,160,118,117,239,3,151,0,225,129,211,169,205,164,155,89,179) -IMAGE_DATA(207,222,123,173,123,206,62,247,220,119,47,194,64,24,136,255,130,97,152,26,116,240,48,32,55,144,59,216,117,49,68,237) -IMAGE_DATA(69,214,163,219,126,73,127,138,109,118,221,184,251,196,241,99,81,55,147,18,145,16,31,59,36,146,18,227,193,92,69,147) -IMAGE_DATA(146,156,4,85,113,33,202,74,31,160,180,68,61,40,184,246,64,93,12,230,118,207,147,128,123,185,119,144,159,151,131,188) -IMAGE_DATA(123,119,135,132,194,73,76,136,149,96,93,110,206,109,137,187,119,178,100,45,231,110,118,111,174,47,152,155,146,124,163,159) -IMAGE_DATA(142,185,229,223,151,160,166,186,178,87,91,165,173,144,96,142,130,228,155,137,136,137,137,194,93,170,223,161,121,114,72,171) -IMAGE_DATA(37,78,53,233,216,87,84,148,201,49,35,59,251,22,146,105,158,219,183,51,145,64,115,93,9,13,193,237,172,91,200,186) -IMAGE_DATA(149,142,204,140,52,233,53,229,101,208,106,202,123,193,251,24,29,25,142,107,87,163,36,34,195,195,16,18,28,136,172,204) -IMAGE_DATA(116,220,202,72,149,200,72,79,161,253,83,65,67,115,49,120,221,241,113,215,16,123,253,170,244,9,241,215,113,37,44,4) -IMAGE_DATA(1,254,62,146,159,158,150,44,53,15,212,69,180,231,106,9,101,204,215,81,246,34,233,70,60,66,47,95,130,175,207,5) -IMAGE_DATA(201,79,75,189,41,107,223,229,231,74,62,95,55,58,42,156,238,107,129,4,223,47,214,176,231,53,250,122,95,64,90,202) -IMAGE_DATA(77,164,210,253,140,143,189,38,251,101,207,125,176,143,137,142,68,84,196,21,36,196,93,199,205,27,9,72,166,115,117,57) -IMAGE_DATA(56,8,65,129,126,114,254,27,137,113,184,70,123,123,53,58,2,49,87,35,101,63,60,39,231,185,174,204,199,247,192,223) -IMAGE_DATA(207,91,158,153,75,65,254,50,238,187,22,142,121,221,169,41,73,253,16,17,30,218,239,140,6,5,248,201,126,7,67,88) -IMAGE_DATA(104,176,68,96,128,111,175,166,223,195,193,182,125,245,170,221,170,85,107,81,96,99,55,36,138,150,175,4,115,21,141,122) -IMAGE_DATA(131,43,30,165,101,161,165,224,1,90,238,171,6,7,213,30,103,231,66,189,126,147,212,22,187,172,67,181,111,40,106,130) -IMAGE_DATA(163,81,29,20,217,141,128,136,31,198,129,61,160,113,205,165,40,242,81,40,180,119,196,253,197,246,168,242,13,135,246,220) -IMAGE_DATA(37,9,205,41,63,226,69,160,210,43,16,149,103,131,160,61,31,44,33,199,204,241,14,69,241,58,87,20,44,94,74,186) -IMAGE_DATA(43,84,35,205,105,63,252,179,172,2,79,59,158,208,117,35,40,246,69,199,227,102,9,237,69,210,95,12,129,214,39,12) -IMAGE_DATA(42,151,141,200,176,93,36,227,74,47,127,104,253,195,208,249,164,29,79,159,118,161,139,252,147,135,15,229,152,81,246,173) -IMAGE_DATA(15,74,92,191,128,246,164,55,114,214,172,71,164,245,2,84,157,241,135,230,196,5,148,31,59,135,2,111,63,116,180,181) -IMAGE_DATA(161,171,179,179,23,41,251,191,66,142,153,13,212,239,47,67,137,217,82,36,46,176,131,143,165,21,170,191,62,13,205,145) -IMAGE_DATA(227,132,99,168,56,112,4,143,170,170,240,164,253,137,68,75,83,19,10,29,93,80,57,151,250,177,116,64,29,33,202,218) -IMAGE_DATA(22,199,44,44,80,67,92,205,222,131,208,236,59,132,250,10,13,234,27,26,241,176,177,9,53,85,213,104,160,113,67,77) -IMAGE_DATA(29,30,186,184,227,177,165,61,90,172,29,16,60,127,1,246,206,53,67,141,135,39,52,219,61,80,230,190,3,5,57,121) -IMAGE_DATA(208,16,63,110,215,94,196,252,217,9,101,229,21,40,33,148,185,108,65,179,229,50,180,146,238,252,60,75,236,254,192,12) -IMAGE_DATA(117,27,55,163,146,238,103,161,157,51,130,45,109,17,237,241,5,242,205,22,201,181,197,172,92,139,144,21,107,160,181,176) -IMAGE_DATA(67,179,245,199,221,58,75,75,28,90,100,131,50,187,21,208,216,173,196,189,247,29,144,253,174,3,114,222,179,167,61,112) -IMAGE_DATA(64,149,185,3,26,45,150,161,142,208,76,125,61,38,180,90,59,98,191,185,185,60,51,223,88,153,163,97,169,29,106,55) -IMAGE_DATA(216,162,106,179,45,234,182,218,162,209,205,22,205,238,182,104,219,102,131,118,5,159,45,66,216,18,203,126,103,244,75,107) -IMAGE_DATA(75,156,93,104,137,51,11,231,225,140,205,60,120,145,63,103,107,129,243,54,221,184,72,227,253,31,152,247,106,126,244,112) -IMAGE_DATA(156,116,119,11,200,122,221,20,201,244,42,26,10,233,19,38,128,185,138,38,123,140,17,106,3,194,241,40,229,54,30,37) -IMAGE_DATA(101,15,14,170,53,132,199,34,219,112,188,212,102,154,154,162,196,125,47,74,61,255,142,210,207,255,214,141,29,135,127,24) -IMAGE_DATA(123,244,128,199,187,142,144,63,130,84,67,67,164,208,252,37,238,7,160,90,191,75,162,104,229,103,196,59,140,98,23,15) -IMAGE_DATA(122,8,118,66,181,193,83,66,142,169,174,254,203,94,100,26,24,33,85,209,81,173,200,249,175,104,205,43,194,191,58,187) -IMAGE_DATA(228,245,139,156,183,163,235,81,147,132,122,243,110,168,183,236,129,218,109,63,178,245,199,35,148,116,165,116,13,213,90,15) -IMAGE_DATA(148,236,56,128,103,116,168,217,88,219,89,91,15,197,242,87,111,199,61,227,57,40,93,233,142,216,87,199,225,40,233,202) -IMAGE_DATA(214,127,14,149,179,27,138,86,184,34,157,14,159,162,85,44,104,254,98,196,17,47,151,144,71,184,64,216,78,40,95,238) -IMAGE_DATA(2,213,18,39,168,62,90,129,98,235,37,104,172,40,167,7,240,153,68,107,83,51,110,9,3,148,242,245,9,85,132,127) -IMAGE_DATA(16,28,9,26,235,143,160,178,88,0,149,149,13,170,213,244,102,172,111,68,61,245,164,169,168,68,45,141,107,181,213,168) -IMAGE_DATA(51,152,142,38,226,182,18,246,16,204,9,149,179,230,64,253,219,89,248,110,250,59,72,79,76,134,154,248,103,127,111,129) -IMAGE_DATA(111,168,118,191,88,141,60,66,129,225,52,180,80,220,70,216,66,48,227,185,141,127,141,146,241,147,144,73,227,47,9,95) -IMAGE_DATA(207,124,87,158,15,94,219,9,241,11,236,21,99,228,184,175,110,161,209,120,220,39,175,38,220,32,196,16,148,61,224,126) -IMAGE_DATA(26,122,122,98,77,83,143,206,138,192,103,198,137,124,45,65,251,26,113,39,19,111,26,241,223,32,238,155,2,29,51,4) -IMAGE_DATA(58,21,76,23,56,216,163,81,206,232,92,58,59,27,40,183,150,176,142,176,158,176,137,176,185,103,93,110,4,203,62,154) -IMAGE_DATA(31,61,28,63,71,27,49,98,196,171,228,244,6,164,245,122,242,58,53,134,134,134,51,12,12,12,94,239,163,213,227,152) -IMAGE_DATA(243,186,180,122,122,122,250,38,38,38,239,76,154,52,105,14,115,153,199,158,99,206,115,93,215,156,99,199,142,29,55,101) -IMAGE_DATA(202,148,153,204,165,57,126,195,158,99,206,15,215,35,113,94,35,238,31,166,78,157,106,198,158,227,225,52,74,63,147,39) -IMAGE_DATA(79,102,221,28,246,3,250,213,169,81,214,54,113,226,68,99,101,205,67,105,169,239,87,140,141,141,103,245,237,71,233,151) -IMAGE_DATA(243,92,31,76,71,251,167,103,100,100,52,97,224,30,112,204,121,174,191,64,159,47,199,254,31,30,14,178,9,132,209,3) -IMAGE_DATA(114,163,123,242,58,53,116,96,46,211,13,56,214,71,59,154,99,206,235,210,234,235,235,155,158,58,117,170,221,201,201,169) -IMAGE_DATA(169,71,59,129,61,199,156,231,186,174,9,157,157,157,47,4,4,4,128,185,166,166,166,49,236,57,230,252,112,13,18,199) -IMAGE_DATA(215,211,211,19,219,182,109,3,123,142,135,211,40,253,184,186,186,118,237,219,183,15,236,7,244,171,83,163,172,45,49,49) -IMAGE_DATA(241,123,101,205,67,105,233,16,155,208,245,235,250,246,163,244,203,121,174,235,152,111,156,159,159,95,238,192,61,224,152,243) -IMAGE_DATA(92,127,129,62,95,142,189,140,135,227,87,66,204,152,47,132,255,106,33,180,91,233,53,197,158,227,137,66,252,78,151,102) -IMAGE_DATA(150,16,110,244,138,107,191,234,232,136,210,163,71,81,127,241,162,244,241,159,126,138,131,244,249,245,158,16,7,6,106,230) -IMAGE_DATA(8,177,199,123,238,92,168,15,31,70,157,151,23,106,78,158,68,45,129,61,199,218,211,167,193,117,230,41,154,177,66,188) -IMAGE_DATA(73,175,209,103,172,121,214,69,255,55,180,180,160,146,230,209,30,58,36,61,199,156,231,58,243,152,207,58,158,63,132,190) -IMAGE_DATA(123,239,239,220,137,70,181,26,207,159,63,71,103,115,51,202,73,199,158,99,206,115,157,121,202,122,237,133,72,77,93,178) -IMAGE_DATA(4,249,155,54,33,156,80,93,88,40,185,10,56,230,60,215,153,199,124,214,45,23,34,55,99,225,66,20,125,242,9,50) -IMAGE_DATA(8,193,46,46,232,234,232,144,26,246,28,115,94,214,137,199,124,214,45,22,226,90,220,236,217,40,252,240,67,228,219,219) -IMAGE_DATA(163,141,254,39,98,77,91,107,107,183,167,152,243,92,103,30,243,89,55,83,136,45,94,38,38,200,179,178,66,123,125,189) -IMAGE_DATA(228,150,102,102,98,171,153,153,244,28,115,158,235,204,99,62,235,232,245,58,102,141,16,245,129,111,189,133,150,218,90,148) -IMAGE_DATA(164,167,227,192,219,111,227,28,129,61,199,156,231,58,243,152,175,220,139,169,66,252,201,85,136,174,125,244,137,254,213,180) -IMAGE_DATA(105,136,36,164,245,120,142,57,207,117,230,13,184,245,35,40,55,111,149,16,154,3,35,71,194,135,62,151,2,70,143,150) -IMAGE_DATA(158,99,62,111,92,103,222,96,103,141,94,69,35,223,16,194,246,143,66,28,167,11,127,203,158,99,206,247,35,26,136,81) -IMAGE_DATA(226,21,106,81,95,232,252,26,120,89,54,155,94,181,31,235,42,210,47,205,108,250,21,254,143,235,47,197,70,209,118,233) -IMAGE_DATA(247,108,215,79,104,179,251,96,80,227,141,85,240,191,91,214,0,27,69,127,63,35,115,254,169,23,48,156,253,27,38,255) -IMAGE_DATA(41,246,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) -IMAGE_END_DATA(2272, 10) +IMAGE_DATA(120,156,237,87,11,80,85,215,21,189,66,226,32,218,106,35,202,136,90,73,38,198,233,116,146,209,233,76,53,13,49,133) +IMAGE_DATA(10,19,52,160,68,177,1,35,50,81,252,163,22,162,149,40,81,195,40,106,99,109,52,126,34,254,248,35,8,242,19,229) +IMAGE_DATA(39,242,21,16,65,136,124,222,19,8,60,30,127,17,129,130,128,218,213,189,143,92,130,47,60,96,210,250,235,116,51,107) +IMAGE_DATA(246,217,123,175,117,207,217,231,158,203,189,79,210,147,244,164,255,130,97,144,26,180,240,160,145,211,228,246,119,93,12,80) +IMAGE_DATA(27,202,122,180,219,47,233,239,121,91,82,82,18,134,130,254,116,131,153,54,93,69,69,197,128,120,81,116,57,57,57,3) +IMAGE_DATA(226,101,215,253,156,251,254,204,236,255,15,199,139,251,112,248,251,251,15,122,232,152,243,50,235,134,2,77,221,51,179,23) +IMAGE_DATA(225,225,216,177,99,7,134,130,254,116,131,29,58,109,186,146,146,146,1,241,34,232,236,236,236,16,25,25,57,32,152,243) +IMAGE_DATA(50,235,134,2,77,221,51,179,190,15,199,6,231,117,59,143,28,62,20,117,53,41,17,9,241,177,3,34,41,49,30,204) +IMAGE_DATA(149,53,41,201,73,80,148,20,161,188,236,54,202,74,149,253,130,107,183,149,37,96,238,227,121,18,112,51,47,7,5,249) +IMAGE_DATA(185,200,191,121,99,64,200,156,196,132,88,1,214,229,229,94,23,184,145,147,37,106,185,55,178,123,115,125,193,220,148,228) +IMAGE_DATA(43,79,232,152,91,241,67,41,106,107,170,122,181,213,234,74,1,230,200,72,190,154,136,152,152,40,220,160,122,14,205,147) +IMAGE_DATA(75,90,53,113,106,72,199,190,178,178,92,140,25,217,217,215,144,76,243,92,191,158,137,4,154,235,66,104,8,174,103,93) +IMAGE_DATA(67,214,181,116,100,102,164,9,175,170,40,135,90,85,209,11,222,199,232,200,112,92,186,24,37,16,25,30,134,144,224,64) +IMAGE_DATA(100,101,166,227,90,70,170,64,70,122,10,237,159,2,42,154,139,193,235,142,143,187,132,216,203,23,133,79,136,191,140,11) +IMAGE_DATA(97,33,8,240,247,17,252,244,180,100,161,185,173,44,166,61,87,10,200,99,190,142,188,23,73,87,226,17,122,254,28,124) +IMAGE_DATA(125,206,8,126,90,234,85,81,251,190,32,79,240,249,186,209,81,225,116,95,11,5,248,126,177,134,61,175,209,215,251,12) +IMAGE_DATA(210,82,174,34,149,238,103,124,236,37,209,47,123,238,131,125,76,116,36,162,34,46,32,33,238,50,174,94,73,64,50,157) +IMAGE_DATA(171,243,193,65,8,10,244,19,243,95,73,140,195,37,218,219,139,209,17,136,185,24,41,250,225,57,57,207,117,121,62,190) +IMAGE_DATA(7,254,126,222,226,204,156,11,242,23,113,223,181,112,204,235,78,77,73,122,2,17,225,161,79,156,209,160,0,63,209,111) +IMAGE_DATA(127,8,11,13,22,8,12,240,237,213,252,228,205,177,101,197,242,157,138,229,171,80,104,101,51,32,138,151,44,3,115,101) +IMAGE_DATA(141,114,173,51,238,166,101,161,181,240,54,90,111,41,250,7,213,238,101,231,65,185,102,189,208,150,56,173,70,141,111,40) +IMAGE_DATA(106,131,163,81,19,20,249,24,1,17,63,142,3,123,64,227,218,115,81,228,163,80,100,107,143,91,11,108,81,237,27,14) +IMAGE_DATA(245,169,115,2,170,99,126,196,139,64,149,87,32,170,78,6,65,125,58,88,64,140,153,227,29,138,146,213,206,40,92,176) +IMAGE_DATA(136,116,23,168,70,154,227,126,248,103,121,37,30,116,222,167,235,70,80,236,139,206,123,45,2,234,179,164,63,27,2,181) +IMAGE_DATA(79,24,20,78,235,144,97,61,95,196,85,94,254,80,251,135,161,235,126,7,30,60,232,70,55,249,251,119,238,136,49,163) +IMAGE_DATA(252,59,31,148,58,127,9,245,81,111,228,174,92,131,72,203,185,168,62,225,15,213,145,51,168,56,116,10,133,222,126,232) +IMAGE_DATA(108,111,71,119,87,87,47,82,246,124,141,92,19,43,40,223,95,140,82,147,69,72,156,107,3,31,115,11,212,124,115,28) +IMAGE_DATA(170,3,135,9,135,80,233,121,0,119,171,171,113,191,227,190,64,107,115,51,138,236,157,80,53,155,250,49,183,67,61,33) +IMAGE_DATA(202,210,26,135,204,204,80,75,92,149,199,94,168,118,239,67,67,165,10,13,141,77,184,211,212,140,218,234,26,52,210,184) +IMAGE_DATA(177,182,30,119,156,92,113,207,220,22,173,150,118,8,254,112,46,60,102,155,160,214,205,29,170,45,110,40,119,221,138,194) +IMAGE_DATA(220,124,168,136,31,183,221,3,49,127,118,64,121,69,37,74,9,229,78,27,209,98,190,24,109,164,59,61,199,28,59,63) +IMAGE_DATA(48,65,253,186,13,168,162,251,89,100,227,136,96,115,107,68,187,125,137,2,147,249,98,109,49,203,86,33,100,233,74,168) +IMAGE_DATA(205,108,208,98,249,201,99,157,185,57,246,205,183,66,185,205,82,168,108,150,225,230,251,118,200,126,215,14,185,239,217,210) +IMAGE_DATA(30,216,161,218,212,14,77,102,139,81,79,104,161,190,238,17,218,44,237,177,199,212,84,156,153,111,45,76,209,184,200,6) +IMAGE_DATA(117,107,173,81,189,193,26,245,155,172,209,228,98,141,22,87,107,180,111,182,66,135,140,207,231,35,108,161,249,19,103,244) +IMAGE_DATA(43,75,115,156,156,103,142,19,243,230,224,132,213,28,120,145,63,101,109,134,211,86,143,113,150,198,123,62,48,237,213,252) +IMAGE_DATA(228,225,56,234,234,18,144,245,186,49,146,233,23,254,64,72,31,55,14,204,149,53,217,163,12,80,23,16,142,187,41,215) +IMAGE_DATA(113,55,41,187,127,80,173,49,60,22,217,250,99,133,54,211,216,24,165,174,30,40,115,255,59,202,190,248,219,99,108,221) +IMAGE_DATA(255,227,216,173,7,60,222,126,128,252,1,164,234,235,35,133,230,47,117,245,132,98,205,118,129,226,101,159,19,111,63,74) +IMAGE_DATA(156,220,232,33,216,6,197,90,119,1,49,166,186,242,47,30,200,212,51,64,170,172,163,90,177,227,95,209,150,95,140,127) +IMAGE_DATA(117,117,139,235,23,59,110,65,247,221,102,1,229,134,157,80,110,220,5,165,203,30,100,235,142,69,40,233,202,232,26,138) +IMAGE_DATA(85,110,40,221,234,137,135,116,168,217,88,219,85,215,208,251,251,166,96,197,22,220,52,156,133,178,101,174,136,125,117,12) +IMAGE_DATA(14,146,174,124,205,23,80,56,186,160,120,169,51,210,233,240,201,90,217,130,62,92,128,56,226,229,17,242,9,103,8,91) +IMAGE_DATA(8,21,75,156,160,88,232,0,197,199,75,81,98,185,16,77,149,21,244,0,62,20,104,107,110,193,53,73,15,101,124,125) +IMAGE_DATA(66,53,225,31,4,123,130,202,242,99,40,204,230,66,97,97,133,26,37,189,25,27,154,208,64,61,169,42,171,80,71,227) +IMAGE_DATA(58,117,13,234,245,166,162,153,184,109,132,93,4,83,66,213,140,89,80,254,118,6,190,159,250,14,210,19,147,161,36,254) +IMAGE_DATA(201,223,155,225,91,170,221,42,81,34,159,80,168,63,5,173,20,183,19,54,18,76,120,110,195,95,163,116,236,4,100,210) +IMAGE_DATA(248,43,194,55,211,223,21,231,131,215,118,68,250,5,60,164,81,98,220,87,55,207,96,44,110,145,87,18,174,16,98,8) +IMAGE_DATA(242,30,112,63,141,61,61,177,166,185,71,103,65,224,51,227,64,190,142,160,126,141,184,19,137,55,133,248,111,16,247,77) +IMAGE_DATA(9,157,211,36,116,201,152,42,97,111,143,70,62,163,179,233,236,172,165,220,42,194,106,194,26,194,122,194,134,158,117,185) +IMAGE_DATA(16,204,251,104,94,136,223,28,255,169,13,27,54,236,85,114,58,26,105,157,158,188,86,141,190,190,254,52,61,61,189,215) +IMAGE_DATA(251,104,117,56,230,188,54,173,142,142,142,174,145,145,209,59,19,38,76,152,197,92,230,177,231,152,243,92,215,54,231,232) +IMAGE_DATA(209,163,199,76,154,52,105,58,115,105,142,223,176,231,152,243,131,245,72,156,215,136,251,135,201,147,39,155,176,231,120,48) +IMAGE_DATA(141,220,207,196,137,19,89,55,139,189,70,191,90,53,242,218,198,143,31,111,40,175,121,32,45,245,253,138,161,161,225,140) +IMAGE_DATA(190,253,200,253,114,158,235,253,233,104,255,116,12,12,12,198,105,238,1,199,156,231,250,16,250,124,58,246,191,240,112,144) +IMAGE_DATA(141,35,140,212,200,141,236,201,107,213,208,129,57,79,55,224,80,31,237,72,142,57,175,77,171,171,171,107,124,236,216,177) +IMAGE_DATA(14,7,7,135,230,30,237,56,246,28,115,158,235,218,38,116,116,116,60,19,16,16,0,230,26,27,27,199,176,231,152,243) +IMAGE_DATA(131,53,72,28,95,119,119,119,108,222,188,25,236,57,30,76,35,247,227,236,236,220,189,123,247,110,176,215,232,87,171,70) +IMAGE_DATA(94,91,98,98,226,15,242,154,7,210,210,33,54,162,235,215,247,237,71,238,151,243,92,215,50,223,24,63,63,191,60,205) +IMAGE_DATA(61,224,152,243,92,31,66,159,79,199,158,198,195,241,43,73,154,246,161,36,249,175,144,36,245,38,122,77,177,231,120,188) +IMAGE_DATA(36,253,78,155,102,134,36,185,208,43,174,227,162,189,61,202,14,30,68,195,217,179,194,199,127,246,25,246,210,231,215,123) +IMAGE_DATA(146,228,169,169,153,37,73,187,188,103,207,134,114,255,126,212,123,121,161,246,232,81,212,17,216,115,172,62,126,28,92,103) +IMAGE_DATA(158,172,25,45,73,111,210,107,244,33,107,30,118,211,239,134,214,86,84,209,60,234,125,251,132,231,152,243,92,103,30,243) +IMAGE_DATA(89,199,243,135,208,119,239,173,109,219,208,164,84,226,209,163,71,232,106,105,65,5,233,216,115,204,121,174,51,79,94,175) +IMAGE_DATA(173,36,165,166,46,92,136,130,245,235,17,78,168,41,42,18,92,25,28,115,158,235,204,99,62,235,150,72,82,94,198,188) +IMAGE_DATA(121,40,254,244,83,100,16,130,157,156,208,221,217,41,52,236,57,230,188,168,19,143,249,172,91,32,73,151,226,102,206,68) +IMAGE_DATA(209,71,31,161,192,214,22,237,244,155,136,53,237,109,109,143,61,197,156,231,58,243,152,207,186,233,146,180,209,203,200,8) +IMAGE_DATA(249,22,22,232,104,104,16,220,178,204,76,108,50,49,17,158,99,206,115,157,121,204,103,29,189,94,71,173,148,164,134,192) +IMAGE_DATA(183,222,66,107,93,29,74,211,211,225,249,246,219,56,69,96,207,49,231,185,206,60,230,203,247,98,178,36,253,201,89,146) +IMAGE_DATA(186,119,211,39,250,215,83,166,32,146,144,214,227,57,230,60,215,153,167,113,235,135,81,110,206,114,73,82,121,14,31,14) +IMAGE_DATA(31,250,92,10,24,57,82,120,142,249,188,113,157,121,253,157,53,122,21,13,127,67,146,172,255,40,73,135,233,194,223,177) +IMAGE_DATA(231,152,243,79,16,245,164,17,210,43,212,162,174,164,245,107,224,105,217,76,122,213,126,162,173,72,255,105,102,210,127,225) +IMAGE_DATA(159,93,127,42,54,130,182,75,183,103,187,158,163,205,236,131,126,141,55,86,198,179,91,150,134,141,160,191,151,200,28,159) +IMAGE_DATA(247,2,6,179,127,3,185,138,249,215,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) +IMAGE_END_DATA(2368, 13) diff --git a/uppsrc/ide/EditorTabBar.cpp b/uppsrc/ide/EditorTabBar.cpp index b4256a1e9..b8ef96008 100644 --- a/uppsrc/ide/EditorTabBar.cpp +++ b/uppsrc/ide/EditorTabBar.cpp @@ -37,3 +37,23 @@ void EditorTabBar::RenameFile(const String& fn, const String& nn) { FileTabs::RenameFile(WString(fn), WString(nn)); } + +void EditorTabBar::SetSplitColor(const String& fn, const Color& c) +{ + for(int i = 0; i < tabs.GetCount(); i++) + { + Tab& t = tabs[i]; + t.col = t.key == fn ? c : Null; + } + Refresh(); +} + +void EditorTabBar::ClearSplitColor() +{ + for(int i = 0; i < tabs.GetCount(); i++) + { + Tab& t = tabs[i]; + t.col = Null; + } + Refresh(); +} diff --git a/uppsrc/ide/QuickTabs.cpp b/uppsrc/ide/QuickTabs.cpp index 613fc4476..3e6d1ffde 100644 --- a/uppsrc/ide/QuickTabs.cpp +++ b/uppsrc/ide/QuickTabs.cpp @@ -7,22 +7,11 @@ void Ide::TabFile() EditFile(tabs.GetFile(q)); } -void Ide::TabFile2() -{ - int q = tabs2.GetCursor(); - if(q >= 0) { - String fn = tabs2.GetFile(q); - SwapEditors(); - EditFile(fn); - } -} - void Ide::ClearTab() { int c = tabs.GetCursor(); if(c >= 0) tabs.Close(c); - tabs2.Set(tabs); } void Ide::ClearTabs() diff --git a/uppsrc/ide/Setup.cpp b/uppsrc/ide/Setup.cpp index 8ef732f3c..9229b4393 100644 --- a/uppsrc/ide/Setup.cpp +++ b/uppsrc/ide/Setup.cpp @@ -111,17 +111,10 @@ Font FontSelectManager::Get() { return f; } -void Ide::UpdateFormat(CodeEditor& editor, EditorTabBar& tabs) +void Ide::UpdateFormat(CodeEditor& editor) { if(!IsActiveFile() || ActiveFile().tabsize <= 0) editor.TabSize(editortabsize); - if(!designer) - if(filetabs >=0) { - tabs.SetAlign(filetabs); - editor.SetFrame(tabs); - } else { - editor.SetFrame(ViewFrame()); - } editor.IndentSpaces(indent_spaces); editor.IndentAmount(indent_amount); editor.ShowTabs(show_tabs); @@ -136,22 +129,32 @@ void Ide::UpdateFormat(CodeEditor& editor, EditorTabBar& tabs) editor.MarkLines(mark_lines); editor.BorderColumn(bordercolumn, bordercolor); editor.Refresh(); - tabs.Grouping(tabs_grouping); - tabs.Stacking(tabs_stacking); - tabs.FileIcons(tabs_icons, false); - tabs.Crosses(tabs_crosses >= 0, tabs_crosses); } void Ide::UpdateFormat() { - SetupEditor(); - UpdateFormat(editor, tabs); - UpdateFormat(editor2, tabs2); + SetupEditor(); + UpdateFormat(editor); + UpdateFormat(editor2); console.SetFont(consolefont); console.WrapText(wrap_console_text); console2.SetFont(consolefont); console2.WrapText(wrap_console_text); statusbar.Show(show_status_bar); SetupBars(); + + if(!designer) { + if(filetabs >=0) { + tabs.SetAlign(filetabs); + editpane.SetFrame(tabs); + } else { + editpane.SetFrame(ViewFrame()); + } + } + + tabs.Grouping(tabs_grouping); + tabs.Stacking(tabs_stacking); + tabs.FileIcons(tabs_icons, false); + tabs.Crosses(tabs_crosses >= 0, tabs_crosses); } void Ide::EditorFontScroll(int d) diff --git a/uppsrc/ide/ide.cpp b/uppsrc/ide/ide.cpp index 3ac5f01a3..c94e46153 100644 --- a/uppsrc/ide/ide.cpp +++ b/uppsrc/ide/ide.cpp @@ -666,7 +666,7 @@ void Ide::Display() { void Ide::SerializeWorkspace(Stream& s) { int i; - int version = 9; + int version = 10; s / version; s.Magic(0x12354); if(s.IsStoring()) { @@ -743,10 +743,9 @@ void Ide::SerializeWorkspace(Stream& s) { SerializeWorkspaceConfigs(s); SerializeOutputMode(s); SerializeClosed(s); - if(version >= 9) { + if(version >= 10) { if(tabs_serialize) { s % tabs; - s % tabs2; } } } diff --git a/uppsrc/ide/ide.h b/uppsrc/ide/ide.h index 690d98c46..293a21dc9 100644 --- a/uppsrc/ide/ide.h +++ b/uppsrc/ide/ide.h @@ -271,9 +271,11 @@ class EditorTabBar : public FileTabs public: EditorTabBar(); String GetFile(int n) const; - bool FindSetFile(const String& fn); - void SetAddFile(const String& fn); - void RenameFile(const String& fn, const String& nn); + bool FindSetFile(const String& fn); + void SetAddFile(const String& fn); + void RenameFile(const String& fn, const String& nn); + void SetSplitColor(const String& fn, const Color& c); + void ClearSplitColor(); typedef EditorTabBar CLASSNAME; }; @@ -523,7 +525,7 @@ public: One designer; AssistEditor editor; CodeEditor editor2; - EditorTabBar tabs, tabs2; + EditorTabBar tabs; EscValue macro_api; RightTabs btabs; @@ -978,7 +980,6 @@ public: void KeySplit(bool horz); void SwapEditors(); void TabFile(); - void TabFile2(); void ClearTab(); void ClearTabs(); void CloseRest(EditorTabBar *tabs); @@ -991,7 +992,7 @@ public: void SetBar(); - void UpdateFormat(CodeEditor& editor, EditorTabBar& tabs); + void UpdateFormat(CodeEditor& editor); void UpdateFormat(); void ReadHlStyles(ArrayCtrl& hlstyle); diff --git a/uppsrc/ide/idefile.cpp b/uppsrc/ide/idefile.cpp index 9fcd734b1..4d5666768 100644 --- a/uppsrc/ide/idefile.cpp +++ b/uppsrc/ide/idefile.cpp @@ -413,7 +413,6 @@ void Ide::EditFile0(const String& path, byte charset, bool astext, const String& editpane.Add(designer->DesignerCtrl().SizePos()); designer->SetFocus(); if(filetabs) { - designer->DesignerCtrl().SetFrame(tabs); tabs.SetAddFile(editfile); } @@ -423,11 +422,6 @@ void Ide::EditFile0(const String& path, byte charset, bool astext, const String& } } - if(filetabs >= 0) - editor.SetFrame(tabs); - else - editor.SetFrame(ViewFrame()); -// editor.SetFrame(filetabs >= 0 ? tabs :ViewFrame()); // TRC 2011/01/08 - fails to compile under MSC71 tabs.SetAddFile(editfile); editor.Enable(); editpane.Add(editorsplit); @@ -696,13 +690,10 @@ void Ide::PassEditor() editor2.Set(editor.Get(charset), charset); editor2.SetEditPosSb(editor.GetEditPos()); editor2.CheckEdited(); - EditorTabBar h; - h.Set(tabs); - tabs.Set(tabs2); - tabs2.Set(h); editor.SetFocus(); editor.ScrollIntoCursor(); -} + tabs.SetSplitColor(editfile, Yellow); +;} void Ide::ClearEditedFile() { @@ -729,13 +720,13 @@ void Ide::SplitEditor(bool horz) { if(editorsplit.GetZoom() < 0) CloseSplit(); - else - tabs2.Set(tabs); + if(horz) editorsplit.Horz(editor2, editor); else editorsplit.Vert(editor2, editor); PassEditor(); + } void Ide::SwapEditors() @@ -761,6 +752,7 @@ void Ide::CloseSplit() { editorsplit.Vert(editor, editor2); editorsplit.Zoom(0); + tabs.ClearSplitColor(); SyncEditorSplit(); editor.SetFocus(); SetupEditor(); diff --git a/uppsrc/ide/idewin.cpp b/uppsrc/ide/idewin.cpp index ebf6c3f54..629106995 100644 --- a/uppsrc/ide/idewin.cpp +++ b/uppsrc/ide/idewin.cpp @@ -505,9 +505,7 @@ Ide::Ide() editor.topsbbutton1.ScrollStyle().NoWantFocus().Show(); tabs <<= THISBACK(TabFile); // tabs.WhenCloseRest = THISBACK1(CloseRest, &tabs); - editor2.SetFrame(tabs2); - tabs2 <<= THISBACK(TabFile2); -// tabs2.WhenCloseRest = THISBACK1(CloseRest, &tabs2); + editor2.SetFrame(NullFrame()); editor2.topsbbutton.ScrollStyle().NoWantFocus().Show(); editor2.topsbbutton1.ScrollStyle().NoWantFocus().Show(); editor2.WhenLeftDown = THISBACK(SwapEditors);