Page 1 of 1

ListIconGadget, Checkbox, ALT/Ctrl + Space Bar

Posted: Thu Aug 18, 2011 8:21 am
by horst
ListIcon checkbox status must not be changed by space bar in conjunction with ALT or Ctrl.

ALT+space is reserved for the system menu which may be used to close the window. Very annoying if checkbox status is unintentionally changed (especially when hidden under the menu).
Ctrl+space is reserved for deselecting an item.

Code: Select all

OpenWindow(0,200,200,200,300,"Test ListIcon Checkbox",#PB_Window_SystemMenu)
ListIconGadget(1,0,0,200,300,"ListIconGadget",170,#PB_ListIcon_CheckBoxes)
For i = 100 To 120 :  AddGadgetItem(1,-1,Str(i)) : Next 
SetActiveGadget(1)
SetGadgetState(1,10)

Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow

Re: ListIconGadget, Checkbox, ALT/Ctrl + Space Bar

Posted: Fri Jun 09, 2023 3:28 pm
by Fred
I agree but it seems like a Windows stuff here, as you can see with this full API example:

Code: Select all

colinfo.LV_COLUMN 
colinfo\mask = #LVCF_TEXT|#LVCF_WIDTH|#LVCF_FMT 
colinfo\fmt = #LVCFMT_LEFT 
colinfo\cx = 160

hwnd = OpenWindow(0,0,0,800,600, "API Listview",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
lv = CreateWindowEx_(#WS_EX_STATICEDGE , "SysListView32", "MyListView", #LVS_REPORT | #WS_CHILD | #WS_VISIBLE | #WS_HSCROLL | #WS_VSCROLL , 10,10,780,580,hwnd,0,0,0) 

SendMessage_(lv, #LVM_SETEXTENDEDLISTVIEWSTYLE, #LVS_EX_CHECKBOXES, #LVS_EX_CHECKBOXES)

For x = 0 To 5
  header$= "Column Header "+Str(x)
  colinfo\pszText = @header$
  SendMessage_(lv, #LVM_INSERTCOLUMN, x, @colinfo) 
Next

line.LV_ITEM 
line\Mask     = #LVIF_TEXT 
For i=0 To 120
  linetxt.s = "text entry "
  line\iitem = i
  line\pszText  = @linetxt
  SendMessage_(lv, #LVM_INSERTITEM, 0, @line)
  For c = 1 To 5
    col.LV_ITEM 
    coltext.s = "text entry " + Str(i) + " " +Str(c)
    col\Mask     = #LVIF_TEXT 
    col\iitem = i
    col\iSubItem = c
    col\pszText  = @coltext
    SendMessage_(lv, #LVM_SETITEM, 0, @col)
  Next
Next

Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow

Re: ListIconGadget, Checkbox, ALT/Ctrl + Space Bar

Posted: Thu Jun 22, 2023 4:07 am
by Blue
Verified.

Windows 11 behaves effectively as Fred says and as Horst wants to avoid.

Re: ListIconGadget, Checkbox, ALT/Ctrl + Space Bar

Posted: Thu Jun 22, 2023 4:57 am
by RASHAD
Hi horst
While it's an Old thread :)
For time been next is so simple workaround beside it Maybe Cross - Platform

Code: Select all

OpenWindow(0,200,200,200,300,"Test ListIcon Checkbox",#PB_Window_SystemMenu)
ListIconGadget(1,0,0,200,300,"ListIconGadget",170,#PB_ListIcon_CheckBoxes)
For i = 100 To 120 :  AddGadgetItem(1,-1,Str(i)) : Next 
SetActiveGadget(1)
SetGadgetState(1,10)
AddKeyboardShortcut(0,#PB_Shortcut_Alt|#PB_Shortcut_Space,10)
AddKeyboardShortcut(0,#PB_Shortcut_Control|#PB_Shortcut_Space,20)
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow

Re: ListIconGadget, Checkbox, ALT/Ctrl + Space Bar

Posted: Mon Jun 26, 2023 3:10 am
by Blue
That works very well, Rashad.
Brilliant workaround !
You may want to add a combination of your 2 shortcuts to make it a complete solution:

Code: Select all

AddKeyboardShortcut(0,#PB_Shortcut_Alt|#PB_Shortcut_Control|#PB_Shortcut_Space,10)