sptk2 logo
SPTK Home Page
CThemeScrollBar.h
1/*
2╔══════════════════════════════════════════════════════════════════════════════╗
3║ SIMPLY POWERFUL TOOLKIT (SPTK) ║
4╟──────────────────────────────────────────────────────────────────────────────╢
5║ copyright © 1999-2022 Alexey Parshin. All rights reserved. ║
6║ email alexeyp@gmail.com ║
7╚══════════════════════════════════════════════════════════════════════════════╝
8┌──────────────────────────────────────────────────────────────────────────────┐
9│ This library is free software; you can redistribute it and/or modify it │
10│ under the terms of the GNU Library General Public License as published by │
11│ the Free Software Foundation; either version 2 of the License, or (at your │
12│ option) any later version. │
13│ │
14│ This library is distributed in the hope that it will be useful, but │
15│ WITHOUT ANY WARRANTY; without even the implied warranty of │
16│ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library │
17│ General Public License for more details. │
18│ │
19│ You should have received a copy of the GNU Library General Public License │
20│ along with this library; if not, write to the Free Software Foundation, │
21│ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. │
22│ │
23│ Please report all bugs and problems to alexeyp@gmail.com. │
24└──────────────────────────────────────────────────────────────────────────────┘
25*/
26
27#pragma once
28
29#include <FL/Fl.H>
30#include <FL/Enumerations.H>
31#include <sptk5/xdoc/Node.h>
32#include <sptk5/gui/CThemeImageCollection.h>
33#include <map>
34#include <string>
35
36namespace sptk {
37
48{
49 THM_SCROLLBAR_VERTICAL,
50 THM_SCROLLBAR_HORIZONTAL
51};
52
57class SP_EXPORT CScrollBarImages
58{
59public:
60
64 enum type
65 {
70
74 SLIDER
75
76 };
77
82
87
91 CThemeImageCollection m_steppers[2];
92
97 : m_orientation(THM_SCROLLBAR_VERTICAL)
98 {
99 }
100
107 void load(CThemeScrollBarType atype, bool desaturateInactiveButtons, bool externalFile = false);
108
112 void clear();
113};
114
115class SP_EXPORT CThemeScrollBar
116{
117public:
125 static CScrollBarImages m_scrollBar[2];
126
131
136
141
142
150 xdoc::Document& xml, const String& orientation, CThemeImageCollection& buttonImages);
151
157
163
169
176 static bool sizeScrollBar(int& w, int& h);
177
194 static bool drawScrollBar(int x, int y, int w, int h, float minimum, float maximum, float value, float size,
195 int activeZone, bool active);
196};
197
201}
The complete set of four images to draw a scroll bar.
Definition: CThemeScrollBar.h:58
void clear()
Clears the scrollbar images for the default theme.
CThemeScrollBarType m_orientation
Definition: CThemeScrollBar.h:81
CScrollBarImages() noexcept
Default constructor.
Definition: CThemeScrollBar.h:96
void load(CThemeScrollBarType atype, bool desaturateInactiveButtons, bool externalFile=false)
Loads the images from SPTK theme files.
type
Type of the scroll bar image.
Definition: CThemeScrollBar.h:65
@ TROUGH
Definition: CThemeScrollBar.h:69
A collection of theme images.
Definition: CThemeImageCollection.h:46
Definition: CThemeScrollBar.h:116
static int m_scrollBarTroughBorder
Definition: CThemeScrollBar.h:130
static bool sizeScrollBar(int &w, int &h)
Computes and returns the minimum size of the scroll bar.
static void loadGtkScrollbars(xdoc::Document &xml)
Loads GTK theme scrollbar button images from GTK theme.
static void loadGtkScrollbarButtons(xdoc::Document &xml, const String &orientation, CThemeImageCollection &buttonImages)
Loads GTK theme scrollbar button images from 'style' node.
static void loadGtkScrollbarTroughs(xdoc::Document &xml)
Loads GTK theme scrollbar troughs.
static int m_scrollBarStepperSize
Definition: CThemeScrollBar.h:140
static bool drawScrollBar(int x, int y, int w, int h, float minimum, float maximum, float value, float size, int activeZone, bool active)
Draws a scroll bar image.
static int m_scrollBarSliderWidth
Definition: CThemeScrollBar.h:135
static void loadGtkScrollbarSliders(xdoc::Document &xml)
Loads GTK theme scrollbar sliders.
Definition: String.h:49
Definition: Document.h:34
CThemeScrollBarType
Theme scroll bar type - defines the scroll bar direction.
Definition: CThemeScrollBar.h:48

Fri Oct 14 2022 09:58:31: SPTK 5.4.1