-
Notifications
You must be signed in to change notification settings - Fork 0
/
cpptkx.h
139 lines (104 loc) · 3.02 KB
/
cpptkx.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
//
// Copyright (C) 2019, VladMaster99
// Version 1.03
//
// Permission to copy, use, modify, sell and distribute this software
// is granted provided this copyright notice appears in all copies.
// This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
//
#include "base/cpptkbase.h"
;
using namespace std;
// various Ttk bits and pieces
// starter pieces (genuine Ttk commands)
namespace Ttk
{
void useTtk(bool use);
bool useTtk();
Tk::details::Expr button(string const &name);
Tk::details::Expr entry(string const &name);
Tk::details::Expr image(string const &option,
string const &tn = string(),
string const &name = string());
Tk::details::Expr label(string const &name);
Tk::details::Expr labelframe(string const &name);
Tk::details::Expr menubutton(string const &name);
Tk::details::Expr panedwindow(string const &name);
Tk::details::Expr scale(string const &name);
Tk::details::Expr scrollbar(string const &name);
Tk::details::Expr spinbox(string const &name);
Tk::details::Expr checkbutton(string const &name);
Tk::details::Expr frame(string const &name);
Tk::details::Expr radiobutton(string const &name);
namespace details
{
}
}
/*
namespace Tk
{
template <typename T1, typename T2>
details::Expr scale(std::string const &item,
T1 const &xorig, T2 const &yorig, double xscale, double yscale)
{
std::string str("scale ");
str += item; str += " ";
str += details::toString(xorig); str += " ";
str += details::toString(yorig); str += " ";
str += details::toString(xscale); str += " ";
str += details::toString(yscale);
return details::Expr(str);
}
// options
// other options, requiring special syntax or compilation
template <typename T1, typename T2, typename T3, typename T4>
details::Expr scrollregion(T1 const &x1, T2 const &y1,
T3 const &x2, T4 const y2)
{
std::string str(" -scrollregion ");
str += details::toString(x1); str += " ";
str += details::toString(y1); str += " ";
str += details::toString(x2); str += " ";
str += details::toString(y2);
return details::Expr(str);
}
// event attribute specifiers
// constants
// additional constants for Ttk
-class
-padding
-style
// additional functions
// James James James Namespace next
// multi-purpose tokens
// these are tokens which are meant to be both commands
// and constants or options
namespace details
class FrameToken : public BasicToken
{
public:
FrameToken();
Expr operator()(std::string const &name) const;
};
class RadioButtonToken : public BasicToken
{
public:
RadioButtonToken();
Expr operator()(std::string const &name) const;
};
class ImageToken : public BasicToken
{
public:
ImageToken();
Expr operator()() const;
Expr operator()(std::string const &name) const;
};
} // namespace Detials
extern details::CheckButtonToken checkbutton;
extern details::RadioButtonToken radiobutton;
extern details::ImageToken image;
extern details::FrameToken frame
} // namespace Tk
*/
;