show selected icons visually

This commit is contained in:
2025-06-30 23:17:34 -05:00
parent b29727bfca
commit 7889ae05b6
2 changed files with 33 additions and 1 deletions

View File

@@ -7,6 +7,16 @@
<text name='num' top='36' left='242' width='40' height='16'/>
<pict name='sheet' framed='true' scaled='true' type='full' num='0' top='54' left='12' width='280' height='360'/>
<!-- Icon grid segments -->
<tilemap name='zrows' anchor='sheet' relative='pos-in pos-in' top='0' left='0' rows='11' cols='10' framed='false'>
<line name='zrow' left='0' top='0' width='28' height='0'/>
<text height='36' left='0' top='0' />
</tilemap>
<tilemap name='zcols' anchor='sheet' relative='pos-in pos-in' top='0' left='0' rows='10' cols='11' framed='false'>
<line name='zcol' left='0' top='0' width='0' height='36'/>
<text width='28' left='0' top='0' />
</tilemap>
<!-- Whole-sheet operations -->
<button name='copy' type='regular' def-key='ctrl c' top='54' left='304'>Copy</button>
<button name='paste' type='regular' def-key='ctrl v' relative='pos-in pos-in' rel-anchor='prev' top='26' left='0'>Paste</button>

View File

@@ -4016,7 +4016,29 @@ private:
void show_icon_selection() {
dlg["icon-min"].setTextToNum(icon_min);
dlg["icon-max"].setTextToNum(icon_max);
// TODO highlight the selected icons visually
// Clear selection lines
for(int y = 0; y < 11; ++y){
for(int x = 0; x < 11; ++x){
if(x < 10)
dlg["zrow-x" + std::to_string(x) + "y" + std::to_string(y)].hide();
if(y < 10)
dlg["zcol-x" + std::to_string(x) + "y" + std::to_string(y)].hide();
}
}
// highlight the selected icons visually
for(int y = 0; y < 10; ++y){
for(int x = 0; x < 10; ++x){
int icon = 1000 + 100 * all_pics[cur] + y * 10 + x;
if(icon >= icon_min && icon <= icon_max){
dlg["zrow-x" + std::to_string(x) + "y" + std::to_string(y)].show();
dlg["zrow-x" + std::to_string(x) + "y" + std::to_string(y+1)].show();
dlg["zcol-x" + std::to_string(x) + "y" + std::to_string(y)].show();
dlg["zcol-x" + std::to_string(x + 1) + "y" + std::to_string(y)].show();
}
}
}
if(icon_min != 0){
for(auto name : icon_buttons){
dlg[name].show();