It is currently Tue Sep 07, 2010 9:52 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 320 posts ]  Go to page Previous  1 ... 18, 19, 20, 21, 22
Author Message
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Tue Jul 20, 2010 10:59 am 
Offline
PureBasic Protozoa
PureBasic Protozoa
User avatar

Joined: Fri Apr 25, 2003 3:08 pm
Posts: 2580
Hello Gnozal, I am using your library for pb4.5.

If I setup custom icons on the header, I can see them during a sort:

Code:
PureLVSORT_SetUserIcons(ImageID(#Image_picsender_sortup), ImageID(#Image_picsender_sortdown))


If I add data to the ListiconGadget with icons as in:

Code:
      AddGadgetItem(#Gadget_picsender_maillist, -1, CurrentFile.s + Chr(10) + Currentpath.s), ImageID(#Image_picsender_photos))


The custom sort header icons disappear.

_________________
http://members.westnet.com.au/bangfeast/


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Tue Jul 20, 2010 11:37 am 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 3769
Location: Strasbourg / France
Hi Fangbeast, it seems to work here :
Code:
Procedure Open_Window_0()
  If OpenWindow(0, 216, 0, 602, 152, "PureLVSORT Test", #PB_Window_SystemMenu | #PB_Window_TitleBar | #PB_Window_ScreenCentered)
    ListIconGadget(0, 5, 5, 590, 140, "String", 110)
    AddGadgetColumn(0, 1, "Numeric", 110)
    AddGadgetColumn(0, 2, "Float", 110)
    AddGadgetColumn(0, 3, "DateDDMMYYYY", 120)
    AddGadgetColumn(0, 4, "DateMMDDYYYY", 120)
    SomeIcon = LoadImage(2, #PB_Compiler_Home + "Examples\Sources\Data\CdPlayer.ico")
    AddGadgetItem(0, -1, "ABCDE" + Chr(10) + "514" + Chr(10) + "0.9" + Chr(10) + "31/12/2004" + Chr(10) + "12/31/2004")
    AddGadgetItem(0, -1, "ACDEF" + Chr(10) + "118" + Chr(10) + "1.9" + Chr(10) + "11/12/2004" + Chr(10) + "12/11/2004", SomeIcon)
    AddGadgetItem(0, -1, "ZABCD" + Chr(10) + "-414" + Chr(10) + "7.0" + Chr(10) + "21/01/2003" + Chr(10) + "01/21/2003")
    AddGadgetItem(0, -1, "DEFGH" + Chr(10) + "524" + Chr(10) + "900" + Chr(10) + "10/06/2001" + Chr(10) + "06/10/2001", SomeIcon)
  EndIf
EndProcedure
Open_Window_0()
; User Icons
IconArrowUp.l = CatchImage(0, ?IconArrowUp)
IconArrowDown.l = CatchImage(1, ?IconArrowDown)
PureLVSORT_SetUserIcons(IconArrowUp, IconArrowDown)
; ListIcon Sort Setup
If PureLVSORT_SelectGadgetToSort(0, #PureLVSORT_ShowClickedHeader_IconLeft) = #PureLVSORT_Ok
  PureLVSORT_SetColumnType(0, 0, #PureLVSORT_String) ; default, not necessary
  PureLVSORT_SetColumnType(0, 1, #PureLVSORT_Numeric)
  PureLVSORT_SetColumnType(0, 2, #PureLVSORT_Float)
  PureLVSORT_SetColumnType(0, 3, #PureLVSORT_DateDDMMYYYY)
  PureLVSORT_SetColumnType(0, 4, #PureLVSORT_DateMMDDYYYY)
  PureLVSORT_SortListIconNow(0, 1, -1)
EndIf
;
Repeat
  Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
End
;{ Icons
DataSection
  IconArrowUp:
  Data.l $04C64D42,$00000000,$04360000,$00280000,$000C0000,$000C0000,$00010000,$00000008,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$C6C60000,$C8C800C6,$CECE00C8,$DEDE00CE,$EFEF00DE,$FFFF00EF,$000000FF,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$06000000,$06060606,$06060606,$06000006
  Data.l $00060606,$06060600,$06000006,$00060606,$06060600,$06000006,$00060606,$06060600,$06000006,$00060606,$06060600,$06000006
  Data.l $00000000,$00000000,$06000006,$00000006,$06000000,$06000006,$00000606,$06060000,$06000006,$00060606,$06060600,$06000006
  Data.l $06060606,$06060606,$00000006,$00000000,$00000000
  Data.b $00,$00
  IconArrowDown:
  Data.l $04C64D42,$00000000,$04360000,$00280000,$000C0000,$000C0000,$00010000,$00000008,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$C6C60000,$C8C800C6,$CECE00C8,$DEDE00CE,$EFEF00DE,$FFFF00EF,$000000FF,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$06000000,$06060606,$06060606,$06000006
  Data.l $00060606,$06060600,$06000006,$00000606,$06060000,$06000006,$00000006,$06000000,$06000006,$00000000,$00000000,$06000006
  Data.l $00060606,$06060600,$06000006,$00060606,$06060600,$06000006,$00060606,$06060600,$06000006,$00060606,$06060600,$06000006
  Data.l $06060606,$06060606,$00000006,$00000000,$00000000
  Data.b $00,$00
EndDataSection ;}

_________________
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Tue Jul 20, 2010 12:24 pm 
Offline
PureBasic Protozoa
PureBasic Protozoa
User avatar

Joined: Fri Apr 25, 2003 3:08 pm
Posts: 2580
Yes, I can see that your ways works, mine doesn't for some reason. The below are my constants for my ListIcon and sorting images and the way I load them

Code:
Enumeration #ImageIndex
  #Image_picsender_album          ; Anormal.i     family16x16.ico                       ; Normal address icon
  #Image_picsender_photos         ; Acustom.i     custom16x16.ico                       ; Custom address icon
  #Image_picsender_sortup                                                               ; sorting up
  #Image_picsender_sortdown                                                             ; sorting down
EndEnumeration

CatchImage(#Image_picsender_sortup,    ?_PTK_picsender_sortup)                          ; sorting up
CatchImage(#Image_picsender_sortdown,  ?_PTK_picsender_sortdown)                        ; sorting down
CatchImage(#Image_picsender_album,     ?_PTK_picsender_album)                           ; family16x16.ico           Normal address icon
CatchImage(#Image_picsender_photos,    ?_PTK_picsender_photos)                          ; custom16x16.ico           Custom address icon

DataSection
  _PTK_picsender_sortup     : IncludeBinary "Images\sortup12x12.ico"                    ;
  _PTK_picsender_sortdown   : IncludeBinary "Images\sortdown12x12.ico"                  ;

  _PTK_picsender_album      : IncludeBinary "Images\address16x16.ico"                   ;
  _PTK_picsender_photos     : IncludeBinary "Images\camera16x16.ico"                    ;
EndDataSection



Then in the main body of code I do the following:

Code:
  PureLVSORT_SetUserIcons(ImageID(#Image_picsender_sortup), ImageID(#Image_picsender_sortdown))

; ListIcon Sort Setup

  If PureLVSORT_SelectGadgetToSort(#Gadget_picsender_maillist, #PureLVSORT_ShowClickedHeader_IconLeft) = #PureLVSORT_Ok
    PureLVSORT_SetColumnType(#Gadget_picsender_maillist,     0, #PureLVSORT_String)
    PureLVSORT_SetColumnType(#Gadget_picsender_maillist,     1, #PureLVSORT_String)
    PureLVSORT_SortListIconNow(#Gadget_picsender_maillist, 0, 1)
  EndIf


And the header buttons always vanish if I add items to a ListIcon with image. By the way, "Enumeration #ImageIndex" is a continuation of the visual designer last used image index it created and I know the icons work.

_________________
http://members.westnet.com.au/bangfeast/


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Tue Jul 20, 2010 12:37 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 3769
Location: Strasbourg / France
Fangbeast wrote:
Yes, I can see that your ways works, mine doesn't for some reason. The below are my constants for my ListIcon and sorting images and the way I load them
I don't see any obvious problem in your posted code.
I need a small working snippet that demonstrates the issue.

_________________
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Tue Jul 20, 2010 1:49 pm 
Offline
PureBasic Protozoa
PureBasic Protozoa
User avatar

Joined: Fri Apr 25, 2003 3:08 pm
Posts: 2580
gnozal wrote:
Fangbeast wrote:
Yes, I can see that your ways works, mine doesn't for some reason. The below are my constants for my ListIcon and sorting images and the way I load them
I don't see any obvious problem in your posted code.
I need a small working snippet that demonstrates the issue.


Maybe the enumeration is the issue (the way I am doing it) and the icon numbers clash somewhere.

I bet if I cut out a snippet, it will probably work (LOL!). I am due to post this project shortly as it is public and see how I can cut something out of it. Thanks Gnozal.

_________________
http://members.westnet.com.au/bangfeast/


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 320 posts ]  Go to page Previous  1 ... 18, 19, 20, 21, 22

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye