484_uppsrc.diff
uppsrc/ide/LayDes/laydes.cpp 2013-08-13 11:30:03 +0400 | ||
---|---|---|
1252 | 1252 |
ReloadItems(); |
1253 | 1253 |
} |
1254 | 1254 |
|
1255 |
void LayDes::SortItems() |
|
1256 |
{ |
|
1257 |
SaveState(); |
|
1258 |
if(currentlayout < 0) |
|
1259 |
return; |
|
1260 |
LayoutData& l = CurrentLayout(); |
|
1261 |
Vector<int> order = GetSortOrder(l.item); |
|
1262 |
for(int i = 0, n = cursor.GetCount(); i < n; ++i) { |
|
1263 |
int index = FindIndex(order, cursor[i]); |
|
1264 |
if(index >= 0) |
|
1265 |
cursor[i] = index; |
|
1266 |
} |
|
1267 |
IndexSort(l.item, order); |
|
1268 |
ReloadItems(); |
|
1269 |
} |
|
1270 |
|
|
1255 | 1271 |
void LayDes::Flush() |
1256 | 1272 |
{ |
1257 | 1273 |
currentlayout = -1; |
uppsrc/ide/LayDes/LayDes.h 2013-08-13 08:33:12 +0400 | ||
---|---|---|
198 | 198 |
LayoutItem() { csize.cx = -1; hide = false; charset = CHARSET_UNICODE; } |
199 | 199 |
}; |
200 | 200 |
|
201 |
inline bool operator<(const Ctrl::LogPos& a, const Ctrl::LogPos& b) |
|
202 |
{ |
|
203 |
if(a.y.GetA() < b.y.GetA()) |
|
204 |
return true; |
|
205 |
if(a.y.GetA() == b.y.GetA()) |
|
206 |
return a.x.GetA() < b.x.GetA(); |
|
207 |
return false; |
|
208 |
} |
|
209 |
|
|
210 |
inline bool operator<(const LayoutItem& a, const LayoutItem& b) |
|
211 |
{ |
|
212 |
return a.pos < b.pos; |
|
213 |
} |
|
214 |
|
|
201 | 215 |
Image GetTypeIcon(const String& type, int cx, int cy, int i, Color bg); |
202 | 216 |
|
203 | 217 |
Array<LayoutItem> ReadItems(CParser& p, byte charset); |
... | ... | |
384 | 398 |
void Duplicate(); |
385 | 399 |
void MoveUp(); |
386 | 400 |
void MoveDown(); |
401 |
void SortItems(); |
|
387 | 402 |
void SelectAll(); |
388 | 403 |
|
389 | 404 |
void Matrix(); |
uppsrc/ide/LayDes/laywin.cpp 2013-08-13 08:38:03 +0400 | ||
---|---|---|
48 | 48 |
bool iscursor = currentlayout >= 0 && cursor.GetCount(); |
49 | 49 |
bar.Add(iscursor, AK_MOVEUP, LayImg::MoveUp(), THISBACK(MoveUp)); |
50 | 50 |
bar.Add(iscursor, AK_MOVEDOWN, LayImg::MoveDown(), THISBACK(MoveDown)); |
51 |
bar.Separator(); |
|
52 |
bar.Add(item.GetCount(), "Sort by position", THISBACK(SortItems)); |
|
51 | 53 |
} |
52 | 54 |
|
53 | 55 |
void LayDes::AlignBar(Bar& bar) |