Change blue tabs when adding files to a project?

Working on new editor enhancements?
Josepho
User
User
Posts: 65
Joined: Thu Oct 22, 2020 7:01 am

Change blue tabs when adding files to a project?

Post by Josepho »

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
Micoute
User
User
Posts: 24
Joined: Sat Jun 22, 2013 4:06 pm
Location: La Mézière FRANCE

Re: Change blue tabs when adding files to a project?

Post by Micoute »

Code: Select all

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
Josepho
User
User
Posts: 65
Joined: Thu Oct 22, 2020 7:01 am

Re: Change blue tabs when adding files to a project?

Post by Josepho »

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.
User avatar
kenmo
Addict
Addict
Posts: 1967
Joined: Tue Dec 23, 2003 3:54 am

Re: Change blue tabs when adding files to a project?

Post by kenmo »

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
Josepho
User
User
Posts: 65
Joined: Thu Oct 22, 2020 7:01 am

Re: Change blue tabs when adding files to a project?

Post by Josepho »

Aaah many thanks! I will do that :)
Post Reply