PureBasic Forum
http://forums.purebasic.com/english/

Change blue tabs when adding files to a project?
http://forums.purebasic.com/english/viewtopic.php?f=18&t=76134
Page 1 of 1

Author:  Josepho [ Thu Oct 22, 2020 7:55 am ]
Post subject:  Change blue tabs when adding files to a project?

Hello Im a bit new around here, i have been searching about this but i didnt found any response.

Basically i would like to know if there is any way to change the color of the tabs when you add files to a project as right now its a bit annoying for me that color combination

Image

Author:  Micoute [ Thu Oct 22, 2020 8:26 am ]
Post subject:  Re: Change blue tabs when adding files to a project?

Code:
Enumeration
  #uxTheme
  #MainForm
  #Panel
  #Wrapper1
  #Wrapper2
  #Option
  #Check
  #AnotherCheck
  #Combo
EndEnumeration

Global WindowColor.i, TabPanelBackGroundColor, TabPanelColor.i

WindowColor=RGB(215, 251, 190)
TabPanelBackGroundColor = CreateSolidBrush_($B2FCFD)
TabPanelColor = RGB(0, 0, 0)

Procedure WindowCallback(WindowID, Message, wParam, lParam)
 
  Result = #PB_ProcessPureBasicEvents   
 
  Select Message       
     
    ;Coloration des onglets
    Case #WM_DRAWITEM
      *PGdis.DRAWITEMSTRUCT = lParam
      If *PGdis\CtlType = #ODT_TAB
        Select *PGdis\itemID
          Case 0, 1 
            tabText$ = GetGadgetItemText(#Panel, *PGdis\itemID, 0)
            FillRect_(*PGdis\hdc, *PGdis\rcItem, TabPanelBackGroundColor)
            SetTextColor_(*PGdis\hdc, TabPanelColor)
            SetBkMode_(*PGdis\hdc, #TRANSPARENT)
            DrawText_(*PGdis\hdc, tabText$, Len(tabText$), *PGdis\rcItem, #DT_CENTER | #DT_SINGLELINE | #DT_VCENTER | #DT_NOCLIP)       
        EndSelect
       
      EndIf
     
    ;Coloration des CheckBoxGadget et OptionGadget
    Case #WM_CTLCOLORSTATIC
        Select lparam
          Case GadgetID(#Option), GadgetID(#Check), GadgetID(#AnotherCheck)
            SetBkMode_(wParam,#TRANSPARENT)
            SetTextColor_(wParam, $0862F7)
            Result = TabPanelBackGroundColor             

        EndSelect                                 
    EndSelect
  ProcedureReturn Result
EndProcedure

;/
;/ Désactivation du théme XP pour un gadget
;
Procedure DisableGadgetXPTheme(Gadget.i)
    If OSVersion() >= #PB_OS_Windows_XP
    If OpenLibrary(#uxTheme, "uxtheme.dll")
      CallFunction(#uxTheme, "SetWindowTheme", GadgetID(Gadget), @null.w, @null.w)
      CloseLibrary(0)
    EndIf
  EndIf
EndProcedure

;
;/ Fenetre principale
;/
Procedure MainformShow()
  SetGadgetFont(#PB_Default,FontID(LoadFont(#PB_Any,"Arial",10)))
  If OpenWindow(#Mainform, 422, 335, 400, 225, "Test", #PB_Window_SystemMenu)
   
    SetWindowColor(#MainForm, WindowColor)
   
    PanelGadget(#Panel, 10, 20, 380, 180)   
   
    AddGadgetItem(#Panel, -1, "Onglet 1")
    TextGadget(#Wrapper1, 0,0,380,180,"")
    SetGadgetColor(#Wrapper1, #PB_Gadget_BackColor, $B2FCFD)
    OptionGadget(#Option, 35, 25, 230, 20, "Gadget Option")
    CheckBoxGadget(#Check, 35, 50, 230, 20, "Gadget à cocher")
   
    AddGadgetItem(#Panel, -1, "Onglet 2")
    TextGadget(#Wrapper2, 0,0,3800,180,"")
    SetGadgetColor(#Wrapper2, #PB_Gadget_BackColor, $B2FCFD)
    CheckBoxGadget(#AnotherCheck,20,20,200,20, "Un autre cochage")
    ComboBoxGadget(#Combo, 20, 50, 200, 20)
   
   
    CloseGadgetList()
  EndIf
 
  ;Desactivation du théme XP
  DisableGadgetXPTheme(#panel)
 
  ;Transparence des onglets
  SetWindowLong_(GadgetID(#Panel), #GWL_STYLE, GetWindowLong_(GadgetID(#Panel), #GWL_STYLE) | #TCS_OWNERDRAWFIXED)
 
  ;Coloration de l'arriere plan du panelgadget
  color=CreateSolidBrush_(WindowColor)
  SetClassLong_(GadgetID(#Panel), #GCL_HBRBACKGROUND, color)
 
  ;Le callback s'occupe du reste
  ; Coloration su system d'onglet
  ; Coloration des CheckBoxGadget et OptionGadget par exemple
  SetWindowCallback(@WindowCallback())
EndProcedure

MainFormShow()

Repeat
  Select WaitWindowEvent()
    Case #PB_Event_Gadget

    Case #PB_Event_CloseWindow
      End
  EndSelect
ForEver

Author:  Josepho [ Fri Oct 23, 2020 12:30 am ]
Post subject:  Re: Change blue tabs when adding files to a project?

Many thanks for your fast reply, unfortunately i think i dont understant what i m supposed to do with that code. The coloring that is bothering me its in the purebasic ide itself not in a program I made.

Author:  kenmo [ Fri Oct 23, 2020 1:50 am ]
Post subject:  Re: Change blue tabs when adding files to a project?

Hi Josepho,

That hard-to-read black-on-blue just appeared in the last release, among some color changes to the MacOS IDE.

It's already been reverted for the next release...

If it bothers you too much, you can download and use the 5.71 IDE, or you can even build the IDE from its latest source.


The IDE is open source, written in PB itself:
https://github.com/fantaisie-software/purebasic


Here is the Pull Request to revert the color:
https://github.com/fantaisie-software/purebasic/pull/96

Author:  Josepho [ Fri Oct 23, 2020 4:07 am ]
Post subject:  Re: Change blue tabs when adding files to a project?

Aaah many thanks! I will do that :)

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/