ExplorerTreeGadget highlight too light?

Just starting out? Need help? Post your questions and find answers here.
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4749
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

ExplorerTreeGadget highlight too light?

Post by Fangbeast »

I have an ExplorerTreeGadget set to populate a ListIconGadget with files when a selection is clicked but the focus switches to the ListIconGadget to show file info and then the highlight on the ExplorerTreeGadget is so light that I can barely see it.

Is there a way to customise this already heavily ownerdrawn gadget to make the highlight stay darker when not in focus?
Amateur Radio, D-STAR/VK3HAF
User avatar
RSBasic
Moderator
Moderator
Posts: 1218
Joined: Thu Dec 31, 2009 11:05 pm
Location: Gernsbach (Germany)
Contact:

Re: ExplorerTreeGadget highlight too light?

Post by RSBasic »

You can alternatively create a custom highlight line: viewtopic.php?p=419247#p419247
Image
Image
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4663
Joined: Sun Apr 12, 2009 6:27 am

Re: ExplorerTreeGadget highlight too light?

Post by RASHAD »

Hi Fang
Need more to do

Code: Select all

Global lpis.TVITEM,text$,item.RECT,gr.RECT

  lpis\mask =  #TVIF_TEXT
  lpis\cchTextMax = #MAX_PATH
  text$ = Space(#MAX_PATH)
  lpis\pszText = @text$
  
If OpenWindow(0,0,0,600,400,"ExplorerTreeGadget", #PB_Window_SystemMenu|#PB_Window_ScreenCentered)    
  SmartWindowRefresh(0,1)
  LoadFont(0,"Tahoma",12)    
  SetGadgetFont(#PB_Default,FontID(0))
  dummy = TextGadget(#PB_Any,0,0,0,0,"",#WS_BORDER)
  SetGadgetColor(dummy, #PB_Gadget_BackColor, GetSysColor_(#COLOR_HIGHLIGHT))
  SetGadgetColor(dummy, #PB_Gadget_FrontColor, GetSysColor_(#COLOR_HIGHLIGHTTEXT))
  
  ExplorerTreeGadget(0, 10, 10, 200, 340, "*.*")
  SetWindowLongPtr_(GadgetID(0), #GWL_STYLE, GetWindowLongPtr_(GadgetID(0), #GWL_STYLE) | #WS_CLIPSIBLINGS)
  ExplorerListGadget(1, 220, 10, 370, 340, "*.*",#PB_Explorer_NoFolders|#PB_Explorer_NoParentFolder| #PB_Explorer_AlwaysShowSelection )
  SetWindowLongPtr_(GadgetID(1), #GWL_STYLE, GetWindowLongPtr_(GadgetID(1), #GWL_STYLE) | #WS_CLIPSIBLINGS)
  
  SetGadgetColor(0, #PB_Gadget_BackColor,$C9C9C9)
  SetGadgetColor(1, #PB_Gadget_BackColor,$D4FFFE)
Repeat
  Select WaitWindowEvent(1)
    Case #PB_Event_CloseWindow 
      Quit = 1
      
    Case #WM_NCMOUSEMOVE
      Scroller = SendMessage_(GadgetID(0), #WM_NCHITTEST, 0, DesktopMouseY()<<16 + DesktopMouseX())
      Select Scroller
        Case #HTHSCROLL,#HTVSCROLL
          ResizeGadget(dummy,0,0,0,0)
          SetActiveGadget(0)
      EndSelect
      
    Case  #PB_Event_Gadget 
      Select EventGadget() 
        Case 0
          SetGadgetText(1,GetGadgetText(0)+"*.*")
          item\left = SendMessage_(GadgetID(0), #TVM_GETNEXTITEM,#TVGN_CARET, 0)          
          itemh = item\left          
          lpis\hItem = itemh
          SendMessage_(GadgetID(0), #TVM_GETITEM, 0, @lpis)
          ResizeGadget(dummy,0,0,0,0)
          GetWindowRect_(GadgetID(0),gr.RECT)          
          
        Case 1
          item\left = itemh
          SendMessage_(GadgetID(0), #TVM_GETITEMRECT, 1, @item)        
          If item\right > (gr\right-gr\left)
            ResizeGadget(dummy,item\left+12,item\top+12,gr\right-gr\left-item\left-20,item\bottom-item\top)
          Else
            ResizeGadget(dummy,item\left+12,item\top+12, item\right-item\left,item\bottom-item\top)
          EndIf          
          SetGadgetText(dummy,text$)
          If EventType() = #PB_EventType_LeftDoubleClick 
            ShellExecute_(0,"open",GetGadgetText(1)+ GetGadgetItemText(1, GetGadgetState(1) ,0),0,0,1) 
          EndIf
      EndSelect
  EndSelect 
Until Quit = 1 
EndIf 
Edit :Almost there
Egypt my love
Post Reply