1316 |
1316 |
LayoutCursor();
|
1317 |
1317 |
}
|
1318 |
1318 |
|
|
1319 |
void LayDes::DuplicateLayout()
|
|
1320 |
{
|
|
1321 |
if(currentlayout < 0)
|
|
1322 |
return;
|
|
1323 |
LayoutData& c = CurrentLayout();
|
|
1324 |
String name = c.name;
|
|
1325 |
for(;;) {
|
|
1326 |
if(!EditText(name, "Duplicate layout", "Layout", CharFilterCid))
|
|
1327 |
return;
|
|
1328 |
CParser p(name);
|
|
1329 |
if(p.IsId())
|
|
1330 |
break;
|
|
1331 |
Exclamation("Invalid name!");
|
|
1332 |
}
|
|
1333 |
String data = c.Save(0);
|
|
1334 |
CParser p(data);
|
|
1335 |
int next = currentlayout + 1;
|
|
1336 |
LayoutData& d = layout.Insert(next);
|
|
1337 |
d.Read(p);
|
|
1338 |
d.name = name;
|
|
1339 |
SyncLayoutList();
|
|
1340 |
layoutlist.SetCursor(next);
|
|
1341 |
LayoutCursor();
|
|
1342 |
}
|
|
1343 |
|
1319 |
1344 |
void LayDes::RenameLayout()
|
1320 |
1345 |
{
|
1321 |
1346 |
if(currentlayout < 0)
|
... | ... | |
1365 |
1390 |
|
1366 |
1391 |
void LayDes::LayoutMenu(Bar& bar)
|
1367 |
1392 |
{
|
|
1393 |
bool iscursor = layoutlist.IsCursor();
|
1368 |
1394 |
bar.Add("Add new layout..", THISBACK(AddLayout));
|
1369 |
|
bar.Add("Rename layout..", THISBACK(RenameLayout));
|
1370 |
|
bar.Add("Remove layout..", THISBACK(RemoveLayout));
|
|
1395 |
bar.Add(iscursor, "Duplicate layout..", THISBACK(DuplicateLayout));
|
|
1396 |
bar.Add(iscursor, "Rename layout..", THISBACK(RenameLayout));
|
|
1397 |
bar.Add(iscursor, "Remove layout..", THISBACK(RemoveLayout));
|
1371 |
1398 |
bar.Separator();
|
1372 |
|
bar.Add(layoutlist.IsCursor() && layoutlist.GetCursor() > 0,
|
|
1399 |
bar.Add(iscursor && layoutlist.GetCursor() > 0,
|
1373 |
1400 |
AK_MOVELAYOUTUP, LayImg::MoveUp(), THISBACK(MoveLayoutUp));
|
1374 |
|
bar.Add(layoutlist.IsCursor() && layoutlist.GetCursor() < layoutlist.GetCount() - 1,
|
|
1401 |
bar.Add(iscursor && layoutlist.GetCursor() < layoutlist.GetCount() - 1,
|
1375 |
1402 |
AK_MOVELAYOUTDOWN, LayImg::MoveDown(), THISBACK(MoveLayoutDown));
|
1376 |
1403 |
}
|
1377 |
1404 |
|