It is currently Wed Oct 17, 2018 3:06 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: TreeGadget with Checkboxes and images
PostPosted: Sun Jun 03, 2018 10:38 pm 
Offline
Enthusiast
Enthusiast

Joined: Thu Dec 29, 2011 5:03 pm
Posts: 282
This is a minor issue (if it's really an issue at all :lol:), but when a TreeGadget has images and checkboxes, the checkbox and image are squashed right next to each other with no space between them. Is it possible to add a couple of pixels?


Top
 Profile  
Reply with quote  
 Post subject: Re: TreeGadget with Checkboxes and images
PostPosted: Mon Jun 04, 2018 2:30 am 
Offline
Addict
Addict

Joined: Sun Apr 12, 2009 6:27 am
Posts: 3093
Hi
Code:
UsePNGImageDecoder()

LoadImage(0, #PB_Compiler_Home + "examples/sources/Data/ToolBar/New.png")
LoadImage(1, #PB_Compiler_Home + "examples/sources/Data/ToolBar/Open.png")
LoadImage(2, #PB_Compiler_Home + "examples/sources/Data/ToolBar/Save.png")

If OpenWindow(0,0,0,500,250,"Window",#PB_Window_SystemMenu |#PB_Window_ScreenCentered)
  TreeGadget(0,10,10,480,230,#PB_Tree_CheckBoxes)
 
  CreateImage(10,22,16,32,#PB_Image_Transparent )
 
  NewImageList = ImageList_Create_(22,16, #ILC_COLOR32 | #ILC_MASK, 0, 10)
  StartDrawing(ImageOutput(10))
    DrawingMode(#PB_2DDrawing_AllChannels)
    DrawImage(ImageID(0),6,0,16,16)   ; 6 = 22 - 16
  StopDrawing()
  ImageList_Add_(NewImageList,ImageID(10),0)
  StartDrawing(ImageOutput(10))
    DrawImage(ImageID(1),6,0,16,16)
  StopDrawing()
  ImageList_Add_(NewImageList,ImageID(10),0)
  StartDrawing(ImageOutput(10))
    DrawImage(ImageID(2),6,0,16,16)
  StopDrawing()
  ImageList_Add_(NewImageList,ImageID(10),0)
 
  FreeImage(10)
 
  AddGadgetItem(0,-1,"Test-Item #1",0,0)
  AddGadgetItem(0,-1,"Test-Item #2",ImageID(1),1)
  AddGadgetItem(0,-1,"Test-Item #3",ImageID(2),0)
 
  SendMessage_(GadgetID(0), #TVM_SETIMAGELIST, #TVSIL_NORMAL, NewImageList)
 
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf

_________________
Egypt my love


Top
 Profile  
Reply with quote  
 Post subject: Re: TreeGadget with Checkboxes and images
PostPosted: Mon Jun 04, 2018 8:03 am 
Online
Addict
Addict
User avatar

Joined: Sun Nov 05, 2006 11:42 pm
Posts: 4276
Location: Lyon - France
Hello wombats and RASHAD :D

Thanks for this code RASHAD 8)
Just for information, if i not enable XP theme, the space between image and checkbox are black :|

_________________
ImageThe happiness is a road...
Not a destination


Top
 Profile  
Reply with quote  
 Post subject: Re: TreeGadget with Checkboxes and images
PostPosted: Mon Jun 04, 2018 8:40 am 
Offline
Addict
Addict

Joined: Sun Apr 12, 2009 6:27 am
Posts: 3093
Hi KCC
Change to
Code:
  CreateImage(10,22,16,24,$FFFFFF)
 
  NewImageList = ImageList_Create_(22,16, #ILC_COLOR32 | #ILC_MASK, 0, 10)
  StartDrawing(ImageOutput(10))
    ;DrawingMode(#PB_2DDrawing_AllChannels)
    DrawImage(ImageID(0),6,0,16,16)   ; 6 = 22 - 16
  StopDrawing()

_________________
Egypt my love


Top
 Profile  
Reply with quote  
 Post subject: Re: TreeGadget with Checkboxes and images
PostPosted: Mon Jun 04, 2018 9:20 am 
Offline
Addict
Addict

Joined: Mon Feb 16, 2015 2:49 pm
Posts: 1565
RASHAD wrote:
Hi

I love how Rashad comes in, says "Hi", posts some code like Santa Claus on Christmas morning, and then leaves. :D

Bless you, Rashad. You've helped so many coders, so many times. You rock! 8)


Top
 Profile  
Reply with quote  
 Post subject: Re: TreeGadget with Checkboxes and images
PostPosted: Mon Jun 04, 2018 6:00 pm 
Online
Addict
Addict
User avatar

Joined: Sun Nov 05, 2006 11:42 pm
Posts: 4276
Location: Lyon - France
SupeRashMan wrote:
Hi KCC
Change to

Yeeees !!!!! PERFECT !!!!

Dude wrote:
Bless you, Rashad. You've helped so many coders, so many times. You rock!
It's the reason why RASHAD is one of my heroes, since a long time !!!!

Image

RASHAD is the first egyptian, also big than the pyramids 8)

ImageImageImage

_________________
ImageThe happiness is a road...
Not a destination


Top
 Profile  
Reply with quote  
 Post subject: Re: TreeGadget with Checkboxes and images
PostPosted: Mon Jun 04, 2018 9:10 pm 
Offline
Enthusiast
Enthusiast

Joined: Thu Dec 29, 2011 5:03 pm
Posts: 282
Thank you, RASHAD! Wonderful code as always.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 4 guests


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