Extended ListIcon

Share your advanced PureBasic knowledge/code with the community.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Extended ListIcon

Post by BackupUser »

Code updated for 5.20+

Restored from previous forum. Originally posted by fred.

Here is a little example to have modern listicon. It needs IE4+ (ie: Win98+, Win2k+ or IE4+ on Win95 and WinNT4)

Code: Select all

    ;
    ; ListIcon extension, by AlphaSND
    ;

    #WindowWidth  = 450
    #WindowHeight = 315

    #LVM_SETEXTENDEDLISTVIEWSTYLE = (#LVM_FIRST+54)
    #LVS_EX_GRIDLINES =1
    #LVS_EX_SUBITEMIMAGES =2
    #LVS_EX_CHECKBOXES =4
    #LVS_EX_TRACKSELECT =8
    #LVS_EX_HEADERDRAGDROP =16
    #LVS_EX_FULLROWSELECT =32
    #LVS_EX_ONECLICKACTIVATE =64
    #LVS_EX_TWOCLICKACTIVATE =128
    #LVS_EX_FLATSB =256
    #LVS_EX_REGIONAL =512
    #LVS_EX_INFOTIP = 1024
    #LVS_EX_UNDERLINEHOT =$800
    #LVS_EX_UNDERLINECOLD =$1000
    #LVS_EX_MULTIWORKAREAS =$2000

    If OpenWindow(0, 100, 120, #WindowWidth, #WindowHeight, "PureBasic - Advanced Gadget Demonstration", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget)


        *List = ListIconGadget(5, 8, 10, #WindowWidth-20, #WindowHeight-40, "Column 1", 131)
        AddGadgetColumn(5, 1, "Column 2", 300)
        AddGadgetColumn(5, 2, "Column 3", 80)
       
        For k=0 To 100
          AddGadgetItem(5, k, "Element "+Str(k)+Chr(10)+"C 2"+Chr(10)+"Comment 3", 0)
        Next
       
        SendMessage_(*List, #LVM_SETEXTENDEDLISTVIEWSTYLE, #LVS_EX_FULLROWSELECT, #LVS_EX_FULLROWSELECT)
        SendMessage_(*List, #LVM_SETEXTENDEDLISTVIEWSTYLE, #LVS_EX_FLATSB, #LVS_EX_FLATSB)
        SendMessage_(*List, #LVM_SETEXTENDEDLISTVIEWSTYLE, #LVS_EX_HEADERDRAGDROP, #LVS_EX_HEADERDRAGDROP)   
        SendMessage_(*List, #LVM_SETEXTENDEDLISTVIEWSTYLE, #LVS_EX_GRIDLINES, #LVS_EX_GRIDLINES)   
        SendMessage_(*List, #LVM_SETEXTENDEDLISTVIEWSTYLE, #LVS_EX_CHECKBOXES, #LVS_EX_CHECKBOXES) 
       
        ; Note: Several types can be put in one call:
        ; SendMessage_(*List, #LVM_SETEXTENDEDLISTVIEWSTYLE, #LVS_EX_FULLROWSELECT | #LVS_EX_HEADERDRAGDROP, #LVS_EX_FULLROWSELECT | #LVS_EX_HEADERDRAGDROP) 

      Repeat
      Until WaitWindowEvent() = #PB_Event_CloseWindow
    EndIf

Fred - AlphaSND
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Fangbeast.
Here is a little example to have modern listicon. It needs IE4+ (ie: Win98+, Win2k+ or IE4+ on Win95 and WinNT4)

Fred - AlphaSND
Just a tiny change Fred, i've modified your numbers in the following line because the bottom scroll bar was half cut off. The window now loos a lot neater.

*List = ListIconGadget(5, 8, 10, #WindowWidth - 21, #WindowHeight - 56, "Column 1", 131)



Fangles
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Manolo.
Here is a little example to have modern listicon. It needs IE4+ (ie: Win98+, Win2k+ or IE4+ on Win95 and WinNT4)
Hi Fred,
In the new 2.90 version don't compile correctly.

Manolo
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Danilo.

Works with v2.90 here (Win2k).

Check if your Compiler-Target is set to "Windows".

cya,
...Danilo

(registered PureBasic user)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Manolo.
Works with v2.90 here (Win2k).

Check if your Compiler-Target is set to "Windows".

cya,
...Danilo

(registered PureBasic user)
Hi Danilo,

Yes, with the 2.82 version has ok compiled, but with the 2.90 send the next error:

Line 8: Constant not found #LVM_FIRST
Then value of this constante is $1000 nad if I define, crashing.
The compiler is OK for Windows.

ByBy
Manolo
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Franco.
Just a tiny change Fred, i've modified your numbers in the following line because the bottom scroll bar was half cut off. The window now loos a lot neater.
Fangles
Well Fangles, I suppose you work under WinXP ?

The problem is that the WinXP title bar of an application is higher than on older WinOS!!!
Every application that has gadgets near to the bottom will have this problem if gagdets have size/position as a fixed value.

BTW: the scroll bar looks very ugly (like 1d style) instead of 3d. How to change this? (Win98SE)


Have a nice day...
Franco

Sometimes you have to go a lonely way to accomplish genius things.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Danilo.

@Franco:

Delete the following line for a normal scrollbar:
SendMessage_(*List, #LVM_SETEXTENDEDLISTVIEWSTYLE, #LVS_EX_FLATSB, #LVS_EX_FLATSB)

cya,
...Danilo

(registered PureBasic user)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Franco.

Thanks Danilo


Have a nice day...
Franco

Sometimes you have to go a lonely way to accomplish genius things.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Fangbeast.
Well Fangles, I suppose you work under WinXP ?

The problem is that the WinXP title bar of an application is higher than on older WinOS!!!
Every application that has gadgets near to the bottom will have this problem if gagdets have size/position as a fixed value.
Hmm, never knew that. Explains why even the PureBasic editor's dialog boxes have had this problem. Like Editor/Preferencxes is okay but Compiler/Options is still cut off.


Fangles
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by FAKEFACTORY.

Even on older win versions the application title bar *could* be of different size, i.e. if the user choose "Big Fonts" in Display Preferences.
So you should allways check the actual height of the titlebar with GetSystemMetrics_() and calculate the layout of your window after you know the exact values.


Registered PureBasic Coder

Edited by - FAKEFACTORY on 29 January 2002 02:31:59
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Danilo.

Hmmm...

The TitleBar is the NonClientArea and you
draw buttons etc. only in the ClientArea
of the Window, so i dont see a problem here... !?

cya,
...Danilo

(registered PureBasic user)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Franco.
The TitleBar is the NonClientArea and you
draw buttons etc. only in the ClientArea
of the Window, so i dont see a problem here... !?
Well if you declare the window size like 320*240, your window is 320*240.
And if the Title bar is higher you cut of the ClientArea at the bottom.
You don't have a window with 320*248 or something like that...

I don't know how it works if the user choose "Big Fonts" in Display Preferences.
Maybe there is a Window function to get a factor to incorporate in the window size...


Have a nice day...
Franco

Sometimes you have to go a lonely way to accomplish genius things.
Post Reply