er453r Posted November 18, 2007 Posted November 18, 2007 Hi. My ListView has $LV_VIEW_TILE style. When I try to delete items from it (with _GUICtrlListViewDeleteItem) they are deleted, but the space after the deleted item is not filled. It just disappears, and leaves a black place. Any ideas? I've tried to delete all items, and redraw the whole list, but it takes too long. Thanks in advance.
FireLord Posted November 18, 2007 Posted November 18, 2007 Some code would prompt a reply quicker I'm guessing. [center]See the Helpfile[/center] While Alive() DrinkWine(); }[center][/center]
er453r Posted November 18, 2007 Author Posted November 18, 2007 There's little coding here... but with pictures We have a ListView: Now: _GUICtrlListViewDeleteItem($list,2) Effect: Hope it helps.
GaryFrost Posted November 18, 2007 Posted November 18, 2007 (edited) Being there is no script to look at, we'll have to guess.TryGuiSetState(@SW_LOCK)before the delete andGuiSetState(@SW_UNLOCK)after the deleteif this don't workyou might want to look at the beta, and do something like_GUICtrlListView_BeginUpdate_GUICtrlListView_DeleteItem_GUICtrlListView_EndUpdatelook at _GuiCtrlListView_SetItemPosition in betaTile/Icon view doesn't re-arrange the items automatically as far as I knowmight also look at _GUICtrlListView_Arrangeon a roll here, won't re-arrange automatically unless you have $LVS_AUTOARRANGE style set Edited November 18, 2007 by GaryFrost SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
er453r Posted November 18, 2007 Author Posted November 18, 2007 Ok, beta does wonders. BUT it doesn't support $LV_VIEW_TILE style
GaryFrost Posted November 18, 2007 Posted November 18, 2007 Ok, beta does wonders. BUT it doesn't support $LV_VIEW_TILE style _GUICtrlListView_SetView($listview, 4) SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
er453r Posted November 18, 2007 Author Posted November 18, 2007 (edited) Found it myself at least... Thanks for all the help edit: maybe one more thing. Is it possible to change the tile icon size?ok, managed myself Edited November 18, 2007 by er453r
er453r Posted November 18, 2007 Author Posted November 18, 2007 And is it possible to change font in listview?
GaryFrost Posted November 18, 2007 Posted November 18, 2007 (edited) And is it possible to change font in listview? here's what sets the font of the UDF created listview _SendMessage($hList, $WM_SETFONT, _WinAPI_GetStockObject ($DEFAULT_GUI_FONT), True) if your using the GuiCtrlCreateListview, might look at GUICtrlSetFont Edited November 18, 2007 by GaryFrost SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
er453r Posted November 18, 2007 Author Posted November 18, 2007 (edited) _SendMessage($hList, $WM_SETFONT, _WinAPI_GetStockObject ($DEFAULT_GUI_FONT), True) Hm. And which part corresponds to size/weight? And I'm using betas _GUICtrlListView_Create Edited November 18, 2007 by er453r
GaryFrost Posted November 18, 2007 Posted November 18, 2007 Hm. And which part corresponds to size/weight? And I'm using betas _GUICtrlListView_Create _SendMessage($hList, $WM_SETFONT, _WinAPI_GetStockObject ($DEFAULT_GUI_FONT), True) _WinAPI_GetStockObject ($DEFAULT_GUI_FONT) gets the handle to the default gui font. the $WM_SETFONT message takes a handle to a font. _WinAPI_CreateFontIndirect and $tagLOGFONT is what you need, the $tagLOGFONT isn't listed in the help at the moment, should be soon, but you can find it in the StructureConstants.au3 file You'll also need to know how to do DllStruct functions SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
er453r Posted November 18, 2007 Author Posted November 18, 2007 And how can I control the resizing of the beta ListView?
drube Posted December 2, 2007 Posted December 2, 2007 _SendMessage($hList, $WM_SETFONT, _WinAPI_GetStockObject ($DEFAULT_GUI_FONT), True) _WinAPI_GetStockObject ($DEFAULT_GUI_FONT) gets the handle to the default gui font. the $WM_SETFONT message takes a handle to a font. _WinAPI_CreateFontIndirect and $tagLOGFONT is what you need, the $tagLOGFONT isn't listed in the help at the moment, should be soon, but you can find it in the StructureConstants.au3 file You'll also need to know how to do DllStruct functionsThanks, Gary. Can you do it for us, then it won't end up in a mess like this: expandcollapse popup#include <GUIConstants.au3> #Include <GuiListView.au3> Opt("GUIOnEventMode", 1) $Form1 = GUICreate('testing', 767, 452, 193, 115, BitOR($WS_MAXIMIZEBOX,$WS_MINIMIZEBOX,$WS_SIZEBOX,$WS_THICKFRAME,$WS_SYSMENU,$WS_CAPTION,$WS_OVERLAPPEDWINDOW,$WS_TILEDWINDOW,$WS_GROUP,$WS_TABSTOP,$WS_BORDER,$WS_CLIPSIBLINGS), 0) GUISetOnEvent($GUI_EVENT_CLOSE, "Form1_Close") $LV1h = _GUICtrlListView_Create($Form1, '', 0, 0, 766, 390, _ BitOR($LVS_REPORT, $LVS_SINGLESEL, $LVS_SHOWSELALWAYS, $WS_VSCROLL, $WS_CHILD, $WS_VISIBLE)) _GUICtrlListView_SetExtendedListViewStyle($LV1h, BitOR($LVS_EX_GRIDLINES,$LVS_EX_HEADERDRAGDROP, $WS_EX_CLIENTEDGE)) _GUICtrlListView_AddColumn($LV1h, 'Name', 230, 2) _GUICtrlListView_AddItem($LV1h, 'Gemma Atkinson') _GUICtrlListView_AddItem($LV1h, 'Jason "J" Brown') GUISetState(@SW_SHOW) _SetFont_hWnd($LV1h, 12.5, 400, 2, 'Lucida Console') While True GuiGetMsg(); Idle WEnd Func Form1_Close() Exit 0 EndFunc Func _SetFont_hWnd($hwnd, $size=8.5, $weight=400, $attr=0, $fontname="") Local $_tagfont = DllStructCreate($tagLOGFONT) Local $hDC = _WinAPI_GetDC($hwnd) ; lfHeight = -MulDiv(PointSize, GetDeviceCaps(hDC, LOGPIXELSY), 72) Local $lf_height = -($size * _WinAPI_GetDeviceCaps($hDC, $LOGPIXELSY)) / 72 _WinAPI_ReleaseDC($hwnd, $hDC) DllStructSetData($_tagfont, 'Height', $lf_height); DllStructSetData($_tagfont, 'Width', 0); DllStructSetData($_tagfont, 'Escapement', 0); DllStructSetData($_tagfont, 'Orientation', 0); DllStructSetData($_tagfont, 'Weight', $weight); DllStructSetData($_tagfont, 'Italic', BitAND($attr, 0x2)) DllStructSetData($_tagfont, 'Underline', BitAND($attr, 0x4)) DllStructSetData($_tagfont, 'StrikeOut', BitAND($attr, 0x8)) DllStructSetData($_tagfont, 'CharSet', 0); 0 = ANSI_CHARSET DllStructSetData($_tagfont, 'OutPrecision', 0); 0 = OUT_DEFAULT_PRECIS DllStructSetData($_tagfont, 'ClipPrecision', 0); 0 = CLIP_DEFAULT_PRECIS DllStructSetData($_tagfont, 'Quality', 0); 0 = DEFAULT_QUALITY ; 0 = DEFAULT_PITCH, 1 = FIXED_PITCH, 2 = VARIABLE_PITCH ; $FF_DONTCARE = 0 (FF_ROMAN = 16, FF_SWISS = 32, FF_MODERN = 48, FF_SCRIPT = 64, FF_DECORATIVE = 80) DllStructSetData($_tagfont, 'PitchAndFamily', BitOR(0, $FF_DONTCARE)) DllStructSetData($_tagfont, 'FaceName', $fontname); Local $h_font = _WinAPI_CreateFontIndirect($_tagfont) _SendMessage($hwnd, $WM_SETFONT, $h_font, True) EndFunc
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