It is currently Mon Nov 30, 2020 5:18 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Change blue tabs when adding files to a project?
PostPosted: Thu Oct 22, 2020 7:55 am 
Offline
User
User

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


Top
 Profile  
Reply with quote  
 Post subject: Re: Change blue tabs when adding files to a project?
PostPosted: Thu Oct 22, 2020 8:26 am 
Offline
User
User

Joined: Sat Jun 22, 2013 4:06 pm
Posts: 21
Location: Coutances FRANCE
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


Top
 Profile  
Reply with quote  
 Post subject: Re: Change blue tabs when adding files to a project?
PostPosted: Fri Oct 23, 2020 12:30 am 
Offline
User
User

Joined: Thu Oct 22, 2020 7:01 am
Posts: 20
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: Change blue tabs when adding files to a project?
PostPosted: Fri Oct 23, 2020 1:50 am 
Offline
Addict
Addict
User avatar

Joined: Tue Dec 23, 2003 3:54 am
Posts: 1863
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

_________________
On GitHub: PB Includes - IDE Tools - Color Themes - IDE Branches - TabBarGadget Mods


Top
 Profile  
Reply with quote  
 Post subject: Re: Change blue tabs when adding files to a project?
PostPosted: Fri Oct 23, 2020 4:07 am 
Offline
User
User

Joined: Thu Oct 22, 2020 7:01 am
Posts: 20
Aaah many thanks! I will do that :)


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

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 5 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