From 6e18a4c048cb4ddb8a5bba64b2bd6a3c66bd30fe Mon Sep 17 00:00:00 2001 From: mdelfede Date: Tue, 1 Jul 2008 20:28:44 +0000 Subject: [PATCH] new uvs2 releases : uppsrc-2612 tutorial-38 examples-142 reference-114 - fixed X11DHCtrl git-svn-id: svn://ultimatepp.org/upp/trunk@305 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/Common/TreeTypes.txt | 2 - uppsrc/Common/clanek.style | 1 + uppsrc/Core/Util.cpp | 4 +- uppsrc/Core/Util.h | 2 +- uppsrc/CtrlCore/X11DHCtrl.cpp | 1 + uppsrc/CtrlLib/DateTimeCtrl.cpp | 2 +- uppsrc/CtrlLib/MultiButton.cpp | 5 ++ uppsrc/CtrlLib/MultiButton.h | 1 + uppsrc/DropGrid/DropGrid.cpp | 64 ++++++++++++++++- uppsrc/DropGrid/DropGrid.h | 14 +++- uppsrc/DropGrid/DropGrid.usc | 1 + uppsrc/DropGrid/main.cpp | 42 +++++------ uppsrc/GridCtrl/GridBase.cpp | 4 +- uppsrc/GridCtrl/GridCtrl.cpp | 30 +++++--- uppsrc/GridCtrl/GridCtrl.h | 9 ++- uppsrc/GridCtrl/GridCtrl.iml | 123 +++++++++++++++++++------------- uppsrc/GridCtrl/GridSort.cpp | 23 +++++- uppsrc/Sql/SqlVal.cpp | 4 +- uppsrc/Sql/Sqlexp.h | 4 +- 19 files changed, 236 insertions(+), 100 deletions(-) create mode 100644 uppsrc/Common/clanek.style diff --git a/uppsrc/Common/TreeTypes.txt b/uppsrc/Common/TreeTypes.txt index 622490f47..e69de29bb 100644 --- a/uppsrc/Common/TreeTypes.txt +++ b/uppsrc/Common/TreeTypes.txt @@ -1,2 +0,0 @@ -sockaddr_in -0 0 -1 diff --git a/uppsrc/Common/clanek.style b/uppsrc/Common/clanek.style new file mode 100644 index 000000000..d4e8d1f3a --- /dev/null +++ b/uppsrc/Common/clanek.style @@ -0,0 +1 @@ +[2 $$0,0#00000000000000000000000000000000:Default][l288;i1120;a17;O9;~~~.1408;2 $$1,0#10431211400427159095818037425705:param][a83;*R6 $$2,5#31310162474203024125188417583966:caption][b83;*4 $$3,5#07864147445237544204411237157677:title][i288;O9;C2 $$4,6#40027414424643823182269349404212:item][b42;a42;2 $$5,5#45413000475342174754091244180557:text][l288;b17;a17;2 $$6,6#27521748481378242620020725143825:desc][l321;t246;C@5;1 $$7,7#20902679421464641399138805415013:code][b2503;2 $$8,0#65142375456100023862071332075487:separator][*@(0.0.255)2 $$9,0#83433469410354161042741608181528:base][t4167;C2 $$10,0#37138531426314131251341829483380:class][l288;a17;*1 $$11,11#70004532496200323422659154056402:requirement][i417;b42;a42;O9;~~~.416;2 $$12,12#10566046415157235020018451313112:tparam][b167;C2 $$13,13#92430459443460461911108080531343:item1][i288;a42;O9;C2 $$14,14#77422149456609303542238260500223:item2][*@2$(0.128.128)2 $$15,15#34511555403152284025741354420178:NewsDate][l321;*C$7;2 $$16,16#03451589433145915344929335295360:result][l321;b83;a83;*C$7;2 $$17,17#07531550463529505371228428965313:result`-line][l160;t4167;*C+117 $$18,5#88603949442205825958800053222425:package`-title][2 $$19,0#53580023442335529039900623488521:gap][t4167;C2 $$20,20#70211524482531209251820423858195:class`-nested][b50;2 $$21,21#03324558446220344731010354752573:Par][b117;*+117 $$22,21#27457433418004101424360058862402:Caption][i128;*C@(28.42.150)2 $$23,23#90519220486603166734501227306500:code] \ No newline at end of file diff --git a/uppsrc/Core/Util.cpp b/uppsrc/Core/Util.cpp index 07a35c77d..90d28f565 100644 --- a/uppsrc/Core/Util.cpp +++ b/uppsrc/Core/Util.cpp @@ -114,12 +114,12 @@ void AssertFailed(const char *file, int line, const char *cond) } #ifdef PLATFORM_POSIX -int GetTickCount() { +dword GetTickCount() { struct timeval tv[1]; struct timezone tz[1]; memset(tz, 0, sizeof(tz)); gettimeofday(tv, tz); - return tv->tv_sec % 1000000 * 1000 + tv->tv_usec / 1000; + return (dword)tv->tv_sec * 1000 + tv->tv_usec / 1000; } #endif diff --git a/uppsrc/Core/Util.h b/uppsrc/Core/Util.h index 4b7510331..0eb3186ba 100644 --- a/uppsrc/Core/Util.h +++ b/uppsrc/Core/Util.h @@ -6,7 +6,7 @@ static const int _MAX_PATH = MAX_PATH; #ifdef PLATFORM_POSIX static const int _MAX_PATH = PATH_MAX; -int GetTickCount(); +dword GetTickCount(); #endif class TimeStop : Moveable { diff --git a/uppsrc/CtrlCore/X11DHCtrl.cpp b/uppsrc/CtrlCore/X11DHCtrl.cpp index 5c45b01b2..39742cd70 100644 --- a/uppsrc/CtrlCore/X11DHCtrl.cpp +++ b/uppsrc/CtrlCore/X11DHCtrl.cpp @@ -331,6 +331,7 @@ void DHCtrl::State(int reason) break; case OPEN : // = 16, + MapWindow(IsShown()); break; case CLOSE : // = 17, diff --git a/uppsrc/CtrlLib/DateTimeCtrl.cpp b/uppsrc/CtrlLib/DateTimeCtrl.cpp index 8202a6c06..ac95cbdd5 100644 --- a/uppsrc/CtrlLib/DateTimeCtrl.cpp +++ b/uppsrc/CtrlLib/DateTimeCtrl.cpp @@ -401,7 +401,7 @@ Size Calendar::ComputeSize() colw = (float)(tsz.cx + 6); rowh = (float)(tsz.cy + 4); - hs = spin_all.GetHeight() + 4; + hs = /*spin_all.GetHeight()*/tsz.cy + 4; rsz.cx = bs * 2 + 2 + (int)(colw * (cols + 1)); rsz.cy = (int)(rowh * (rows + 2) + hs); diff --git a/uppsrc/CtrlLib/MultiButton.cpp b/uppsrc/CtrlLib/MultiButton.cpp index 3d0fd94c8..1b56e9d30 100644 --- a/uppsrc/CtrlLib/MultiButton.cpp +++ b/uppsrc/CtrlLib/MultiButton.cpp @@ -112,6 +112,11 @@ MultiButton::SubButton& MultiButton::InsertButton(int i) return b; } +void MultiButton::RemoveButton(int i) +{ + button.Remove(i); +} + MultiButton::SubButton& MultiButton::SubButton::Main(bool b) { if(b) diff --git a/uppsrc/CtrlLib/MultiButton.h b/uppsrc/CtrlLib/MultiButton.h index bddb4a63e..525f66d88 100644 --- a/uppsrc/CtrlLib/MultiButton.h +++ b/uppsrc/CtrlLib/MultiButton.h @@ -128,6 +128,7 @@ public: SubButton& AddButton(); SubButton& InsertButton(int i); + void RemoveButton(int i); int GetButtonCount() const { return button.GetCount(); } SubButton& GetButton(int i) { return button[i]; } SubButton& MainButton(); diff --git a/uppsrc/DropGrid/DropGrid.cpp b/uppsrc/DropGrid/DropGrid.cpp index a91a3cf6d..eeedc57e5 100644 --- a/uppsrc/DropGrid/DropGrid.cpp +++ b/uppsrc/DropGrid/DropGrid.cpp @@ -82,7 +82,12 @@ DropGrid::DropGrid() null_action = true; display = this; change = false; + nodrop = false; + clear_button = false; + EnableDrop(always_drop); + clear.SetButton(1); + clear <<= THISBACK(DoClearValue); } void DropGrid::Close() @@ -178,6 +183,15 @@ void DropGrid::Drop() void DropGrid::Paint(Draw& w) { Size sz = GetSize(); + Size isz = clear.GetStdSize(); + if(clear_button && !notnull && IsEnabled() && IsSelected()) + { + clear.Show(); + clear.RightPos(3, isz.cx).TopPos((sz.cy - isz.cy) / 2, isz.cy); + } + else + clear.Hide(); + w.DrawRect(sz, SColorPaper()); GridDisplay &disp = display ? *display : list.GetDisplay(); bool hf = HasFocus(); @@ -203,7 +217,11 @@ void DropGrid::Paint(Draw& w) void DropGrid::LeftDown(Point p, dword keyflags) { - Drop(); + WhenLeftDown(); + if(nodrop) + SetFocus(); + else + Drop(); } void DropGrid::GotFocus() @@ -318,6 +336,7 @@ DropGrid& DropGrid::AddValueColumns(int first /* = -1*/, int last /* = -1*/) { int s = first < 0 ? 0: first; int e = last < 0 ? list.GetColumnCount() - 1: last; + for(int i = s; i <= e; i++) value_cols.Add(i); @@ -421,6 +440,25 @@ DropGrid& DropGrid::NullAction(bool b /* = true*/) return *this; } +DropGrid& DropGrid::ClearButton(bool b /* = true*/) +{ + clear_button = b; + if(b) + Ctrl::Add(clear); + else + Ctrl::RemoveChild(&clear); + + return *this; +} + +DropGrid& DropGrid::NoDrop(bool b /* = true*/) +{ + nodrop = b; + if(nodrop) + drop.RemoveButton(0); + return *this; +} + int DropGrid::GetCount() const { return list.GetCount(); @@ -523,6 +561,7 @@ GridCtrl::ItemRect& DropGrid::AddIndex(Id id) MultiButton::SubButton& DropGrid::AddButton(int type, const Callback &cb) { MultiButton::SubButton& btn = drop.InsertButton(1); + switch(type) { case BTN_PLUS: @@ -543,6 +582,9 @@ MultiButton::SubButton& DropGrid::AddButton(int type, const Callback &cb) case BTN_DOWN: btn.SetImage(GridImg::SelDn); break; + case BTN_CLEAN: + btn.SetImage(GridImg::SelCross); + break; } btn.WhenPush = cb; return btn; @@ -563,11 +605,30 @@ MultiButton::SubButton& DropGrid::AddEdit(const Callback &cb) return AddButton(BTN_RIGHT, cb); } +MultiButton::SubButton& DropGrid::AddClear() +{ + return AddButton(BTN_CLEAN, THISBACK(ClearValue)); +} + +MultiButton::SubButton& DropGrid::AddText(const char* label, const Callback& cb) +{ + MultiButton::SubButton& btn = drop.InsertButton(1); + btn.SetLabel(label); + btn.WhenPush = cb; + return btn; +} + MultiButton::SubButton& DropGrid::GetButton(int n) { return drop.GetButton(n); } +void DropGrid::DoClearValue() +{ + ClearValue(); + SetFocus(); +} + void DropGrid::ClearValue() { change = false; @@ -578,6 +639,7 @@ void DropGrid::ClearValue() UpdateActionRefresh(); else UpdateRefresh(); + SetFocus(); } void DropGrid::Reset() diff --git a/uppsrc/DropGrid/DropGrid.h b/uppsrc/DropGrid/DropGrid.h index 0cc4cbd60..afc4f5722 100644 --- a/uppsrc/DropGrid/DropGrid.h +++ b/uppsrc/DropGrid/DropGrid.h @@ -16,7 +16,8 @@ class DropGrid : public Convert, public GridDisplay, public Ctrl BTN_RIGHT, BTN_UP, BTN_DOWN, - BTN_PLUS + BTN_PLUS, + BTN_CLEAN }; private: class PopUpGrid : public GridCtrl @@ -48,8 +49,10 @@ class DropGrid : public Convert, public GridDisplay, public Ctrl Vector value_cols; PopUpGrid list; MultiButtonFrame drop; + GridButton clear; private: + int rowid; int trowid; Value value; @@ -70,6 +73,8 @@ class DropGrid : public Convert, public GridDisplay, public Ctrl bool always_drop:1; bool must_change:1; bool null_action:1; + bool clear_button:1; + bool nodrop:1; GridDisplay *display; @@ -115,6 +120,8 @@ class DropGrid : public Convert, public GridDisplay, public Ctrl DropGrid& AlwaysDrop(bool b = true); DropGrid& MustChange(bool b = true); DropGrid& NullAction(bool b = true); + DropGrid& ClearButton(bool b = true); + DropGrid& NoDrop(bool b = true); GridCtrl::ItemRect& AddColumn(const char *name, int width = GridCtrl::GD_COL_WIDTH, bool idx = false); GridCtrl::ItemRect& AddColumn(Id id, const char *name, int width = GridCtrl::GD_COL_WIDTH, bool idx = false); @@ -125,6 +132,8 @@ class DropGrid : public Convert, public GridDisplay, public Ctrl MultiButton::SubButton& AddSelect(const Callback &cb); MultiButton::SubButton& AddPlus(const Callback &cb); MultiButton::SubButton& AddEdit(const Callback &cb); + MultiButton::SubButton& AddClear(); + MultiButton::SubButton& AddText(const char* label, const Callback& cb); MultiButton::SubButton& GetButton(int n); @@ -140,6 +149,7 @@ class DropGrid : public Convert, public GridDisplay, public Ctrl void Reset(); void Clear(); void ClearValue(); + void DoClearValue(); virtual Value GetData() const; virtual void SetData(const Value& v); @@ -195,6 +205,8 @@ class DropGrid : public Convert, public GridDisplay, public Ctrl virtual Value Format(const Value& q) const; + Callback WhenLeftDown; + GridCtrl::ItemRect& AddRow(int n = 1, int size = GridCtrl::GD_ROW_HEIGHT); DropGrid& Add() { AddRow(); return *this; } diff --git a/uppsrc/DropGrid/DropGrid.usc b/uppsrc/DropGrid/DropGrid.usc index fdb5d7b4e..90dec06c2 100644 --- a/uppsrc/DropGrid/DropGrid.usc +++ b/uppsrc/DropGrid/DropGrid.usc @@ -15,6 +15,7 @@ ctrl DropGrid { bool DropEnter = false; bool Searching = true; bool NotNull = false; + bool ClearButton = false; bool SetEditable = true @2 ? "Editable"; Text Tip; diff --git a/uppsrc/DropGrid/main.cpp b/uppsrc/DropGrid/main.cpp index 6052be799..9d8eac0e1 100644 --- a/uppsrc/DropGrid/main.cpp +++ b/uppsrc/DropGrid/main.cpp @@ -6,51 +6,43 @@ using namespace Upp; struct App : public TopWindow { - DropGrid drop, dg; - DropList classic_drop, dl; - GridCtrl grid; - ArrayCtrl array; + DropGrid drop; App() { - //CtrlLayout(*this, "DropGrid"); Sizeable().Zoomable(); + SetRect(Size(600, 100)); Title("DropGrid"); - dl.Add("Item 0").Add("Item 1").Add("Item 2"); - dg.Add("Item 0").Add("Item 1").Add("Item 2"); + drop.ClearButton(); + drop.AddPlus(THISBACK(Action)); - //Add(drop.LeftPos(20, 150).TopPos(20, 19)); - Add(grid.LeftPos(20, 300).TopPos(100, 150)); - Add(array.LeftPos(350, 300).TopPos(100, 150)); - -// array.AddColumn("Col 0").Edit(dg); -// array.AddColumn("Col 1").Edit(dl); - //array.AddColumn("Col 2").Option(); - array.Appending(); - grid.Searching(); - -// grid.AddColumn("Col 0").Edit(dg); -// grid.AddColumn("Col 1").Edit(dl); -// grid.AddColumn("Col 2").Option(); - grid.Appending(); + Add(drop.LeftPosZ(20, 350).TopPosZ(20, 19)); drop.AddColumn("ID"); drop.AddColumn("Value"); drop.AddColumn("Description"); + + drop.AddText("Add person", THISBACK(Action)); + drop.AddText("Add client", THISBACK(Action)).Left().SetImage(GridImg::Append()); + drop.AddSelect(THISBACK(Action)).Left(); + for(int i = 0; i < 20; i++) - drop.Add(i, Format("Hello %d", i), "How are you now?"); + drop.Add(i, Format("Hello %d", i), Format("How are you mr Hello %d", i)); drop.Width(300); drop.DisplayAll(0);/*NoHeader(0)*///NotNull(); drop.ColorRows(); - //drop.NotNull(); drop.SetDropLines(15); drop.SetValueColumn(1); drop.AddValueColumn(0).AddValueColumn(1); - Add(classic_drop.LeftPos(20, 150).TopPos(60, 19)); - classic_drop.Add("ALA").Add("ELA").Add("BABA"); } + + void Action() + { + } + + typedef App CLASSNAME; }; #ifdef flagMAIN diff --git a/uppsrc/GridCtrl/GridBase.cpp b/uppsrc/GridCtrl/GridBase.cpp index 33854e35e..08463566f 100644 --- a/uppsrc/GridCtrl/GridBase.cpp +++ b/uppsrc/GridCtrl/GridBase.cpp @@ -104,12 +104,14 @@ GridCtrl::ItemRect& GridCtrl::ItemRect::Max(int n) GridCtrl::ItemRect& GridCtrl::ItemRect::Fixed(int n) { + n = Ctrl::VertLayoutZoom(n); return Min(n).Max(n); } GridCtrl::ItemRect& GridCtrl::ItemRect::FixedAuto() { - return Fixed(GetTextSize((String)(*items)[0][id].val, StdFont()).cx + 15); + int n = GetTextSize((String)(*items)[0][id].val, StdFont()).cx + 15; + return Min(n).Max(n); } GridCtrl::ItemRect& GridCtrl::ItemRect::Edit(Ctrl &ctrl) diff --git a/uppsrc/GridCtrl/GridCtrl.cpp b/uppsrc/GridCtrl/GridCtrl.cpp index 62ec999ba..e55d55146 100644 --- a/uppsrc/GridCtrl/GridCtrl.cpp +++ b/uppsrc/GridCtrl/GridCtrl.cpp @@ -6748,8 +6748,9 @@ int GridCtrl::ShowMatchedRows(const WString &f) found_first_matched_row: bool change = false; + int rows = 0; - for(int i = first_matched_row; i < total_rows; i++) + for(int i = fixed_rows; i < total_rows; i++) { bool match = false; int idv = vitems[i].id; @@ -7289,49 +7290,60 @@ void GridPopUpHeader::Close() /*----------------------------------------------------------------------------------------*/ GridButton::GridButton() { - img = GridImg::CloseN; + n = 0; + img = 0; } void GridButton::Paint(Draw& w) { + static Image (*vimg[])() = { + &GridImg::Btn0N, &GridImg::Btn0H, &GridImg::Btn0P, + &GridImg::Btn1N, &GridImg::Btn1H, &GridImg::Btn1P + }; + Size sz = GetSize(); - w.DrawImage(0, 0, sz.cx, sz.cy, img); + w.DrawImage(0, 0, sz.cx, sz.cy, vimg[img + n * 3]); } void GridButton::LeftDown(Point p, dword flags) { - img = GridImg::CloseP; + img = 2; Refresh(); } void GridButton::LeftUp(Point p, dword flags) { - img = GridImg::CloseH; + img = 1; Refresh(); WhenAction(); } void GridButton::MouseEnter(Point p, dword flags) { - img = flags & K_MOUSELEFT ? GridImg::CloseP : GridImg::CloseH; + img = flags & K_MOUSELEFT ? 2 : 1; Refresh(); } void GridButton::MouseLeave() { - img = GridImg::CloseN; + img = 0; Refresh(); } void GridButton::State(int reason) { if(reason == CLOSE) - img = GridImg::CloseN; + img = 0; } Size GridButton::GetStdSize() const { - return img.GetSize(); + return n > 0 ? Size(14, 11) : Size(17, 17); //FIXME +} + +void GridButton::SetButton(int b) +{ + n = b; } GridResizePanel::GridResizePanel() diff --git a/uppsrc/GridCtrl/GridCtrl.h b/uppsrc/GridCtrl/GridCtrl.h index c9527027d..8f4a5446b 100644 --- a/uppsrc/GridCtrl/GridCtrl.h +++ b/uppsrc/GridCtrl/GridCtrl.h @@ -67,7 +67,9 @@ class GridPopUpHeader : public Ctrl class GridButton : public Ctrl { private: - Image img; + int img; + int n; + public: typedef GridButton CLASSNAME; GridButton(); @@ -78,7 +80,7 @@ class GridButton : public Ctrl virtual void MouseLeave(); virtual void State(int reason); virtual Size GetStdSize() const; - + void SetButton(int n); }; class GridResizePanel : public FrameBottom @@ -1409,6 +1411,8 @@ class GridCtrl : public Ctrl GridCtrl& MultiSort(int sort_col, int sort_mode = SORT_UP); GridCtrl& MultiSort(Id id, int sort_mode = SORT_UP); void ClearSort(); + void MarkSort(int col, int sort_mode); + void MarkSort(Id id, int sort_mode); Vector GetSortOrder() const; Vector GetSortOrderId() const; @@ -1544,6 +1548,7 @@ class GridCtrl : public Ctrl bool ClearMultisort(); bool ClearSorted(); bool IsSorted(); + void MarkSort(int col, int sort_mode, bool refresh); void DrawHorzDragLine(Draw &w, int pos, int cx, int size, Color c); void DrawVertDragLine(Draw &w, int pos, int size, int dx, Color c); diff --git a/uppsrc/GridCtrl/GridCtrl.iml b/uppsrc/GridCtrl/GridCtrl.iml index fb5cc3178..55e42affb 100644 --- a/uppsrc/GridCtrl/GridCtrl.iml +++ b/uppsrc/GridCtrl/GridCtrl.iml @@ -39,11 +39,15 @@ IMAGE_ID(SelDn) IMAGE_ID(SelLeft) IMAGE_ID(SelRight) IMAGE_ID(SelPlus) +IMAGE_ID(SelCross) IMAGE_ID(SelDots) IMAGE_ID(SortDsc) -IMAGE_ID(CloseN) -IMAGE_ID(CloseH) -IMAGE_ID(CloseP) +IMAGE_ID(Btn0N) +IMAGE_ID(Btn0H) +IMAGE_ID(Btn0P) +IMAGE_ID(Btn1N) +IMAGE_ID(Btn1H) +IMAGE_ID(Btn1P) IMAGE_ID(Dots1) IMAGE_ID(Dots2) @@ -98,49 +102,70 @@ IMAGE_DATA(203,196,254,37,143,235,198,227,197,114,241,58,243,211,50,81,60,19,91, IMAGE_END_DATA(1504, 19) IMAGE_BEGIN_DATA -IMAGE_DATA(120,156,221,152,219,139,220,116,20,199,167,218,181,85,159,170,254,5,138,85,183,182,42,162,32,250,36,248,224,131,168,160) -IMAGE_DATA(173,125,169,215,39,17,159,170,143,34,125,177,21,193,186,221,90,68,193,11,8,197,150,22,65,176,90,74,171,133,125,216) -IMAGE_DATA(98,183,107,247,58,183,205,92,50,183,36,51,73,230,62,153,153,175,191,147,152,153,100,230,55,59,201,102,45,197,179,124) -IMAGE_DATA(216,201,239,156,239,57,249,101,146,95,206,111,66,59,66,247,132,182,135,110,15,121,49,48,243,20,184,190,30,27,205,99) -IMAGE_DATA(235,109,252,230,25,212,251,205,131,1,227,12,109,232,124,130,92,215,27,153,99,104,178,30,174,199,168,184,141,178,153,57) -IMAGE_DATA(130,206,101,51,174,233,205,154,195,203,245,240,83,127,144,141,156,79,16,253,96,158,32,215,212,145,103,125,219,18,218,209) -IMAGE_DATA(251,172,202,121,12,34,103,146,16,215,194,72,70,23,250,68,134,89,152,155,53,113,37,44,73,89,20,11,25,134,8,37) -IMAGE_DATA(159,134,148,75,65,206,38,33,101,18,40,136,2,114,201,152,73,54,17,133,40,132,145,97,133,196,248,10,210,177,101,164) -IMAGE_DATA(24,148,152,37,188,187,151,80,211,106,184,190,16,198,194,98,4,139,75,81,44,45,199,176,188,26,199,106,88,64,56,146) -IMAGE_DATA(64,36,154,68,52,158,66,108,45,141,184,32,66,72,100,145,72,229,144,76,231,145,18,11,72,103,36,136,89,25,179,87) -IMAGE_DATA(174,81,226,187,122,137,5,65,64,50,153,68,58,157,70,38,147,65,54,155,69,62,159,135,36,73,80,20,5,197,98,17) -IMAGE_DATA(170,170,66,215,117,84,42,21,212,106,53,212,235,117,52,155,77,24,134,129,78,167,131,110,183,235,62,91,26,108,49,103) -IMAGE_DATA(131,5,213,88,112,165,90,131,94,174,64,213,116,40,37,21,146,82,66,94,82,144,205,211,89,209,25,230,32,164,50,136) -IMAGE_DATA(39,210,136,174,37,17,142,37,176,18,89,195,210,106,236,255,144,184,221,110,155,201,155,173,150,89,160,94,111,176,235,104) -IMAGE_DATA(21,41,87,170,208,204,66,101,148,84,13,197,146,6,185,104,21,44,200,10,242,5,42,42,35,147,43,184,111,177,138,86) -IMAGE_DATA(194,32,154,82,128,156,19,81,200,8,125,196,97,132,88,216,196,149,176,90,86,65,148,245,34,202,170,2,189,36,153,104) -IMAGE_DATA(197,2,84,37,63,116,63,75,185,4,242,44,153,73,122,205,186,103,39,66,119,184,158,68,222,211,201,25,7,103,124,112) -IMAGE_DATA(89,226,141,121,101,92,141,245,207,249,6,76,202,143,102,115,38,117,107,104,43,111,18,94,10,210,21,153,24,74,200,173) -IMAGE_DATA(50,126,38,222,180,219,66,119,242,10,142,18,14,22,27,53,238,245,222,242,82,239,230,246,109,115,127,221,126,30,22,175) -IMAGE_DATA(247,182,231,226,163,3,199,23,240,255,237,109,101,229,61,20,247,115,43,120,127,234,6,138,143,154,13,111,118,126,78,132) -IMAGE_DATA(159,255,54,246,199,177,81,223,155,215,117,103,220,67,226,45,255,246,208,45,163,156,235,93,1,190,127,3,203,195,205,238) -IMAGE_DATA(187,177,79,232,14,103,35,208,236,34,93,50,16,201,55,125,67,58,210,11,74,11,245,22,107,13,89,235,211,169,86,61) -IMAGE_DATA(67,241,164,35,253,162,216,48,143,213,211,63,65,154,58,234,25,138,39,29,233,175,165,26,232,148,203,40,28,249,196,55) -IMAGE_DATA(164,35,253,21,161,206,62,235,200,125,252,145,111,72,71,250,153,104,13,29,93,67,230,195,131,61,108,27,55,70,58,210) -IMAGE_DATA(95,90,173,162,173,169,72,189,247,110,15,167,241,142,109,72,71,250,223,23,43,104,171,37,36,222,122,221,5,207,6,99) -IMAGE_DATA(72,71,250,95,230,203,104,151,138,136,239,123,117,8,167,241,252,164,35,253,153,171,58,12,182,181,136,188,248,130,11,158) -IMAGE_DATA(13,198,144,142,244,39,103,53,24,138,140,149,231,158,237,225,52,222,177,13,233,72,255,195,140,10,67,150,176,248,244,83) -IMAGE_DATA(61,108,27,55,70,58,210,127,115,185,4,131,109,151,174,63,249,184,111,72,71,250,19,151,172,28,243,123,118,97,254,145) -IMAGE_DATA(135,189,195,226,73,71,250,169,11,69,243,25,138,188,113,0,243,143,237,233,113,109,247,36,230,30,218,137,185,201,7,48) -IMAGE_DATA(255,232,110,151,143,160,120,210,145,254,228,21,13,169,162,129,22,219,146,212,217,214,176,158,72,152,52,68,17,77,182,45) -IMAGE_DATA(108,230,114,168,179,237,162,61,110,194,226,40,158,116,164,207,233,109,156,254,75,199,231,231,21,223,144,142,244,174,5,169) -IMAGE_DATA(204,22,148,53,182,176,44,178,5,198,47,164,35,253,138,220,130,212,236,112,111,176,113,70,58,210,207,176,197,192,52,45) -IMAGE_DATA(6,44,95,244,14,197,51,35,253,197,248,191,57,102,206,250,135,25,233,127,93,173,91,57,206,125,239,31,102,164,255,121) -IMAGE_DATA(169,102,229,56,53,213,199,54,15,99,164,63,245,119,213,242,125,125,168,143,211,120,199,142,56,210,255,120,181,98,249,166) -IMAGE_DATA(14,186,225,25,39,134,244,223,206,150,45,255,161,183,135,113,218,8,63,233,191,154,209,173,152,15,246,186,225,25,39,134) -IMAGE_DATA(244,211,127,106,150,255,253,231,251,56,141,119,236,136,35,253,209,139,170,229,123,231,153,62,182,121,24,35,253,103,23,74) -IMAGE_DATA(150,239,192,19,254,97,70,250,79,207,23,173,28,123,39,129,125,187,188,67,241,204,72,127,228,55,197,202,113,248,77,96) -IMAGE_DATA(255,174,62,175,236,4,94,186,23,120,249,62,224,181,73,183,143,160,120,102,164,63,246,135,138,239,230,107,232,118,169,153) -IMAGE_DATA(168,58,104,154,47,249,110,219,96,212,6,124,140,78,199,212,145,126,85,54,112,252,178,138,195,231,20,223,144,142,244,255) -IMAGE_DATA(89,135,212,105,52,208,98,43,171,87,40,222,217,33,209,113,120,255,62,204,61,120,191,103,40,158,116,118,135,20,228,205) -IMAGE_DATA(99,119,72,65,222,128,118,135,20,228,77,108,119,72,65,58,2,187,67,10,210,153,108,102,135,20,164,83,179,59,164,32) -IMAGE_DATA(29,163,221,33,5,233,92,237,14,41,72,7,109,119,72,65,58,121,187,67,234,26,6,212,179,103,32,159,56,222,67,154) -IMAGE_DATA(158,178,118,15,199,190,128,252,229,180,203,71,80,60,233,156,29,82,187,197,208,180,30,84,195,222,197,56,199,123,52,91) -IMAGE_DATA(155,219,33,77,132,182,140,218,211,89,255,39,70,255,240,49,122,35,232,222,60,242,198,198,255,232,49,198,254,1,26,190) -IMAGE_DATA(249,232,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(1440, 28) +IMAGE_DATA(120,156,237,89,125,108,83,215,21,119,104,66,66,128,1,77,36,132,180,22,146,110,100,13,45,137,139,50,24,101,137,210) +IMAGE_DATA(45,130,17,53,99,34,13,205,64,77,87,178,14,210,106,136,173,12,193,31,211,84,1,75,209,196,178,148,46,154,54,137) +IMAGE_DATA(109,210,164,106,141,82,181,154,4,91,85,81,218,44,210,130,214,16,72,128,124,57,182,99,59,254,254,140,237,216,142,243) +IMAGE_DATA(219,61,215,123,142,159,243,108,191,23,103,8,77,61,209,79,206,189,231,252,206,185,239,190,123,239,59,247,94,213,6,85) +IMAGE_DATA(177,170,64,181,74,37,71,192,68,150,97,122,62,150,234,71,224,11,80,234,39,153,175,212,15,146,68,162,106,73,237,201) +IMAGE_DATA(166,95,31,164,143,69,15,43,163,63,82,217,45,21,203,233,35,219,103,89,142,62,125,88,125,200,233,15,37,241,147,177) +IMAGE_DATA(148,246,100,195,79,246,147,77,159,38,248,73,47,57,170,13,241,255,221,118,11,146,97,55,233,97,156,28,133,126,124,104) +IMAGE_DATA(1,99,139,49,52,208,207,33,114,232,178,77,195,105,53,49,24,225,176,24,96,51,79,193,62,173,135,205,164,131,213,168) +IMAGE_DATA(133,89,63,193,49,173,27,135,81,59,10,19,11,100,212,220,135,97,226,30,166,24,200,49,115,88,20,119,232,241,4,112) +IMAGE_DATA(103,104,20,67,195,99,24,190,59,142,187,247,38,112,111,68,131,145,81,45,70,199,116,24,27,215,99,92,51,133,137,73) +IMAGE_DATA(3,52,90,35,180,186,105,232,166,204,208,27,44,152,50,90,97,48,217,96,156,182,163,255,230,45,114,252,104,220,177,86) +IMAGE_DATA(171,133,94,175,135,193,96,128,201,100,194,244,244,52,44,22,11,108,54,27,28,14,7,156,78,39,220,110,55,188,94,47) +IMAGE_DATA(102,102,102,16,8,4,16,12,6,17,10,133,16,137,68,16,141,70,49,63,63,47,110,45,85,134,153,114,150,25,5,152) +IMAGE_DATA(241,140,63,0,175,111,6,110,143,23,14,151,27,54,135,11,22,155,3,211,22,106,21,181,208,12,237,148,9,26,157,1) +IMAGE_DATA(227,147,122,140,78,232,112,127,108,18,119,71,38,254,31,28,207,205,205,113,231,161,112,152,7,8,6,103,89,63,198,130) +IMAGE_DATA(248,102,252,240,240,64,62,184,220,30,56,93,30,216,157,177,128,86,187,3,22,43,5,181,195,100,182,138,135,216,140,199) +IMAGE_DATA(133,100,120,28,86,216,205,70,88,77,218,5,24,23,67,59,49,202,33,114,232,247,185,65,240,121,157,240,185,29,240,186) +IMAGE_DATA(108,28,30,167,21,110,135,101,209,120,182,153,117,176,48,103,28,134,201,216,152,205,83,21,138,102,162,212,236,148,168,135) +IMAGE_DATA(68,125,242,178,36,85,39,23,153,98,164,111,243,3,120,40,37,156,229,121,168,71,84,185,82,15,33,39,32,245,72,222) +IMAGE_DATA(34,135,146,81,50,63,137,60,110,190,106,181,84,192,84,196,228,96,169,234,229,142,45,57,241,30,110,93,190,248,117,43) +IMAGE_DATA(153,44,114,199,182,236,224,169,13,51,7,80,254,246,114,89,120,25,193,149,12,5,249,179,46,41,120,170,167,145,122,58) +IMAGE_DATA(37,13,145,246,191,146,253,73,72,170,247,38,119,221,201,52,73,228,249,95,37,115,99,43,163,241,74,122,81,138,39,103) +IMAGE_DATA(48,203,213,203,153,44,242,135,79,250,25,46,150,2,213,138,84,228,116,67,74,90,191,132,245,246,97,215,41,153,212,114) +IMAGE_DATA(222,98,250,120,27,18,51,171,208,60,12,174,8,198,44,33,197,32,30,241,181,142,48,130,97,150,107,179,92,50,234,247) +IMAGE_DATA(203,6,217,19,143,248,195,198,89,94,118,119,255,21,182,206,14,217,32,123,226,17,255,214,212,44,162,62,31,172,111,253) +IMAGE_DATA(82,49,136,71,252,155,218,32,251,223,11,243,47,126,174,24,196,35,126,223,120,0,81,175,7,166,159,189,17,135,32,153) +IMAGE_DATA(234,136,71,252,79,70,252,152,243,184,49,245,122,91,28,137,34,85,22,64,60,226,255,99,120,6,115,110,23,116,175,180) +IMAGE_DATA(136,32,37,201,54,196,35,254,223,6,125,152,115,57,161,57,244,194,34,36,138,148,158,120,196,239,249,220,139,8,219,171) +IMAGE_DATA(141,125,247,121,17,164,36,217,134,120,196,127,183,223,131,136,195,142,251,117,207,197,145,40,82,101,1,196,35,254,159,251) +IMAGE_DATA(220,136,216,109,24,126,246,27,113,8,146,169,142,120,196,255,195,103,46,68,216,254,243,206,215,119,40,6,241,136,223,245) +IMAGE_DATA(73,204,199,224,246,109,24,172,120,74,62,152,61,241,136,223,249,177,147,207,161,177,151,95,194,160,122,123,28,183,158,46) +IMAGE_DATA(199,192,147,91,49,80,94,134,193,202,167,69,58,2,217,19,143,248,239,222,244,96,202,25,65,152,237,241,130,108,175,29) +IMAGE_DATA(212,233,56,102,141,70,132,216,62,59,100,54,35,200,246,223,66,61,7,179,35,123,226,17,223,236,157,67,247,191,189,248) +IMAGE_DATA(245,71,14,197,32,30,241,69,11,146,143,45,40,147,108,97,25,102,11,140,82,16,143,248,247,237,97,216,66,81,201,1) +IMAGE_DATA(150,73,136,71,252,62,182,24,112,241,76,0,247,174,203,7,217,51,33,254,117,205,127,125,244,189,175,28,76,136,127,117) +IMAGE_DATA(36,24,243,113,237,79,202,193,132,248,31,220,13,196,124,188,215,185,0,65,100,212,17,255,189,219,254,152,238,247,111,46) +IMAGE_DATA(32,81,164,202,9,118,196,255,203,231,51,49,93,231,27,98,72,137,132,13,241,175,244,251,98,250,55,143,46,70,162,164) +IMAGE_DATA(208,19,255,119,125,222,152,205,169,38,49,164,68,194,134,248,151,63,245,196,244,63,254,206,2,18,69,170,156,96,71,252) +IMAGE_DATA(142,235,238,152,174,117,207,2,4,145,81,71,252,95,125,236,138,233,94,170,82,14,38,196,191,248,145,51,230,163,169,28) +IMAGE_DATA(56,180,77,62,200,158,9,241,223,250,187,35,230,163,253,7,64,243,182,5,52,110,5,14,148,2,223,123,2,120,177,92) +IMAGE_DATA(172,35,144,61,19,226,191,125,195,141,63,14,6,48,63,79,201,132,63,1,33,254,145,159,159,139,48,4,146,116,12,209) +IMAGE_DATA(40,231,17,127,196,30,193,59,159,185,209,126,205,161,24,196,35,254,255,44,67,138,206,206,34,204,86,86,185,32,251,196) +IMAGE_DATA(12,137,202,163,205,135,48,240,181,175,202,6,217,19,79,200,144,178,249,242,8,25,82,54,95,64,33,67,202,230,75,44) +IMAGE_DATA(100,72,217,100,4,66,134,148,77,102,178,156,25,82,54,153,154,144,33,101,147,49,10,25,82,54,153,171,144,33,101,147) +IMAGE_DATA(65,11,25,82,54,153,188,144,33,205,71,34,112,191,223,3,123,215,59,113,216,46,119,198,118,15,111,255,6,246,223,94) +IMAGE_DATA(22,233,8,100,79,188,196,12,105,46,204,224,241,196,65,49,132,93,76,98,125,28,161,240,242,102,72,95,74,189,231,229) +IMAGE_DATA(210,250,195,163,248,102,245,179,41,241,147,159,158,92,180,55,172,171,251,22,14,31,62,140,11,23,46,224,204,153,51,56) +IMAGE_DATA(117,234,20,78,158,60,137,179,103,207,162,173,173,13,199,142,29,67,69,229,118,17,79,253,140,26,7,15,30,196,149,43) +IMAGE_DATA(87,248,149,203,197,139,23,185,143,115,231,206,241,114,119,119,55,215,151,148,150,196,121,143,63,254,24,246,239,223,143,230) +IMAGE_DATA(230,102,12,13,13,33,28,14,195,199,58,176,167,167,135,115,232,10,194,106,181,162,161,161,1,197,197,69,156,183,110,221) +IMAGE_DATA(58,212,214,214,162,190,190,30,123,247,238,69,99,99,35,52,26,13,231,210,213,14,113,232,234,231,192,129,3,168,169,169) +IMAGE_DATA(193,202,149,43,177,105,211,38,168,213,106,94,222,189,123,55,118,238,220,201,209,209,209,193,237,9,196,165,114,105,105,41) +IMAGE_DATA(183,207,201,201,225,241,136,191,102,205,26,172,93,187,22,235,215,175,71,93,93,29,143,71,215,76,116,237,68,191,58,150) +IMAGE_DATA(254,82,27,87,172,88,193,33,60,223,170,85,5,200,203,203,67,110,110,46,250,250,250,248,21,85,239,63,123,209,212,244) +IMAGE_DATA(2,110,220,184,193,203,3,183,6,176,101,203,22,110,147,216,159,20,171,184,184,24,223,102,239,226,195,15,63,64,3,91) +IMAGE_DATA(88,106,159,171,65,211,161,70,92,189,118,21,173,173,71,241,204,14,53,247,159,252,254,168,253,101,101,91,177,191,126,31) +IMAGE_DATA(94,108,110,66,235,171,175,160,237,181,31,225,213,99,173,188,252,124,67,61,242,243,243,37,207,4,212,234,74,20,20,20) +IMAGE_DATA(164,4,141,135,140,131,142,26,249,229,199,54,165,196,107,175,31,95,20,188,172,236,43,216,183,111,31,218,219,219,249,128) +IMAGE_DATA(59,113,226,4,142,31,63,142,211,167,79,163,165,165,5,71,142,28,65,126,129,248,97,11,87,23,98,207,158,61,124,192) +IMAGE_DATA(144,92,186,116,137,251,56,127,254,60,47,83,39,147,94,149,116,108,85,81,81,193,95,36,221,115,9,210,219,219,43,90) +IMAGE_DATA(5,171,170,170,68,7,45,37,37,37,168,172,172,68,121,121,57,170,171,171,37,87,224,93,187,118,97,243,230,205,241,67) +IMAGE_DATA(151,194,194,66,94,222,184,113,35,138,138,138,56,186,186,186,68,28,42,171,50,28,236,148,149,149,73,198,75,104,163,228) +IMAGE_DATA(81,162,153,237,211,72,140,38,35,155,52,53,160,123,83,18,127,208,159,246,192,104,43,123,23,253,253,255,66,21,251,50) +IMAGE_DATA(151,60,177,153,13,188,106,220,190,115,155,13,220,70,172,94,91,152,246,172,180,162,242,41,54,104,107,209,212,124,16,45) +IMAGE_DATA(47,127,31,205,71,154,120,121,71,85,101,202,131,168,194,194,130,180,231,180,52,30,190,88,233,190,88,233,30,252,74,151) +IMAGE_DATA(167,202,73,230,65,244,155,151,250,162,70,138,148,92,39,231,188,54,149,93,90,249,15,92,234,59,54,0,0,0,0,0) +IMAGE_END_DATA(2112, 32) diff --git a/uppsrc/GridCtrl/GridSort.cpp b/uppsrc/GridCtrl/GridSort.cpp index 6294809a5..778c892dc 100644 --- a/uppsrc/GridCtrl/GridSort.cpp +++ b/uppsrc/GridCtrl/GridSort.cpp @@ -147,6 +147,26 @@ bool GridCtrl::IsSorted() return sortOrder.GetCount() > 0 || sortCol >= 0; } +void GridCtrl::MarkSort(int col, int sort_mode, bool refresh) +{ + sortCol = col; + hitems[col].sortmode = sort_mode; + hitems[col].sortcol = sortOrder.GetCount(); + + if(refresh) + RefreshTop(); +} + +void GridCtrl::MarkSort(int col, int sort_mode) +{ + MarkSort(fixed_cols + col, sort_mode, true); +} + +void GridCtrl::MarkSort(Id id, int sort_mode) +{ + MarkSort(aliases.Get(id), sort_mode, true); +} + GridCtrl& GridCtrl::Sort(int sort_col, int sort_mode, bool multisort, bool repaint) { int col = GetIdCol(sort_col + fixed_cols); @@ -161,8 +181,7 @@ GridCtrl& GridCtrl::Sort(int sort_col, int sort_mode, bool multisort, bool repai sortOrder.Add(col); - hitems[col].sortmode = sort_mode; - hitems[col].sortcol = sortOrder.GetCount(); + MarkSort(col, sort_mode, false); GSort(); UpdateCursor(); diff --git a/uppsrc/Sql/SqlVal.cpp b/uppsrc/Sql/SqlVal.cpp index 8063415d0..6403368c8 100644 --- a/uppsrc/Sql/SqlVal.cpp +++ b/uppsrc/Sql/SqlVal.cpp @@ -129,7 +129,7 @@ SqlVal::SqlVal(const SqlId& (*id)()) SqlVal::SqlVal(SqlCol id) { SetHigh(id.ToString()); } - +/* SqlVal::SqlVal(const SqlSelect& x) { SetHigh('(' + ((SqlStatement) x).GetText() + ')'); } @@ -137,7 +137,7 @@ SqlVal::SqlVal(const SqlSelect& x) { SqlVal::SqlVal(const SqlBool& x) { SetHigh(~x); } - +*/ SqlVal::SqlVal(const Case& x) { SetHigh(~x); } diff --git a/uppsrc/Sql/Sqlexp.h b/uppsrc/Sql/Sqlexp.h index 2645b232e..df689a369 100644 --- a/uppsrc/Sql/Sqlexp.h +++ b/uppsrc/Sql/Sqlexp.h @@ -181,8 +181,8 @@ public: SqlVal(SqlId id); SqlVal(const SqlId& (*id)()); SqlVal(SqlCol id); - SqlVal(const SqlSelect& x); - SqlVal(const SqlBool& x); +// SqlVal(const SqlSelect& x); +// SqlVal(const SqlBool& x); SqlVal(const Case& x); };