Sign in to follow this  
Followers 0
RogerL

GUICtrlCreateListView v _GUICtrlListView_Create

7 posts in this topic

I am finding many minor differences between regular GUI functions and UDF functions

take ListView creation for example:

#include <GUIConstants.au3>
#include <GuiListView.au3>
$hWnd = GUICreate("Alt ListView Creation Test",  380, 360, -1, -1)
$listView1 =  GUICtrlCreateListView  (       "Item | SubItem1",  20, 20, 160, 320, $LVS_REPORT)
$listView2 = _GUICtrlListView_Create ($hWnd, "Item | SubItem1", 200, 20, 160, 320, $LVS_REPORT)
GUISetState()
While 1
    If GUIGetMsg() = $GUI_EVENT_CLOSE Then ExitLoop
Wend

Notice that the UDF one doesn't have a border and the column header text is in a different font.

Is there any special reason for this?

Is it possible to get the same suncken border in the UDF one as in the regular one?

(I have tried all the ones documented in the help file, but may have just missed it)

TIA, RogerL

Share this post


Link to post
Share on other sites



I am finding many minor differences between regular GUI functions and UDF functions

take ListView creation for example:

#include <GUIConstants.au3>
#include <GuiListView.au3>
$hWnd = GUICreate("Alt ListView Creation Test",  380, 360, -1, -1)
$listView1 =  GUICtrlCreateListView  (       "Item | SubItem1",  20, 20, 160, 320, $LVS_REPORT)
$listView2 = _GUICtrlListView_Create ($hWnd, "Item | SubItem1", 200, 20, 160, 320, $LVS_REPORT)
GUISetState()
While 1
    If GUIGetMsg() = $GUI_EVENT_CLOSE Then ExitLoop
WendoÝ÷ ØÚ-Ç­«måÞv¬m«Þiº+uêÚÛayÊ%ºiáy§^®×±¶+"§b}÷«z{_¢{H²Ø^­æ§ÊÊ^r&¥­æ¬¢wè®Øb°",²&åzÚ zÛazƦz˧rG§nÝz¸§¶Z'y«"Ø^­è.ªèâ!j÷­®'jYmê'zÇhré×{az¥¥ø¥y»­¬¡j÷£ºËfËv+S hêËþ«¨µæ±·jë!××Ü(ºWaj÷­ç^}«¥¶ËajØ­«  ºËn±í7éd"ÈÔÄa¢·±jjey«­¢+ØÀÌØí±¥ÍÑY¥ÜÈô}U%
Ñɱ1¥ÍÑY¥Ý}
ÉÑ ÀÌØí¡]¹°ÅÕ½Ðí%Ñ´ðMÕ%Ñ´ÄÅÕ½Ðì°ÈÀÀ°ÈÀ°ÄØÀ°ÌÈÀ°ÀÌØí1YM}IA=IP°ÀÌØí]M}a}
1%9Q

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Yes, because I decided it would have the defaults that it has.

Just use $WS_EX_CLIENTEDGE

for example:

$listView2 = _GUICtrlListView_Create ($hWnd, "Item | SubItem1", 200, 20, 160, 320, $LVS_REPORT, $WS_EX_CLIENTEDGE)
[/qoute]

Thanks Gary.

Did you change the font to one that you prefer?

And did you change the the column width to a fixed width rather than letting the user set it by the title text width?

Share this post


Link to post
Share on other sites

Did you change the font to one that you prefer?

And did you change the the column width to a fixed width rather than letting the user set it by the title text width?

Used the Default GUI Font on the system

Nope, you can change the width.


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Used the Default GUI Font on the system

Nope, you can change the width.

Gary, I know I can change the width, but I was just pointing out that the regular ListView initially sizes the column widths by the amount of text the user sets in the call. The UDF one doesn't. I guess I worded my question incorrectly. Anyway no problem.

It's interesting that you say you used the Default GUI Font on the system. Maybe something's up with my machine. If I run the code in my oringinal post the font in the regular ListView is the same as used in Windows Explorer and Internet Explorer (I can tell cos the capital 'I' has a top and tail). In the font on the UDF ListView the capital 'I' looks like the pipe char, ie. no top and tail. I would welcome you comments on this as I would prefer to use the same font as the Explorers are using.

Thanks, Roger.

Share this post


Link to post
Share on other sites

Gary, I know I can change the width, but I was just pointing out that the regular ListView initially sizes the column widths by the amount of text the user sets in the call. The UDF one doesn't. I guess I worded my question incorrectly. Anyway no problem.

It's interesting that you say you used the Default GUI Font on the system. Maybe something's up with my machine. If I run the code in my oringinal post the font in the regular ListView is the same as used in Windows Explorer and Internet Explorer (I can tell cos the capital 'I' has a top and tail). In the font on the UDF ListView the capital 'I' looks like the pipe char, ie. no top and tail. I would welcome you comments on this as I would prefer to use the same font as the Explorers are using.

Thanks, Roger.

Look at the code in GuiListView.au3 you can see what is being done.

Like to point out 1 more time, there is no need to use the UDF create, that is more for educational purpose than anything else.


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Look at the code in GuiListView.au3 you can see what is being done.

Like to point out 1 more time, there is no need to use the UDF create, that is more for educational purpose than anything else.

If I change my code to use the regular ListView create I get a run time error (after calling _GUICtrlListView_DeleteAllItems) "Use GUICtrlDelete to delete items. Or if items were created with UDF functions MAKE sure to pass in handle to control NOT the controlid."

I used the UDF create to avoid this error! and to be consistent with the other UDF ListView calls I used as I wanted to access the list via index. Did I do wrong?

Edited by RogerL

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0