X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/00e086a7f09c2a2e00a3ee0ca57e338ed608c88f..6eae1f7d48196dea9968c8e478f28a4166bd0fe9:/src/univ/themes/win32.cpp diff --git a/src/univ/themes/win32.cpp b/src/univ/themes/win32.cpp index af2f0c4a28..ed3e0f8d58 100644 --- a/src/univ/themes/win32.cpp +++ b/src/univ/themes/win32.cpp @@ -33,6 +33,7 @@ #include "wx/dcmemory.h" #include "wx/button.h" + #include "wx/bmpbuttn.h" #include "wx/listbox.h" #include "wx/checklst.h" #include "wx/combobox.h" @@ -110,6 +111,7 @@ enum IndicatorStatus { IndicatorStatus_Checked, IndicatorStatus_Unchecked, + IndicatorStatus_Undeterminated, IndicatorStatus_Max }; @@ -134,8 +136,8 @@ public: Arrow_Normal, Arrow_Disabled, Arrow_Pressed, - Arrow_Inversed, - Arrow_InversedDisabled, + Arrow_Inverted, + Arrow_InvertedDisabled, Arrow_StateMax }; @@ -1009,6 +1011,54 @@ static const char *unchecked_item_xpm[] = { "wwwwwwwwwwwww" }; +static const char *undetermined_xpm[] = { +/* columns rows colors chars-per-pixel */ +"13 13 5 1", +"A c #030303", +"B c #838383", +"C c #C3C3C3", +"D c #FBFBFB", +"E c #DBDBDB", +/* pixels */ +"BBBBBBBBBBBBD", +"BAAAAAAAAAAED", +"BACDCDCDCDCED", +"BADCDCDCDBDED", +"BACDCDCDBBCED", +"BADBDCEBBBDED", +"BACBBDBBBDCED", +"BADBBBBBDCDED", +"BACDBBBDCDCED", +"BADCDBDCDCDED", +"BACDCDCDCDCED", +"BEEEEEEEEEEED", +"DDDDDDDDDDDDD" +}; + +static const char *pressed_undetermined_xpm[] = { +/* columns rows colors chars-per-pixel */ +"13 13 5 1", +"A c #040404", +"B c #848484", +"C c #C4C4C4", +"D c #FCFCFC", +"E c #DCDCDC", +/* pixels */ +"BBBBBBBBBBBBD", +"BAAAAAAAAAAED", +"BACCCCCCCCCCD", +"BACCCCCCCACED", +"BACCCCCCAACED", +"BACACCCAAACED", +"BACAACAAACCED", +"BACAAAAACCCED", +"BACCAAACCCCCD", +"BACCCACCCCCED", +"BACCCCCCCCCED", +"BEEEEEEEEEEED", +"DDDDDDDDDDDDD" +}; + static const char *checked_radio_xpm[] = { /* columns rows colors chars-per-pixel */ "12 12 6 1", @@ -1135,40 +1185,40 @@ static const char ** // checkboxes first { // normal state - { checked_xpm, unchecked_xpm }, + { checked_xpm, unchecked_xpm, undetermined_xpm }, // pressed state - { pressed_checked_xpm, pressed_unchecked_xpm }, + { pressed_checked_xpm, pressed_unchecked_xpm, pressed_undetermined_xpm }, // disabled state - { pressed_disabled_checked_xpm, pressed_unchecked_xpm }, + { pressed_disabled_checked_xpm, pressed_unchecked_xpm, pressed_disabled_checked_xpm }, }, // radio { // normal state - { checked_radio_xpm, unchecked_radio_xpm }, + { checked_radio_xpm, unchecked_radio_xpm, NULL }, // pressed state - { pressed_checked_radio_xpm, pressed_unchecked_radio_xpm }, + { pressed_checked_radio_xpm, pressed_unchecked_radio_xpm, NULL }, // disabled state - { pressed_disabled_checked_radio_xpm, pressed_unchecked_radio_xpm }, + { pressed_disabled_checked_radio_xpm, pressed_unchecked_radio_xpm, NULL }, }, // menu { // normal state - { checked_menu_xpm, NULL }, + { checked_menu_xpm, NULL, NULL }, // selected state - { selected_checked_menu_xpm, NULL }, + { selected_checked_menu_xpm, NULL, NULL }, // disabled state - { disabled_checked_menu_xpm, NULL }, + { disabled_checked_menu_xpm, NULL, NULL }, // disabled selected state - { selected_disabled_checked_menu_xpm, NULL }, + { selected_disabled_checked_menu_xpm, NULL, NULL }, } }; @@ -1627,31 +1677,31 @@ wxWin32Renderer::wxWin32Renderer(const wxColourScheme *scheme) } - // create the inversed bitmap but only for the right arrow as we only + // create the inverted bitmap but only for the right arrow as we only // use it for the menus if ( n == Arrow_Right ) { - m_bmpArrows[Arrow_Inversed][n].Create(w, h); - dcInverse.SelectObject(m_bmpArrows[Arrow_Inversed][n]); + m_bmpArrows[Arrow_Inverted][n].Create(w, h); + dcInverse.SelectObject(m_bmpArrows[Arrow_Inverted][n]); dcInverse.Clear(); dcInverse.Blit(0, 0, w, h, &dcNormal, 0, 0, wxXOR); dcInverse.SelectObject(wxNullBitmap); - mask = new wxMask(m_bmpArrows[Arrow_Inversed][n], *wxBLACK); - m_bmpArrows[Arrow_Inversed][n].SetMask(mask); + mask = new wxMask(m_bmpArrows[Arrow_Inverted][n], *wxBLACK); + m_bmpArrows[Arrow_Inverted][n].SetMask(mask); - m_bmpArrows[Arrow_InversedDisabled][n].Create(w, h); - dcInverse.SelectObject(m_bmpArrows[Arrow_InversedDisabled][n]); + m_bmpArrows[Arrow_InvertedDisabled][n].Create(w, h); + dcInverse.SelectObject(m_bmpArrows[Arrow_InvertedDisabled][n]); dcInverse.Clear(); dcInverse.Blit(0, 0, w, h, &dcDisabled, 0, 0, wxXOR); dcInverse.SelectObject(wxNullBitmap); - mask = new wxMask(m_bmpArrows[Arrow_InversedDisabled][n], *wxBLACK); - m_bmpArrows[Arrow_InversedDisabled][n].SetMask(mask); + mask = new wxMask(m_bmpArrows[Arrow_InvertedDisabled][n], *wxBLACK); + m_bmpArrows[Arrow_InvertedDisabled][n].SetMask(mask); } dcNormal.SelectObject(wxNullBitmap); @@ -2315,7 +2365,9 @@ wxBitmap wxWin32Renderer::GetIndicator(IndicatorType indType, int flags) IndicatorStatus indStatus = flags & wxCONTROL_CHECKED ? IndicatorStatus_Checked - : IndicatorStatus_Unchecked; + : ( flags & wxCONTROL_UNDETERMINED + ? IndicatorStatus_Undeterminated + : IndicatorStatus_Unchecked ); wxBitmap bmp = m_bmpIndicators[indType][indState][indStatus]; if ( !bmp.Ok() ) @@ -2503,9 +2555,8 @@ void wxWin32Renderer::DrawTab(wxDC& dc, const wxSize indent = GetTabIndent(); if ( flags & wxCONTROL_SELECTED ) { - rect.Inflate( isVertical ? 0 : indent.x, - isVertical ? indent.y : 0 - ); + rect.Inflate( SELECT_FOR_VERTICAL( indent.x , 0), + SELECT_FOR_VERTICAL( 0, indent.y )); switch ( dir ) { default: @@ -2792,7 +2843,7 @@ void wxWin32Renderer::DrawSliderThumb(wxDC& dc, H D B H D B H D B - H D B where H is hightlight colour + H D B where H is highlight colour H D B D dark grey H D B B black H D B @@ -3146,10 +3197,10 @@ void wxWin32Renderer::DrawMenuItem(wxDC& dc, wxArrowStyle arrowStyle; if ( flags & wxCONTROL_DISABLED ) - arrowStyle = flags & wxCONTROL_SELECTED ? Arrow_InversedDisabled + arrowStyle = flags & wxCONTROL_SELECTED ? Arrow_InvertedDisabled : Arrow_Disabled; else if ( flags & wxCONTROL_SELECTED ) - arrowStyle = Arrow_Inversed; + arrowStyle = Arrow_Inverted; else arrowStyle = Arrow_Normal; @@ -3881,7 +3932,7 @@ wxSize wxWin32Renderer::GetFrameTotalSize(const wxSize& clientSize, wxSize wxWin32Renderer::GetFrameMinSize(int flags) const { - wxSize s(0, 0); + wxSize s; if ( (flags & wxTOPLEVEL_BORDER) && !(flags & wxTOPLEVEL_MAXIMIZED) ) { @@ -3923,168 +3974,274 @@ wxSize wxWin32Renderer::GetFrameIconSize() const // standard icons // ---------------------------------------------------------------------------- +/* Copyright (c) Julian Smart */ static char *error_xpm[]={ -"32 32 5 1", -". c None", -"# c #800000", -"b c #808080", -"a c #ff0000", -"c c #ffffff", -"...........########.............", -"........###aaaaaaaa###..........", -".......#aaaaaaaaaaaaaa#.........", -".....##aaaaaaaaaaaaaaaa##.......", -"....#aaaaaaaaaaaaaaaaaaaa#......", -"...#aaaaaaaaaaaaaaaaaaaaaa#.....", -"...#aaaaaaaaaaaaaaaaaaaaaa#b....", -"..#aaaaaacaaaaaaaaaacaaaaaa#b...", -".#aaaaaacccaaaaaaaacccaaaaaa#...", -".#aaaaacccccaaaaaacccccaaaaa#b..", -".#aaaaaacccccaaaacccccaaaaaa#bb.", -"#aaaaaaaacccccaacccccaaaaaaaa#b.", -"#aaaaaaaaaccccccccccaaaaaaaaa#b.", -"#aaaaaaaaaaccccccccaaaaaaaaaa#bb", -"#aaaaaaaaaaaccccccaaaaaaaaaaa#bb", -"#aaaaaaaaaaaccccccaaaaaaaaaaa#bb", -"#aaaaaaaaaaccccccccaaaaaaaaaa#bb", -"#aaaaaaaaaccccccccccaaaaaaaaa#bb", -"#aaaaaaaacccccaacccccaaaaaaaa#bb", -".#aaaaaacccccaaaacccccaaaaaa#bbb", -".#aaaaacccccaaaaaacccccaaaaa#bbb", -".#aaaaaacccaaaaaaaacccaaaaaa#bb.", -"..#aaaaaacaaaaaaaaaacaaaaaa#bbb.", -"...#aaaaaaaaaaaaaaaaaaaaaa#bbbb.", -"...#aaaaaaaaaaaaaaaaaaaaaa#bbb..", -"....#aaaaaaaaaaaaaaaaaaaa#bbb...", -".....##aaaaaaaaaaaaaaaa##bbbb...", -"......b#aaaaaaaaaaaaaa#bbbbb....", -".......b###aaaaaaaa###bbbbb.....", -".........bb########bbbbbb.......", -"..........bbbbbbbbbbbbbb........", -".............bbbbbbbb..........."}; +/* columns rows colors chars-per-pixel */ +"32 32 70 1", +"- c #BF0101", +"b c #361F1F", +"& c #C08484", +"X c #BF3333", +"# c #C08181", +"% c #C01111", +"d c #C51515", +"s c #551818", +"O c #C07E7E", +": c #C00E0E", +"u c #E28A8A", +"2 c #C81F1F", +"8 c #FFFFFF", +"p c #E59494", +"< c #BB0101", +"y c #DA6A6A", +"A c #4C4C4C", +"9 c #F7DFDF", +"@ c #BF5353", +"w c #FAE9E9", +"F c #272727", +"5 c #D24A4A", +". c #C06363", +"n c #BF8282", +"7 c #F2C9C9", +"t c #C09292", +"M c #3E3E3E", +"x c #4D4D4D", +"4 c #CA2A2A", +"h c #E79F9F", +"* c #C05454", +"D c #711212", +"V c #737373", +"$ c #BF3232", +"N c #900B0B", +"6 c #BD0303", +"3 c #DF7F7F", +"K c #6F1212", +"C c #BD0000", +"m c #950909", +"P c #8A8A8A", +"j c #D75F5F", +" c None", +"e c #F4D4D4", +"S c #BF2020", +"L c #747474", +"G c #842C2C", +"c c #ECB4B4", +"l c #2E2121", +"g c #BF7E7E", +"k c #9B0808", +"= c #BF0505", +"a c #B10303", +"q c #7E2020", +"1 c #642222", +"J c #676767", +"B c #322020", +"; c #C00303", +"i c #242424", +"o c #C00000", +"> c #BF1F1F", +", c #842B2B", +"f c #701212", +"0 c #BE0000", +"r c #960909", +"H c #686868", +"v c #BC0000", +"Z c #671414", +"+ c #C02020", +"z c #CD3535", +/* pixels */ +" ", +" ", +" .XoooOO ", +" .+ooooooooo@# ", +" $oooooooooooo%& ", +" *=-ooooooooooooo;: ", +" *oooooooooooooooooo> ", +" =ooooooooooooooooooo, ", +" $-ooooooooooooooooooo<1 ", +" .oooooo2334ooo533oooooo6 ", +" +ooooooo789oo2883oooooo0q ", +" oooooooo2w83o78eoooooooor ", +" toooooooooy88u884oooooooori ", +" Xooooooooooe888poooooooooas ", +" ooooooooooo4889doooooooooof ", +" ooooooooooo588w2oooooooooofi ", +" oooooooooodw8887oooooooooofi ", +" goooooooooh8w588jooooooookli ", +" tooooooooz885op8wdooooooorix ", +" oooooood98cood98cooooooori ", +" @oooooop8w2ooo5885ooooovbi ", +" n%ooooooooooooooooooooomiM ", +" &;oooooooooooooooooooNBiV ", +" :ooooooooooooooooooCZiA ", +" nSooooooooooooooooCDiF ", +" nG c #2D32F5", +"o c #CBCCFD", +"# c #0309F3", +"@ c #8C8FFA", +"$ c #EAEBFE", +/* pixels */ +" ....... ", +" ...XXXXXXX... ", +" ..XXXXXXXXXXXXX.. ", +" .XXXXXXXXXXXXXXXXX. ", +" .XXXXXXXXoO+XXXXXXXX. ", +" .XXXXXXXXX@#OXXXXXXXXX. ", +" .XXXXXXXXXX$@oXXXXXXXXXX. ", +" .XXXXXXXXXXXXXXXXXXXXXXX.% ", +" .XXXXXXXXX&*=-XXXXXXXXXX.%% ", +".XXXXXXXXXX;:#>XXXXXXXXXXX.% ", +".XXXXXXXXXXX;#+XXXXXXXXXXX.% ", +".XXXXXXXXXXX;#+XXXXXXXXXXX.%% ", +" .XXXXXXXXXX;#+XXXXXXXXXX.%%% ", +" .XXXXXXXXXX;#+XXXXXXXXXX.%%% ", +" .XXXXXXXXXX;#+XXXXXXXXXX.%% ", +" .XXXXXXXX*-##+XXXXXXXX.%%% ", +" .XXXXXXXXXXXXXXXXXXX.%%%% ", +" .XXXXXXXXXXXXXXXXX.%%%% ", +" ..XXXXXXXXXXXXX..%%%% ", +" %...XXXXXXXX..%%%%% ", +" %%%..XXXXXX.%%%%% ", +" %%%.XXXXX.%%% ", +" %.XXXX.%% ", +" .XXX.%% ", +" .XX.%% ", +" .X.%% ", +" ..%% ", +" .%% ", +" %% ", +" % ", +" ", +" " +}; +/* Copyright (c) Julian Smart */ static char *question_xpm[]={ -"32 32 6 1", -". c None", -"c c #000000", -"d c #0000ff", -"# c #808080", -"a c #c0c0c0", -"b c #ffffff", -"...........########.............", -"........###abbbbbba###..........", -"......##abbbbbbbbbbbba##........", -".....#abbbbbbbbbbbbbbbba#.......", -"....#bbbbbbbbbbbbbbbbbbbbc......", -"...#bbbbbbbaddddddabbbbbbbc.....", -"..#bbbbbbbadabbddddabbbbbbbc....", -".#abbbbbbbddbbbbddddbbbbbbbac...", -".#bbbbbbbbddddbbddddbbbbbbbbc#..", -"#abbbbbbbbddddbaddddbbbbbbbbac#.", -"#bbbbbbbbbaddabddddbbbbbbbbbbc#.", -"#bbbbbbbbbbbbbadddbbbbbbbbbbbc##", -"#bbbbbbbbbbbbbdddbbbbbbbbbbbbc##", -"#bbbbbbbbbbbbbddabbbbbbbbbbbbc##", -"#bbbbbbbbbbbbbddbbbbbbbbbbbbbc##", -"#abbbbbbbbbbbbbbbbbbbbbbbbbbac##", -".#bbbbbbbbbbbaddabbbbbbbbbbbc###", -".#abbbbbbbbbbddddbbbbbbbbbbac###", -"..#bbbbbbbbbbddddbbbbbbbbbbc###.", -"...cbbbbbbbbbaddabbbbbbbbbc####.", -"....cbbbbbbbbbbbbbbbbbbbbc####..", -".....cabbbbbbbbbbbbbbbbac####...", -"......ccabbbbbbbbbbbbacc####....", -".......#cccabbbbbbaccc#####.....", -"........###cccabbbc#######......", -"..........####cbbbc#####........", -".............#cbbbc##...........", -"...............cbbc##...........", -"................cbc##...........", -".................cc##...........", -"..................###...........", -"...................##..........."}; +/* columns rows colors chars-per-pixel */ +"32 32 16 1", +"O c #A3A3FF", +"X c #FFFFFF", +"% c #CACAFF", +"- c #4141FF", +"= c #6060FF", +"* c #2B2BFF", +"@ c #B5B5FF", +" c None", +"# c #1616FF", +"+ c #8181FF", +"$ c #0000FF", +". c #C0C0C0", +"; c #5555FF", +": c #242424", +"o c #E7E7FF", +"& c #7575FF", +/* pixels */ +" ....... ", +" ...XXXXXXX... ", +" ..XXXXXXXXXXXXX.. ", +" .XXXXXXoO++@XXXXXX. ", +" .XXXXXXO#$$$$#%XXXXX. ", +" .XXXXXX@$$#&&#$#oXXXXX. ", +" .XXXXXXX*$$%XX%$$=XXXXXX. ", +" .XXXXXXX+-;XXXX$$-XXXXXX.: ", +" .XXXXXXXXXXXXX+$$&XXXXXX.:: ", +".XXXXXXXXXXXXo;$$*oXXXXXXX.: ", +".XXXXXXXXXXXo*$$*oXXXXXXXX.: ", +".XXXXXXXXXXX+$$*oXXXXXXXXX.:: ", +" .XXXXXXXXXX-$$oXXXXXXXXX.::: ", +" .XXXXXXXXXXX--XXXXXXXXXX.::: ", +" .XXXXXXXXXXXXXXXXXXXXXXX.:: ", +" .XXXXXXXXX-$$XXXXXXXXX.::: ", +" .XXXXXXXX-$$XXXXXXXX.:::: ", +" .XXXXXXXO++XXXXXXX.:::: ", +" ..XXXXXXXXXXXXX..:::: ", +" :...XXXXXXXX..::::: ", +" :::..XXXXXX.::::: ", +" :::.XXXXX.::: ", +" :.XXXX.:: ", +" .XXX.:: ", +" .XX.:: ", +" .X.:: ", +" ..:: ", +" .:: ", +" :: ", +" : ", +" ", +" " +}; +/* Copyright (c) Julian Smart */ static char *warning_xpm[]={ -"32 32 6 1", -". c None", -"c c #000000", -"# c #808000", -"d c #808080", -"b c #c0c0c0", -"a c #ffff00", -".............###................", -"............#aabc...............", -"...........#aaaabcd.............", -"...........#aaaaacdd............", -"..........#aaaaaabcdd...........", -"..........#aaaaaaacdd...........", -".........#aaaaaaaabcdd..........", -".........#aaaaaaaaacdd..........", -"........#aaaaaaaaaabcdd.........", -"........#aaabcccbaaacdd.........", -".......#aaaacccccaaabcdd........", -".......#aaaacccccaaaacdd........", -"......#aaaaacccccaaaabcdd.......", -"......#aaaaacccccaaaaacdd.......", -".....#aaaaaacccccaaaaabcdd......", -".....#aaaaaa#ccc#aaaaaacdd......", -"....#aaaaaaabcccbaaaaaabcdd.....", -"....#aaaaaaaacccaaaaaaaacdd.....", -"...#aaaaaaaaa#c#aaaaaaaabcdd....", -"...#aaaaaaaaabcbaaaaaaaaacdd....", -"..#aaaaaaaaaaacaaaaaaaaaabcdd...", -"..#aaaaaaaaaaaaaaaaaaaaaaacdd...", -".#aaaaaaaaaaabccbaaaaaaaaabcdd..", -".#aaaaaaaaaaaccccaaaaaaaaaacdd..", -"#aaaaaaaaaaaaccccaaaaaaaaaabcdd.", -"#aaaaaaaaaaaabccbaaaaaaaaaaacdd.", -"#aaaaaaaaaaaaaaaaaaaaaaaaaaacddd", -"#aaaaaaaaaaaaaaaaaaaaaaaaaabcddd", -".#aaaaaaaaaaaaaaaaaaaaaaaabcdddd", -"..#ccccccccccccccccccccccccddddd", -"....ddddddddddddddddddddddddddd.", -".....ddddddddddddddddddddddddd.."}; +/* columns rows colors chars-per-pixel */ +"32 32 9 1", +"@ c Black", +"o c #A6A800", +"+ c #8A8C00", +"$ c #B8BA00", +" c None", +"O c #6E7000", +"X c #DCDF00", +". c #C00000", +"# c #373800", +/* pixels */ +" ", +" ", +" ", +" . ", +" ... ", +" ... ", +" ..... ", +" ...X.. ", +" ..XXX.. ", +" ...XXX... ", +" ..XXXXX.. ", +" ..XXXXXX... ", +" ...XXoO+XX.. ", +" ..XXXO@#XXX.. ", +" ..XXXXO@#XXX... ", +" ...XXXXO@#XXXX.. ", +" ..XXXXXO@#XXXX... ", +" ...XXXXXo@OXXXXX.. ", +" ...XXXXXXo@OXXXXXX.. ", +" ..XXXXXXX$@OXXXXXX... ", +" ...XXXXXXXX@XXXXXXXX.. ", +" ...XXXXXXXXXXXXXXXXXX... ", +" ..XXXXXXXXXXOXXXXXXXXX.. ", +" ...XXXXXXXXXO@#XXXXXXXXX.. ", +" ..XXXXXXXXXXX#XXXXXXXXXX... ", +" ...XXXXXXXXXXXXXXXXXXXXXXX.. ", +" ...XXXXXXXXXXXXXXXXXXXXXXXX... ", +" .............................. ", +" .............................. ", +" ", +" ", +" " +}; + wxBitmap wxWin32ArtProvider::CreateBitmap(const wxArtID& id, const wxArtClient& WXUNUSED(client), @@ -4167,6 +4324,12 @@ void wxWin32Renderer::AdjustSize(wxSize *size, const wxWindow *window) } #endif // wxUSE_SCROLLBAR/!wxUSE_SCROLLBAR +#if wxUSE_BMPBUTTON + if ( wxDynamicCast(window, wxBitmapButton) ) + { + // do nothing + } else +#endif // wxUSE_BMPBUTTON #if wxUSE_BUTTON if ( wxDynamicCast(window, wxButton) ) {