mike2003 Posted November 4, 2014 Posted November 4, 2014 (edited) I found that if you change the font size, the CheckBox position look wrong. like they are between the lines. this is confusing... How can I fix this? PS CheckBox alignment should be at the center or on the bottom, but not on top of the text Edited November 4, 2014 by mike2003
Moderators Melba23 Posted November 4, 2014 Moderators Posted November 4, 2014 mike2003,I have just checked on one of my scripts and I do not get the same "offset" effect when I change the font of a ListView. Can you please post a reproducer script. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
mike2003 Posted November 4, 2014 Author Posted November 4, 2014 #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 615, 438, 192, 124) $ListView1 = GUICtrlCreateListView("", 40, 32, 457, 297, BitOR($GUI_SS_DEFAULT_LISTVIEW,$LVS_SMALLICON), BitOR($WS_EX_CLIENTEDGE,$LVS_EX_CHECKBOXES)) GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif") $ListView1_0 = GUICtrlCreateListViewItem("aaaaaa", $ListView1) $ListView1_1 = GUICtrlCreateListViewItem("bbbbbbbb", $ListView1) $ListView1_2 = GUICtrlCreateListViewItem("ccccccccc", $ListView1) $ListView1_3 = GUICtrlCreateListViewItem("dddddddddd", $ListView1) $ListView1_4 = GUICtrlCreateListViewItem("eeeeeeeee", $ListView1) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd
Moderators Melba23 Posted November 4, 2014 Moderators Posted November 4, 2014 mike2003,You are setting the ListView styles incorrectly - this works fine for me. $ListView1 = GUICtrlCreateListView("Column 1", 40, 32, 457, 297) _GUICtrlListView_SetExtendedListViewStyle($ListView1, $LVS_EX_CHECKBOXES)You do not want to add the $LVS_SMALLICON style if you are using checkboxes (you need the default $LVS_REPORT mode). And always set the ListView extended styles as I have above - many of them share numeric values with the $WS_EX_* styles (an MS problem, not AutoIt) and you can get unwanted results if you add them in the creation line. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
mike2003 Posted November 4, 2014 Author Posted November 4, 2014 (edited) you use COLUMN mode. in this mode auto-wrap dont work. in my code i have auto page split. this is not exactly what i need i have more horizontal space and dont want extra scroll Edited November 4, 2014 by mike2003
Moderators Melba23 Posted November 4, 2014 Moderators Posted November 4, 2014 mike2003,It does help if you explain everything at the beginning of a thread. If you want to use checkboxes in other ListView modes then I cannot help you as I have very little experience of them, sorry. >M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
MikahS Posted November 4, 2014 Posted November 4, 2014 Why not just make an extra column and then use $LVS_NOCOLUMNHEADER. I'm betting it will look exactly the same as what Melba so graciously provided you. Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ
MikahS Posted November 5, 2014 Posted November 5, 2014 Then why not make two listviews and put them next to each other with no column headers and no scrollbars? Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ
mike2003 Posted November 5, 2014 Author Posted November 5, 2014 Why two? Maybe three? four? I do not know ... too difficult, then will need to processing. unduly complicated.
MikahS Posted November 5, 2014 Posted November 5, 2014 If your not going to try different solutions, then why should we give them to you? Done trying to help you. Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ
mike2003 Posted November 5, 2014 Author Posted November 5, 2014 (edited) The question was "how to correctly position the checkbox?" I do not need a general discussion as it might be at all Edited November 5, 2014 by mike2003
MikahS Posted November 5, 2014 Posted November 5, 2014 I know what your question was, I can read thank you. I've tried this and it is due to the spacing in the fonts. Seemingly I have tried doing this with the $LVS_SMALLICON, $LVS_LIST, $LVS_ICON, and $LVS_REPORT. It seems this is not possible without reprogramming how the checkboxes are made and centered on the item. Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ
bogQ Posted November 5, 2014 Posted November 5, 2014 (edited) Dont know if something like this catagorize as bug at all... but my main question is where are your icons? Sloppy edited a random script from AutoIt forum for this purpose: expandcollapse popup#include <WindowsConstants.au3> #include <Misc.au3> #include <GUIConstantsEx.au3> #include <GuiListView.au3> #Include <GuiImageList.au3> #include <GuiListView.au3> #NoTrayIcon Opt("GUIOnEventMode", 1) _Singleton(@ScriptName) $hGUI=GUICreate ("test", 500,300,-1,-1) GUISetOnEvent($GUI_EVENT_CLOSE, "_GuiMsg") $hListView = GUICtrlCreateListView("", 0, 0,500, 300) GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif") _GUICtrlListView_SetExtendedListViewStyle($hListView, $LVS_EX_CHECKBOXES) GUICtrlSetStyle($hListView, $LVS_SMALLICON) ;~ $hImage = _GUIImageList_Create(32, 32, 5, 3) $hImage = _GUIImageList_Create(1, 32, 5, 3);use upper to fully display icons ;~ _GUIImageList_AddIcon($hImage, "shell32.dll", "15", True) ;Extract large icons;ennable this line to display icons _GUICtrlListView_SetImageList($hListView, $hImage, 1) ;but use as small icons For $x = 0 To 99 _GUICtrlListView_AddItem($hListView, 'Testtttt'&$x + 1 , 0) Next _GUICtrlListView_SetView($hListView, 2) ;Set the view mode (2 = List) GUISetState() While 1 Sleep(100) Wend Func _GuiMsg() Switch @GUI_CTRLID Case $GUI_EVENT_CLOSE Exit Case $GUI_EVENT_MINIMIZE guisetstate(@SW_MINIMIZE) EndSwitch EndFunc Edited November 5, 2014 by bogQ mike2003 1 TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.
MikahS Posted November 5, 2014 Posted November 5, 2014 Very cool bogQ Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ
Solution mike2003 Posted November 6, 2014 Author Solution Posted November 6, 2014 works well. these two lines of code helped me $hImage = _GUIImageList_Create(1, 28) _GUICtrlListView_SetImageList($ListView1, $hImage, 1)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now