things
This commit is contained in:
parent
bbc8b871bb
commit
933f276e1a
73 changed files with 1350 additions and 306 deletions
8
Makefile
8
Makefile
|
|
@ -9,17 +9,17 @@ SO = .so
|
|||
EXEC =
|
||||
|
||||
.PHONY: all format clean
|
||||
.SUFFIXES: .cxx .o
|
||||
.SUFFIXES: .cc .o
|
||||
|
||||
all: libMwCXX$(SO)
|
||||
|
||||
format:
|
||||
clang-format --verbose -i `find . -name "*.cxx" -or -name "*.h"`
|
||||
clang-format --verbose -i `find . -name "*.cc" -or -name "*.h"`
|
||||
|
||||
OBJS = src/core.o src/widget/base.o
|
||||
include objs.mk
|
||||
|
||||
src/widget/base.o: src/widget/base.cxx src/widget/baseauto.cxx
|
||||
src/widget/base.o: src/widget/base.cc src/widget/baseauto.cc
|
||||
|
||||
bindgen$(EXEC): bindgen.o
|
||||
$(CXX) -L$(XEMIL)/lib -L$(XEMIL)/src -o $@ bindgen.o -lxemil
|
||||
|
|
@ -27,7 +27,7 @@ bindgen$(EXEC): bindgen.o
|
|||
libMwCXX$(SO): $(OBJS)
|
||||
$(CXX) -shared -L$(MILSKO)/lib -L$(MILSKO)/src -o $@ $(OBJS) -lMw
|
||||
|
||||
.cxx.o:
|
||||
.cc.o:
|
||||
$(CXX) -fPIC -c -Iinclude -I$(MILSKO)/include -I$(XEMIL)/include -o $@ $<
|
||||
|
||||
clean:
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ struct typeinfo {
|
|||
std::string type;
|
||||
std::string name;
|
||||
std::string struct_name;
|
||||
std::string widget_type;
|
||||
int pointer;
|
||||
};
|
||||
|
||||
|
|
@ -45,6 +46,12 @@ static std::string get_ctype(typeinfo type, int name = 1, int do_ptr = 1) {
|
|||
ret += "void*";
|
||||
} else if(type.type == "struct") {
|
||||
ret += type.struct_name;
|
||||
} else if(type.type == "widget") {
|
||||
if(type.widget_type == ""){
|
||||
ret += "MwCXX::Base*";
|
||||
}else{
|
||||
ret += "MwCXX::" + type.widget_type + "*";
|
||||
}
|
||||
}
|
||||
|
||||
if(do_ptr && type.pointer) ret += "*";
|
||||
|
|
@ -95,6 +102,7 @@ static typeinfo xml_to_type(xl_node_t* node) {
|
|||
ret.type = node->name;
|
||||
ret.name = ((s = xl_get_attribute(node, "name")) != NULL) ? s : "";
|
||||
ret.struct_name = ((s = xl_get_attribute(node, "defname")) != NULL) ? s : "";
|
||||
ret.widget_type = ((s = xl_get_attribute(node, "type")) != NULL) ? s : "";
|
||||
ret.pointer = ATTR_TO_BOOL(node, "pointer");
|
||||
|
||||
return ret;
|
||||
|
|
@ -116,16 +124,6 @@ static void scan_property(xl_node_t* node) {
|
|||
props[xl_get_attribute(node, "name")] = prop;
|
||||
}
|
||||
|
||||
static void scan_properties(xl_node_t* node) {
|
||||
xl_node_t* child = node->first_child;
|
||||
|
||||
while(child != NULL) {
|
||||
scan_property(child);
|
||||
|
||||
child = child->next;
|
||||
}
|
||||
}
|
||||
|
||||
static void scan_handler(xl_node_t* node) {
|
||||
handler handl;
|
||||
char* s;
|
||||
|
|
@ -148,16 +146,6 @@ static void scan_handler(xl_node_t* node) {
|
|||
handlers[xl_get_attribute(node, "name")] = handl;
|
||||
}
|
||||
|
||||
static void scan_handlers(xl_node_t* node) {
|
||||
xl_node_t* child = node->first_child;
|
||||
|
||||
while(child != NULL) {
|
||||
scan_handler(child);
|
||||
|
||||
child = child->next;
|
||||
}
|
||||
}
|
||||
|
||||
static std::string widget_property_header(std::string name, std::string indent = "") {
|
||||
std::stringstream strm;
|
||||
|
||||
|
|
@ -175,19 +163,6 @@ static std::string scan_widget_property_header(xl_node_t* node, std::string inde
|
|||
return widget_property_header(xl_get_attribute(node, "name"), indent);
|
||||
}
|
||||
|
||||
static std::string scan_widget_properties_header(xl_node_t* node, std::string indent) {
|
||||
std::string r = "";
|
||||
xl_node_t* child = node->first_child;
|
||||
|
||||
while(child != NULL) {
|
||||
r += scan_widget_property_header(child, indent);
|
||||
|
||||
child = child->next;
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
static std::string widget_property_source(std::string widget, std::string name) {
|
||||
std::stringstream strm;
|
||||
|
||||
|
|
@ -223,19 +198,6 @@ static std::string scan_widget_property_source(xl_node_t* node, std::string widg
|
|||
return widget_property_source(widget, xl_get_attribute(node, "name"));
|
||||
}
|
||||
|
||||
static std::string scan_widget_properties_source(xl_node_t* node, std::string widget) {
|
||||
std::string r = "";
|
||||
xl_node_t* child = node->first_child;
|
||||
|
||||
while(child != NULL) {
|
||||
r += scan_widget_property_source(child, widget);
|
||||
|
||||
child = child->next;
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
static std::string widget_handler_header(std::string name, std::string indent = "") {
|
||||
std::stringstream strm;
|
||||
|
||||
|
|
@ -252,19 +214,6 @@ static std::string scan_widget_handler_header(xl_node_t* node, std::string inden
|
|||
return widget_handler_header(xl_get_attribute(node, "name"), indent);
|
||||
}
|
||||
|
||||
static std::string scan_widget_handlers_header(xl_node_t* node, std::string indent) {
|
||||
std::string r = "";
|
||||
xl_node_t* child = node->first_child;
|
||||
|
||||
while(child != NULL) {
|
||||
r += scan_widget_handler_header(child, indent);
|
||||
|
||||
child = child->next;
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
static std::string widget_handler_source(std::string widget, std::string name) {
|
||||
std::stringstream strm;
|
||||
std::string cast = "";
|
||||
|
|
@ -295,25 +244,10 @@ static std::string scan_widget_handler_source(xl_node_t* node, std::string widge
|
|||
return widget_handler_source(widget, xl_get_attribute(node, "name"));
|
||||
}
|
||||
|
||||
static std::string scan_widget_handlers_source(xl_node_t* node, std::string widget) {
|
||||
std::string r = "";
|
||||
xl_node_t* child = node->first_child;
|
||||
|
||||
while(child != NULL) {
|
||||
r += scan_widget_handler_source(child, widget);
|
||||
|
||||
child = child->next;
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
static void scan_widget(xl_node_t* node) {
|
||||
std::string name;
|
||||
xl_node_t** p_nodes;
|
||||
xl_node_t** h_nodes;
|
||||
xl_node_t* child;
|
||||
int i;
|
||||
|
||||
if(node->type != XL_NODE_NODE) return;
|
||||
|
||||
|
|
@ -341,14 +275,18 @@ static void scan_widget(xl_node_t* node) {
|
|||
OFS << " virtual void RegisterHandlers();" << std::endl;
|
||||
OFS << std::endl;
|
||||
OFS << " public:" << std::endl;
|
||||
OFS << " " + name + "(MwWidget widget);" << std::endl;
|
||||
OFS << " " + name + "(MwWidget widget, MwCXX::Base* parent = NULL);" << std::endl;
|
||||
OFS << " " + name + "(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height);" << std::endl;
|
||||
|
||||
if(p_nodes != NULL) {
|
||||
std::string r = "";
|
||||
|
||||
for(i = 0; p_nodes[i] != NULL; i++) {
|
||||
r += scan_widget_properties_header(p_nodes[i], "\t\t");
|
||||
for(int i = 0; p_nodes[i] != NULL; i++) {
|
||||
for(xl_node_t* child = p_nodes[i]->first_child; child != NULL; child = child->next){
|
||||
if(child->type != XL_NODE_NODE) continue;
|
||||
|
||||
r += scan_widget_property_header(child, "\t\t");
|
||||
}
|
||||
}
|
||||
|
||||
if(r != "") OFS << std::endl
|
||||
|
|
@ -358,8 +296,12 @@ static void scan_widget(xl_node_t* node) {
|
|||
if(h_nodes != NULL) {
|
||||
std::string r = "";
|
||||
|
||||
for(i = 0; h_nodes[i] != NULL; i++) {
|
||||
r += scan_widget_handlers_header(h_nodes[i], "\t\t");
|
||||
for(int i = 0; h_nodes[i] != NULL; i++) {
|
||||
for(xl_node_t* child = h_nodes[i]->first_child; child != NULL; child = child->next){
|
||||
if(child->type != XL_NODE_NODE) continue;
|
||||
|
||||
r += scan_widget_handler_header(child, "\t\t");
|
||||
}
|
||||
}
|
||||
|
||||
if(r != "") OFS << std::endl
|
||||
|
|
@ -374,16 +316,16 @@ static void scan_widget(xl_node_t* node) {
|
|||
|
||||
#undef OFS
|
||||
|
||||
#define OFS files["W" + name + ".cxx"]
|
||||
#define OFS files["W" + name + ".cc"]
|
||||
|
||||
OFS = std::ofstream("src/widget/" + lowercase(name) + ".cxx");
|
||||
OFS = std::ofstream("src/widget/" + lowercase(name) + ".cc");
|
||||
|
||||
if(name == "OpenGL" || name == "Vulkan") OFS << "#define MW_" + uppercase(name) + "_NO_INCLUDE" << std::endl;
|
||||
|
||||
OFS << "#include <MwCXX/Widget/" + name + ".h>" << std::endl;
|
||||
OFS << std::endl;
|
||||
|
||||
OFS << "MwCXX::" + name + "::" + name + "(MwWidget widget) : MwCXX::Base(widget) {" << std::endl;
|
||||
OFS << "MwCXX::" + name + "::" + name + "(MwWidget widget, MwCXX::Base* parent) : MwCXX::Base(widget, parent) {" << std::endl;
|
||||
OFS << " this->RegisterHandlers();" << std::endl;
|
||||
OFS << "}" << std::endl;
|
||||
OFS << std::endl;
|
||||
|
|
@ -394,21 +336,29 @@ static void scan_widget(xl_node_t* node) {
|
|||
OFS << std::endl;
|
||||
|
||||
if(p_nodes != NULL) {
|
||||
for(i = 0; p_nodes[i] != NULL; i++) {
|
||||
OFS << scan_widget_properties_source(p_nodes[i], name);
|
||||
for(int i = 0; p_nodes[i] != NULL; i++) {
|
||||
for(xl_node_t* child = p_nodes[i]->first_child; child != NULL; child = child->next){
|
||||
if(child->type != XL_NODE_NODE) continue;
|
||||
|
||||
OFS << scan_widget_property_source(child, name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(h_nodes != NULL) {
|
||||
for(i = 0; h_nodes[i] != NULL; i++) {
|
||||
OFS << scan_widget_handlers_source(h_nodes[i], name);
|
||||
for(int i = 0; h_nodes[i] != NULL; i++) {
|
||||
for(xl_node_t* child = h_nodes[i]->first_child; child != NULL; child = child->next){
|
||||
if(child->type != XL_NODE_NODE) continue;
|
||||
|
||||
OFS << scan_widget_handler_source(child, name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
OFS << "void MwCXX::" + name + "::RegisterHandlers() {" << std::endl;
|
||||
if(h_nodes != NULL) {
|
||||
for(i = 0; h_nodes[i] != NULL; i++) {
|
||||
for(child = h_nodes[i]->first_child; child != NULL; child = child->next) {
|
||||
for(int i = 0; h_nodes[i] != NULL; i++) {
|
||||
for(xl_node_t* child = h_nodes[i]->first_child; child != NULL; child = child->next) {
|
||||
std::string hname;
|
||||
|
||||
if(child->type != XL_NODE_NODE) continue;
|
||||
|
|
@ -429,13 +379,91 @@ static void scan_widget(xl_node_t* node) {
|
|||
files["objs"] << " src/widget/" + lowercase(name) + ".o";
|
||||
}
|
||||
|
||||
static void scan_widgets(xl_node_t* node) {
|
||||
xl_node_t* child = node->first_child;
|
||||
static std::string function_decl(xl_node_t* node, std::string prefix = ""){
|
||||
xl_node_t* ret = NULL;
|
||||
xl_node_t** nodes;
|
||||
std::string r = "";
|
||||
|
||||
while(child != NULL) {
|
||||
scan_widget(child);
|
||||
if((nodes = xl_get_path(node, "return")) != NULL){
|
||||
for(int i = 0; nodes[i] != NULL; i++){
|
||||
for(xl_node_t* child = nodes[i]->first_child; child != NULL; child = child->next){
|
||||
if(child->type == XL_NODE_NODE) ret = child;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
child = child->next;
|
||||
if(ret == NULL){
|
||||
r += "void ";
|
||||
}else{
|
||||
r += get_ctype(xml_to_type(ret), 0, 0) + " ";
|
||||
}
|
||||
|
||||
r += prefix + std::string(xl_get_attribute(node, "name")).substr(2);
|
||||
|
||||
r += "(";
|
||||
if((nodes = xl_get_path(node, "arguments")) != NULL){
|
||||
for(int i = 0; nodes[i] != NULL; i++){
|
||||
for(xl_node_t* child = nodes[i]->first_child; child != NULL; child = child->next){
|
||||
if(child->type != XL_NODE_NODE) continue;
|
||||
|
||||
if(r.substr(r.size() - 1, 1) != "(") r += ", ";
|
||||
|
||||
r += get_ctype(xml_to_type(child), 1, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
r += ")";
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
static std::string function_source(xl_node_t* node){
|
||||
return "";
|
||||
}
|
||||
|
||||
static std::string function_header(xl_node_t* node){
|
||||
return function_decl(node) + ";";
|
||||
}
|
||||
|
||||
static void scan_header(xl_node_t* node) {
|
||||
std::string name;
|
||||
|
||||
if(node->type != XL_NODE_NODE) return;
|
||||
|
||||
name = xl_get_attribute(node, "name");
|
||||
|
||||
if(name.size() >= 7 && name.substr(0, 7) == "Dialog/"){
|
||||
xl_node_t** nodes;
|
||||
|
||||
#define OFS files["D" + name.substr(7) + ".h"]
|
||||
|
||||
OFS = std::ofstream("include/MwCXX/" + name + ".h");
|
||||
|
||||
OFS << "#ifndef __MWCXX_DIALOG_" + uppercase(name.substr(7)) + "_H__" << std::endl;
|
||||
OFS << "#define __MWCXX_DIALOG_" + uppercase(name.substr(7)) + "_H__" << std::endl;
|
||||
OFS << std::endl;
|
||||
|
||||
OFS << "namespace MwCXX {" << std::endl;
|
||||
if((nodes = xl_get_path(node, "functions")) != NULL){
|
||||
for(int i = 0; nodes[i] != NULL; i++){
|
||||
for(xl_node_t* child = nodes[i]->first_child; child != NULL; child = child->next){
|
||||
if(child->type != XL_NODE_NODE) continue;
|
||||
|
||||
OFS << " " + function_header(child) << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
free(nodes);
|
||||
}
|
||||
OFS << "}; // namespace MwCXX" << std::endl;
|
||||
|
||||
OFS << std::endl;
|
||||
OFS << "#endif" << std::endl;
|
||||
|
||||
#undef OFS
|
||||
|
||||
#define OFS files["D" + name.substr(7) + ".cc"]
|
||||
#undef OFS
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -464,9 +492,9 @@ static void base_widget() {
|
|||
|
||||
#undef OFS
|
||||
|
||||
#define OFS files["WBaseAuto.cxx"]
|
||||
#define OFS files["WBaseAuto.cc"]
|
||||
|
||||
OFS = std::ofstream("src/widget/baseauto.cxx");
|
||||
OFS = std::ofstream("src/widget/baseauto.cc");
|
||||
|
||||
OFS << "#include <MwCXX/Widget/Base.h>" << std::endl;
|
||||
|
||||
|
|
@ -520,7 +548,11 @@ int main(int argc, char** argv) {
|
|||
|
||||
if((nodes = xl_get_path(h->root, "properties")) != NULL) {
|
||||
for(int i = 0; nodes[i] != NULL; i++) {
|
||||
scan_properties(nodes[i]);
|
||||
for(xl_node_t* child = nodes[i]->first_child; child != NULL; child = child->next){
|
||||
if(child->type != XL_NODE_NODE) continue;
|
||||
|
||||
scan_property(child);
|
||||
}
|
||||
}
|
||||
|
||||
free(nodes);
|
||||
|
|
@ -528,7 +560,23 @@ int main(int argc, char** argv) {
|
|||
|
||||
if((nodes = xl_get_path(h->root, "handlers")) != NULL) {
|
||||
for(int i = 0; nodes[i] != NULL; i++) {
|
||||
scan_handlers(nodes[i]);
|
||||
for(xl_node_t* child = nodes[i]->first_child; child != NULL; child = child->next){
|
||||
if(child->type != XL_NODE_NODE) continue;
|
||||
|
||||
scan_handler(child);
|
||||
}
|
||||
}
|
||||
|
||||
free(nodes);
|
||||
}
|
||||
|
||||
if((nodes = xl_get_path(h->root, "headers")) != NULL) {
|
||||
for(int i = 0; nodes[i] != NULL; i++) {
|
||||
for(xl_node_t* child = nodes[i]->first_child; child != NULL; child = child->next){
|
||||
if(child->type != XL_NODE_NODE) continue;
|
||||
|
||||
scan_header(child);
|
||||
}
|
||||
}
|
||||
|
||||
free(nodes);
|
||||
|
|
@ -538,7 +586,9 @@ int main(int argc, char** argv) {
|
|||
|
||||
if((nodes = xl_get_path(h->root, "widgets")) != NULL) {
|
||||
for(int i = 0; nodes[i] != NULL; i++) {
|
||||
scan_widgets(nodes[i]);
|
||||
for(xl_node_t* child = nodes[i]->first_child; child != NULL; child = child->next){
|
||||
scan_widget(child);
|
||||
}
|
||||
}
|
||||
|
||||
free(nodes);
|
||||
8
include/MwCXX/Dialog/ColorChooser.h
Normal file
8
include/MwCXX/Dialog/ColorChooser.h
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#ifndef __MWCXX_DIALOG_COLORCHOOSER_H__
|
||||
#define __MWCXX_DIALOG_COLORCHOOSER_H__
|
||||
|
||||
namespace MwCXX {
|
||||
MwCXX::Window* ColorChooser(MwCXX::Base* handle, MwCXX::String title);
|
||||
}; // namespace MwCXX
|
||||
|
||||
#endif
|
||||
8
include/MwCXX/Dialog/DirectoryChooser.h
Normal file
8
include/MwCXX/Dialog/DirectoryChooser.h
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#ifndef __MWCXX_DIALOG_DIRECTORYCHOOSER_H__
|
||||
#define __MWCXX_DIALOG_DIRECTORYCHOOSER_H__
|
||||
|
||||
namespace MwCXX {
|
||||
MwCXX::Window* DirectoryChooser(MwCXX::Base* handle, MwCXX::String title);
|
||||
}; // namespace MwCXX
|
||||
|
||||
#endif
|
||||
9
include/MwCXX/Dialog/FileChooser.h
Normal file
9
include/MwCXX/Dialog/FileChooser.h
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#ifndef __MWCXX_DIALOG_FILECHOOSER_H__
|
||||
#define __MWCXX_DIALOG_FILECHOOSER_H__
|
||||
|
||||
namespace MwCXX {
|
||||
MwCXX::Window* FileChooser(MwCXX::Base* handle, MwCXX::String title);
|
||||
MwCXX::Window* FileChooserEx(MwCXX::Base* handle, MwCXX::String title, int dir);
|
||||
}; // namespace MwCXX
|
||||
|
||||
#endif
|
||||
10
include/MwCXX/Dialog/MessageBox.h
Normal file
10
include/MwCXX/Dialog/MessageBox.h
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
#ifndef __MWCXX_DIALOG_MESSAGEBOX_H__
|
||||
#define __MWCXX_DIALOG_MESSAGEBOX_H__
|
||||
|
||||
namespace MwCXX {
|
||||
MwCXX::Window* MessageBox(MwCXX::Base* handle, MwCXX::String text, MwCXX::String title, int flag);
|
||||
MwCXX::Button* MessageBoxGetChild(MwCXX::Window* handle, int child);
|
||||
void MessageBoxDestroy(MwCXX::Window* handle);
|
||||
}; // namespace MwCXX
|
||||
|
||||
#endif
|
||||
|
|
@ -4,6 +4,7 @@
|
|||
#include <Mw/Milsko.h>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
// #define MWCXX_USE_C_STRING
|
||||
|
||||
|
|
|
|||
|
|
@ -10,9 +10,13 @@ namespace MwCXX {
|
|||
|
||||
MwWidget widget;
|
||||
|
||||
MwCXX::Base* parent;
|
||||
std::vector<MwCXX::Base*> children;
|
||||
|
||||
public:
|
||||
Base(MwWidget widget);
|
||||
Base(MwWidget widget, MwCXX::Base* parent = NULL);
|
||||
Base(MwClass widget_class, MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height);
|
||||
~Base();
|
||||
|
||||
MwRect GetArea();
|
||||
void SetArea(MwRect r);
|
||||
|
|
@ -20,8 +24,12 @@ namespace MwCXX {
|
|||
void Move(int x, int y);
|
||||
void Resize(unsigned int width, unsigned int height);
|
||||
|
||||
int Step();
|
||||
int Pending();
|
||||
void Loop();
|
||||
|
||||
MwCXX::Base* GetParent();
|
||||
|
||||
#include <MwCXX/Widget/BaseAuto.h>
|
||||
};
|
||||
}; // namespace MwCXX
|
||||
|
|
|
|||
|
|
@ -1,41 +1,41 @@
|
|||
MwCXX::String GetBackground();
|
||||
void SetBackground(MwCXX::String value);
|
||||
MwLLPixmap GetBackgroundPixmap();
|
||||
void SetBackgroundPixmap(MwLLPixmap value);
|
||||
int GetBitmapFont();
|
||||
void SetBitmapFont(int value);
|
||||
int GetBorderWidth();
|
||||
void SetBorderWidth(int value);
|
||||
int GetDarkTheme();
|
||||
void SetDarkTheme(int value);
|
||||
int GetFixedSize();
|
||||
void SetFixedSize(int value);
|
||||
int GetForceInverted();
|
||||
void SetForceInverted(int value);
|
||||
void SetBackground(MwCXX::String value);
|
||||
MwLLPixmap GetBackgroundPixmap();
|
||||
void SetBackgroundPixmap(MwLLPixmap value);
|
||||
int GetBitmapFont();
|
||||
void SetBitmapFont(int value);
|
||||
int GetBorderWidth();
|
||||
void SetBorderWidth(int value);
|
||||
int GetDarkTheme();
|
||||
void SetDarkTheme(int value);
|
||||
int GetFixedSize();
|
||||
void SetFixedSize(int value);
|
||||
int GetForceInverted();
|
||||
void SetForceInverted(int value);
|
||||
MwCXX::String GetForeground();
|
||||
void SetForeground(MwCXX::String value);
|
||||
int GetHeight();
|
||||
void SetHeight(int value);
|
||||
int GetIsRounded();
|
||||
void SetIsRounded(int value);
|
||||
int GetModernLook();
|
||||
void SetModernLook(int value);
|
||||
int GetRatio();
|
||||
void SetRatio(int value);
|
||||
void SetForeground(MwCXX::String value);
|
||||
int GetHeight();
|
||||
void SetHeight(int value);
|
||||
int GetIsRounded();
|
||||
void SetIsRounded(int value);
|
||||
int GetModernLook();
|
||||
void SetModernLook(int value);
|
||||
int GetRatio();
|
||||
void SetRatio(int value);
|
||||
MwCXX::String GetSubBackground();
|
||||
void SetSubBackground(MwCXX::String value);
|
||||
void SetSubBackground(MwCXX::String value);
|
||||
MwCXX::String GetSubForeground();
|
||||
void SetSubForeground(MwCXX::String value);
|
||||
int GetUseMonospace();
|
||||
void SetUseMonospace(int value);
|
||||
int GetWaitMS();
|
||||
void SetWaitMS(int value);
|
||||
int GetWidth();
|
||||
void SetWidth(int value);
|
||||
int GetX();
|
||||
void SetX(int value);
|
||||
int GetY();
|
||||
void SetY(int value);
|
||||
void SetSubForeground(MwCXX::String value);
|
||||
int GetUseMonospace();
|
||||
void SetUseMonospace(int value);
|
||||
int GetWaitMS();
|
||||
void SetWaitMS(int value);
|
||||
int GetWidth();
|
||||
void SetWidth(int value);
|
||||
int GetX();
|
||||
void SetX(int value);
|
||||
int GetY();
|
||||
void SetY(int value);
|
||||
|
||||
virtual void OnClipboard(MwCXX::String value) {};
|
||||
virtual void OnDarkTheme(int value) {};
|
||||
|
|
|
|||
|
|
@ -12,18 +12,18 @@ namespace MwCXX {
|
|||
virtual void RegisterHandlers();
|
||||
|
||||
public:
|
||||
Box(MwWidget widget);
|
||||
Box(MwWidget widget, MwCXX::Base* parent = NULL);
|
||||
Box(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height);
|
||||
|
||||
int GetOrientation();
|
||||
int GetOrientation();
|
||||
void SetOrientation(int value);
|
||||
int GetMargin();
|
||||
int GetMargin();
|
||||
void SetMargin(int value);
|
||||
int GetPadding();
|
||||
int GetPadding();
|
||||
void SetPadding(int value);
|
||||
int GetHasBorder();
|
||||
int GetHasBorder();
|
||||
void SetHasBorder(int value);
|
||||
int GetInverted();
|
||||
int GetInverted();
|
||||
void SetInverted(int value);
|
||||
};
|
||||
}; // namespace MwCXX
|
||||
|
|
|
|||
|
|
@ -12,19 +12,19 @@ namespace MwCXX {
|
|||
virtual void RegisterHandlers();
|
||||
|
||||
public:
|
||||
Button(MwWidget widget);
|
||||
Button(MwWidget widget, MwCXX::Base* parent = NULL);
|
||||
Button(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height);
|
||||
|
||||
MwLLPixmap GetPixmap();
|
||||
void SetPixmap(MwLLPixmap value);
|
||||
MwLLPixmap GetPixmap();
|
||||
void SetPixmap(MwLLPixmap value);
|
||||
MwCXX::String GetText();
|
||||
void SetText(MwCXX::String value);
|
||||
int GetFlat();
|
||||
void SetFlat(int value);
|
||||
int GetPadding();
|
||||
void SetPadding(int value);
|
||||
int GetFillArea();
|
||||
void SetFillArea(int value);
|
||||
void SetText(MwCXX::String value);
|
||||
int GetFlat();
|
||||
void SetFlat(int value);
|
||||
int GetPadding();
|
||||
void SetPadding(int value);
|
||||
int GetFillArea();
|
||||
void SetFillArea(int value);
|
||||
|
||||
virtual void OnActivate() {};
|
||||
virtual void OnChanged() {};
|
||||
|
|
|
|||
|
|
@ -12,10 +12,10 @@ namespace MwCXX {
|
|||
virtual void RegisterHandlers();
|
||||
|
||||
public:
|
||||
CheckBox(MwWidget widget);
|
||||
CheckBox(MwWidget widget, MwCXX::Base* parent = NULL);
|
||||
CheckBox(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height);
|
||||
|
||||
int GetChecked();
|
||||
int GetChecked();
|
||||
void SetChecked(int value);
|
||||
|
||||
virtual void OnChanged() {};
|
||||
|
|
|
|||
|
|
@ -12,12 +12,12 @@ namespace MwCXX {
|
|||
virtual void RegisterHandlers();
|
||||
|
||||
public:
|
||||
ComboBox(MwWidget widget);
|
||||
ComboBox(MwWidget widget, MwCXX::Base* parent = NULL);
|
||||
ComboBox(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height);
|
||||
|
||||
int GetAreaShown();
|
||||
int GetAreaShown();
|
||||
void SetAreaShown(int value);
|
||||
int GetValue();
|
||||
int GetValue();
|
||||
void SetValue(int value);
|
||||
|
||||
virtual void OnComboBoxChanged(int value) {};
|
||||
|
|
|
|||
|
|
@ -12,13 +12,13 @@ namespace MwCXX {
|
|||
virtual void RegisterHandlers();
|
||||
|
||||
public:
|
||||
Entry(MwWidget widget);
|
||||
Entry(MwWidget widget, MwCXX::Base* parent = NULL);
|
||||
Entry(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height);
|
||||
|
||||
MwCXX::String GetText();
|
||||
void SetText(MwCXX::String value);
|
||||
int GetHideInput();
|
||||
void SetHideInput(int value);
|
||||
void SetText(MwCXX::String value);
|
||||
int GetHideInput();
|
||||
void SetHideInput(int value);
|
||||
|
||||
virtual void OnActivate() {};
|
||||
virtual void OnChanged() {};
|
||||
|
|
|
|||
|
|
@ -12,12 +12,12 @@ namespace MwCXX {
|
|||
virtual void RegisterHandlers();
|
||||
|
||||
public:
|
||||
Frame(MwWidget widget);
|
||||
Frame(MwWidget widget, MwCXX::Base* parent = NULL);
|
||||
Frame(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height);
|
||||
|
||||
int GetHasBorder();
|
||||
int GetHasBorder();
|
||||
void SetHasBorder(int value);
|
||||
int GetInverted();
|
||||
int GetInverted();
|
||||
void SetInverted(int value);
|
||||
};
|
||||
}; // namespace MwCXX
|
||||
|
|
|
|||
|
|
@ -12,17 +12,17 @@ namespace MwCXX {
|
|||
virtual void RegisterHandlers();
|
||||
|
||||
public:
|
||||
Image(MwWidget widget);
|
||||
Image(MwWidget widget, MwCXX::Base* parent = NULL);
|
||||
Image(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height);
|
||||
|
||||
MwLLPixmap GetPixmap();
|
||||
void SetPixmap(MwLLPixmap value);
|
||||
int GetHasBorder();
|
||||
void SetHasBorder(int value);
|
||||
int GetInverted();
|
||||
void SetInverted(int value);
|
||||
int GetFillArea();
|
||||
void SetFillArea(int value);
|
||||
void SetPixmap(MwLLPixmap value);
|
||||
int GetHasBorder();
|
||||
void SetHasBorder(int value);
|
||||
int GetInverted();
|
||||
void SetInverted(int value);
|
||||
int GetFillArea();
|
||||
void SetFillArea(int value);
|
||||
};
|
||||
}; // namespace MwCXX
|
||||
|
||||
|
|
|
|||
|
|
@ -12,21 +12,21 @@ namespace MwCXX {
|
|||
virtual void RegisterHandlers();
|
||||
|
||||
public:
|
||||
Label(MwWidget widget);
|
||||
Label(MwWidget widget, MwCXX::Base* parent = NULL);
|
||||
Label(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height);
|
||||
|
||||
MwCXX::String GetText();
|
||||
void SetText(MwCXX::String value);
|
||||
int GetAlignment();
|
||||
void SetAlignment(int value);
|
||||
int GetBold();
|
||||
void SetBold(int value);
|
||||
int GetSevenSegment();
|
||||
void SetSevenSegment(int value);
|
||||
int GetLength();
|
||||
void SetLength(int value);
|
||||
int GetLeftPadding();
|
||||
void SetLeftPadding(int value);
|
||||
void SetText(MwCXX::String value);
|
||||
int GetAlignment();
|
||||
void SetAlignment(int value);
|
||||
int GetBold();
|
||||
void SetBold(int value);
|
||||
int GetSevenSegment();
|
||||
void SetSevenSegment(int value);
|
||||
int GetLength();
|
||||
void SetLength(int value);
|
||||
int GetLeftPadding();
|
||||
void SetLeftPadding(int value);
|
||||
};
|
||||
}; // namespace MwCXX
|
||||
|
||||
|
|
|
|||
|
|
@ -12,14 +12,14 @@ namespace MwCXX {
|
|||
virtual void RegisterHandlers();
|
||||
|
||||
public:
|
||||
ListBox(MwWidget widget);
|
||||
ListBox(MwWidget widget, MwCXX::Base* parent = NULL);
|
||||
ListBox(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height);
|
||||
|
||||
int GetLeftPadding();
|
||||
int GetLeftPadding();
|
||||
void SetLeftPadding(int value);
|
||||
int GetHasHeading();
|
||||
int GetHasHeading();
|
||||
void SetHasHeading(int value);
|
||||
int GetSingleClickSelectable();
|
||||
int GetSingleClickSelectable();
|
||||
void SetSingleClickSelectable(int value);
|
||||
|
||||
virtual void OnListBoxActivate(int value) {};
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ namespace MwCXX {
|
|||
virtual void RegisterHandlers();
|
||||
|
||||
public:
|
||||
Menu(MwWidget widget);
|
||||
Menu(MwWidget widget, MwCXX::Base* parent = NULL);
|
||||
Menu(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height);
|
||||
|
||||
virtual void OnMenu(void* value) {};
|
||||
|
|
|
|||
|
|
@ -12,11 +12,11 @@ namespace MwCXX {
|
|||
virtual void RegisterHandlers();
|
||||
|
||||
public:
|
||||
NumberEntry(MwWidget widget);
|
||||
NumberEntry(MwWidget widget, MwCXX::Base* parent = NULL);
|
||||
NumberEntry(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height);
|
||||
|
||||
MwCXX::String GetText();
|
||||
void SetText(MwCXX::String value);
|
||||
void SetText(MwCXX::String value);
|
||||
|
||||
virtual void OnActivate() {};
|
||||
virtual void OnChanged() {};
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ namespace MwCXX {
|
|||
virtual void RegisterHandlers();
|
||||
|
||||
public:
|
||||
OpenGL(MwWidget widget);
|
||||
OpenGL(MwWidget widget, MwCXX::Base* parent = NULL);
|
||||
OpenGL(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height);
|
||||
};
|
||||
}; // namespace MwCXX
|
||||
|
|
|
|||
|
|
@ -12,14 +12,14 @@ namespace MwCXX {
|
|||
virtual void RegisterHandlers();
|
||||
|
||||
public:
|
||||
ProgressBar(MwWidget widget);
|
||||
ProgressBar(MwWidget widget, MwCXX::Base* parent = NULL);
|
||||
ProgressBar(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height);
|
||||
|
||||
int GetMinValue();
|
||||
int GetMinValue();
|
||||
void SetMinValue(int value);
|
||||
int GetMaxValue();
|
||||
int GetMaxValue();
|
||||
void SetMaxValue(int value);
|
||||
int GetValue();
|
||||
int GetValue();
|
||||
void SetValue(int value);
|
||||
};
|
||||
}; // namespace MwCXX
|
||||
|
|
|
|||
|
|
@ -12,10 +12,10 @@ namespace MwCXX {
|
|||
virtual void RegisterHandlers();
|
||||
|
||||
public:
|
||||
RadioBox(MwWidget widget);
|
||||
RadioBox(MwWidget widget, MwCXX::Base* parent = NULL);
|
||||
RadioBox(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height);
|
||||
|
||||
int GetChecked();
|
||||
int GetChecked();
|
||||
void SetChecked(int value);
|
||||
|
||||
virtual void OnChanged() {};
|
||||
|
|
|
|||
|
|
@ -12,20 +12,20 @@ namespace MwCXX {
|
|||
virtual void RegisterHandlers();
|
||||
|
||||
public:
|
||||
ScrollBar(MwWidget widget);
|
||||
ScrollBar(MwWidget widget, MwCXX::Base* parent = NULL);
|
||||
ScrollBar(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height);
|
||||
|
||||
int GetShowArrows();
|
||||
int GetShowArrows();
|
||||
void SetShowArrows(int value);
|
||||
int GetAreaShown();
|
||||
int GetAreaShown();
|
||||
void SetAreaShown(int value);
|
||||
int GetValue();
|
||||
int GetValue();
|
||||
void SetValue(int value);
|
||||
int GetMinValue();
|
||||
int GetMinValue();
|
||||
void SetMinValue(int value);
|
||||
int GetMaxValue();
|
||||
int GetMaxValue();
|
||||
void SetMaxValue(int value);
|
||||
int GetOrientation();
|
||||
int GetOrientation();
|
||||
void SetOrientation(int value);
|
||||
|
||||
virtual void OnChanged() {};
|
||||
|
|
|
|||
|
|
@ -12,10 +12,10 @@ namespace MwCXX {
|
|||
virtual void RegisterHandlers();
|
||||
|
||||
public:
|
||||
SubMenu(MwWidget widget);
|
||||
SubMenu(MwWidget widget, MwCXX::Base* parent = NULL);
|
||||
SubMenu(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height);
|
||||
|
||||
int GetLeftPadding();
|
||||
int GetLeftPadding();
|
||||
void SetLeftPadding(int value);
|
||||
};
|
||||
}; // namespace MwCXX
|
||||
|
|
|
|||
|
|
@ -12,12 +12,12 @@ namespace MwCXX {
|
|||
virtual void RegisterHandlers();
|
||||
|
||||
public:
|
||||
TreeView(MwWidget widget);
|
||||
TreeView(MwWidget widget, MwCXX::Base* parent = NULL);
|
||||
TreeView(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height);
|
||||
|
||||
int GetLeftPadding();
|
||||
int GetLeftPadding();
|
||||
void SetLeftPadding(int value);
|
||||
int GetSingleClickSelectable();
|
||||
int GetSingleClickSelectable();
|
||||
void SetSingleClickSelectable(int value);
|
||||
|
||||
virtual void OnTreeViewActivate(void* value) {};
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ namespace MwCXX {
|
|||
virtual void RegisterHandlers();
|
||||
|
||||
public:
|
||||
Viewport(MwWidget widget);
|
||||
Viewport(MwWidget widget, MwCXX::Base* parent = NULL);
|
||||
Viewport(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height);
|
||||
};
|
||||
}; // namespace MwCXX
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ namespace MwCXX {
|
|||
virtual void RegisterHandlers();
|
||||
|
||||
public:
|
||||
Vulkan(MwWidget widget);
|
||||
Vulkan(MwWidget widget, MwCXX::Base* parent = NULL);
|
||||
Vulkan(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height);
|
||||
};
|
||||
}; // namespace MwCXX
|
||||
|
|
|
|||
|
|
@ -12,21 +12,21 @@ namespace MwCXX {
|
|||
virtual void RegisterHandlers();
|
||||
|
||||
public:
|
||||
Window(MwWidget widget);
|
||||
Window(MwWidget widget, MwCXX::Base* parent = NULL);
|
||||
Window(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height);
|
||||
|
||||
MwCXX::String GetTitle();
|
||||
void SetTitle(MwCXX::String value);
|
||||
int GetMain();
|
||||
void SetMain(int value);
|
||||
MwLLPixmap GetIconPixmap();
|
||||
void SetIconPixmap(MwLLPixmap value);
|
||||
MwSizeHints* GetSizeHints();
|
||||
void SetSizeHints(MwSizeHints* value);
|
||||
int GetHasBorder();
|
||||
void SetHasBorder(int value);
|
||||
int GetInverted();
|
||||
void SetInverted(int value);
|
||||
void SetTitle(MwCXX::String value);
|
||||
int GetMain();
|
||||
void SetMain(int value);
|
||||
MwLLPixmap GetIconPixmap();
|
||||
void SetIconPixmap(MwLLPixmap value);
|
||||
MwSizeHints* GetSizeHints();
|
||||
void SetSizeHints(MwSizeHints* value);
|
||||
int GetHasBorder();
|
||||
void SetHasBorder(int value);
|
||||
int GetInverted();
|
||||
void SetInverted(int value);
|
||||
};
|
||||
}; // namespace MwCXX
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
#include <MwCXX/Widget/Base.h>
|
||||
|
||||
MwCXX::Base::Base(MwWidget widget) {
|
||||
MwCXX::Base::Base(MwWidget widget, MwCXX::Base* parent) {
|
||||
this->widget = widget;
|
||||
this->parent = parent;
|
||||
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
|
@ -13,9 +14,30 @@ MwCXX::Base::Base(MwClass widget_class, MwCXX::String name, MwCXX::Base* parent,
|
|||
this->widget = MwCreateWidget(widget_class, name.c_str(), parent == NULL ? NULL : parent->widget, x, y, width, height);
|
||||
#endif
|
||||
|
||||
this->parent = parent;
|
||||
|
||||
if(parent != NULL) parent->children.push_back(this);
|
||||
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
MwCXX::Base::~Base(){
|
||||
for(int i = 0; i < this->children.size(); i++){
|
||||
delete this->children[i];
|
||||
}
|
||||
|
||||
if(this->parent != NULL){
|
||||
for(int i = 0; i < this->parent->children.size(); i++){
|
||||
if(this->parent->children[i] == this){
|
||||
this->parent->children.erase(this->parent->children.begin() + i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MwDestroyWidget(this->widget);
|
||||
}
|
||||
|
||||
MwRect MwCXX::Base::GetArea() {
|
||||
MwRect rc;
|
||||
|
||||
|
|
@ -50,6 +72,18 @@ void MwCXX::Base::Resize(unsigned int width, unsigned int height) {
|
|||
NULL);
|
||||
}
|
||||
|
||||
int MwCXX::Base::Step() {
|
||||
return MwStep(this->widget);
|
||||
}
|
||||
|
||||
int MwCXX::Base::Pending() {
|
||||
return MwPending(this->widget);
|
||||
}
|
||||
|
||||
void MwCXX::Base::Loop() {
|
||||
MwLoop(this->widget);
|
||||
}
|
||||
|
||||
MwCXX::Base* MwCXX::Base::GetParent(){
|
||||
return this->parent;
|
||||
}
|
||||
226
src/widget/baseauto.cc
Normal file
226
src/widget/baseauto.cc
Normal file
|
|
@ -0,0 +1,226 @@
|
|||
#include <MwCXX/Widget/Base.h>
|
||||
MwCXX::String MwCXX::Base::GetBackground() {
|
||||
return (MwCXX::String)MwGetText(this->widget, MwNbackground);
|
||||
}
|
||||
|
||||
void MwCXX::Base::SetBackground(MwCXX::String value) {
|
||||
#ifndef MWCXX_USE_C_STRING
|
||||
MwSetText(this->widget, MwNbackground, value.c_str());
|
||||
#else
|
||||
MwSetText(this->widget, MwNbackground, (MwCXX::String)value);
|
||||
#endif
|
||||
}
|
||||
|
||||
MwLLPixmap MwCXX::Base::GetBackgroundPixmap() {
|
||||
return (MwLLPixmap)MwGetVoid(this->widget, MwNbackgroundPixmap);
|
||||
}
|
||||
|
||||
void MwCXX::Base::SetBackgroundPixmap(MwLLPixmap value) {
|
||||
MwSetVoid(this->widget, MwNbackgroundPixmap, (MwLLPixmap)value);
|
||||
}
|
||||
|
||||
int MwCXX::Base::GetBitmapFont() {
|
||||
return (int)MwGetInteger(this->widget, MwNbitmapFont);
|
||||
}
|
||||
|
||||
void MwCXX::Base::SetBitmapFont(int value) {
|
||||
MwSetInteger(this->widget, MwNbitmapFont, (int)value);
|
||||
}
|
||||
|
||||
int MwCXX::Base::GetBorderWidth() {
|
||||
return (int)MwGetInteger(this->widget, MwNborderWidth);
|
||||
}
|
||||
|
||||
void MwCXX::Base::SetBorderWidth(int value) {
|
||||
MwSetInteger(this->widget, MwNborderWidth, (int)value);
|
||||
}
|
||||
|
||||
int MwCXX::Base::GetDarkTheme() {
|
||||
return (int)MwGetInteger(this->widget, MwNdarkTheme);
|
||||
}
|
||||
|
||||
void MwCXX::Base::SetDarkTheme(int value) {
|
||||
MwSetInteger(this->widget, MwNdarkTheme, (int)value);
|
||||
}
|
||||
|
||||
int MwCXX::Base::GetFixedSize() {
|
||||
return (int)MwGetInteger(this->widget, MwNfixedSize);
|
||||
}
|
||||
|
||||
void MwCXX::Base::SetFixedSize(int value) {
|
||||
MwSetInteger(this->widget, MwNfixedSize, (int)value);
|
||||
}
|
||||
|
||||
int MwCXX::Base::GetForceInverted() {
|
||||
return (int)MwGetInteger(this->widget, MwNforceInverted);
|
||||
}
|
||||
|
||||
void MwCXX::Base::SetForceInverted(int value) {
|
||||
MwSetInteger(this->widget, MwNforceInverted, (int)value);
|
||||
}
|
||||
|
||||
MwCXX::String MwCXX::Base::GetForeground() {
|
||||
return (MwCXX::String)MwGetText(this->widget, MwNforeground);
|
||||
}
|
||||
|
||||
void MwCXX::Base::SetForeground(MwCXX::String value) {
|
||||
#ifndef MWCXX_USE_C_STRING
|
||||
MwSetText(this->widget, MwNforeground, value.c_str());
|
||||
#else
|
||||
MwSetText(this->widget, MwNforeground, (MwCXX::String)value);
|
||||
#endif
|
||||
}
|
||||
|
||||
int MwCXX::Base::GetHeight() {
|
||||
return (int)MwGetInteger(this->widget, MwNheight);
|
||||
}
|
||||
|
||||
void MwCXX::Base::SetHeight(int value) {
|
||||
MwSetInteger(this->widget, MwNheight, (int)value);
|
||||
}
|
||||
|
||||
int MwCXX::Base::GetIsRounded() {
|
||||
return (int)MwGetInteger(this->widget, MwNisRounded);
|
||||
}
|
||||
|
||||
void MwCXX::Base::SetIsRounded(int value) {
|
||||
MwSetInteger(this->widget, MwNisRounded, (int)value);
|
||||
}
|
||||
|
||||
int MwCXX::Base::GetModernLook() {
|
||||
return (int)MwGetInteger(this->widget, MwNmodernLook);
|
||||
}
|
||||
|
||||
void MwCXX::Base::SetModernLook(int value) {
|
||||
MwSetInteger(this->widget, MwNmodernLook, (int)value);
|
||||
}
|
||||
|
||||
int MwCXX::Base::GetRatio() {
|
||||
return (int)MwGetInteger(this->widget, MwNratio);
|
||||
}
|
||||
|
||||
void MwCXX::Base::SetRatio(int value) {
|
||||
MwSetInteger(this->widget, MwNratio, (int)value);
|
||||
}
|
||||
|
||||
MwCXX::String MwCXX::Base::GetSubBackground() {
|
||||
return (MwCXX::String)MwGetText(this->widget, MwNsubBackground);
|
||||
}
|
||||
|
||||
void MwCXX::Base::SetSubBackground(MwCXX::String value) {
|
||||
#ifndef MWCXX_USE_C_STRING
|
||||
MwSetText(this->widget, MwNsubBackground, value.c_str());
|
||||
#else
|
||||
MwSetText(this->widget, MwNsubBackground, (MwCXX::String)value);
|
||||
#endif
|
||||
}
|
||||
|
||||
MwCXX::String MwCXX::Base::GetSubForeground() {
|
||||
return (MwCXX::String)MwGetText(this->widget, MwNsubForeground);
|
||||
}
|
||||
|
||||
void MwCXX::Base::SetSubForeground(MwCXX::String value) {
|
||||
#ifndef MWCXX_USE_C_STRING
|
||||
MwSetText(this->widget, MwNsubForeground, value.c_str());
|
||||
#else
|
||||
MwSetText(this->widget, MwNsubForeground, (MwCXX::String)value);
|
||||
#endif
|
||||
}
|
||||
|
||||
int MwCXX::Base::GetUseMonospace() {
|
||||
return (int)MwGetInteger(this->widget, MwNuseMonospace);
|
||||
}
|
||||
|
||||
void MwCXX::Base::SetUseMonospace(int value) {
|
||||
MwSetInteger(this->widget, MwNuseMonospace, (int)value);
|
||||
}
|
||||
|
||||
int MwCXX::Base::GetWaitMS() {
|
||||
return (int)MwGetInteger(this->widget, MwNwaitMS);
|
||||
}
|
||||
|
||||
void MwCXX::Base::SetWaitMS(int value) {
|
||||
MwSetInteger(this->widget, MwNwaitMS, (int)value);
|
||||
}
|
||||
|
||||
int MwCXX::Base::GetWidth() {
|
||||
return (int)MwGetInteger(this->widget, MwNwidth);
|
||||
}
|
||||
|
||||
void MwCXX::Base::SetWidth(int value) {
|
||||
MwSetInteger(this->widget, MwNwidth, (int)value);
|
||||
}
|
||||
|
||||
int MwCXX::Base::GetX() {
|
||||
return (int)MwGetInteger(this->widget, MwNx);
|
||||
}
|
||||
|
||||
void MwCXX::Base::SetX(int value) {
|
||||
MwSetInteger(this->widget, MwNx, (int)value);
|
||||
}
|
||||
|
||||
int MwCXX::Base::GetY() {
|
||||
return (int)MwGetInteger(this->widget, MwNy);
|
||||
}
|
||||
|
||||
void MwCXX::Base::SetY(int value) {
|
||||
MwSetInteger(this->widget, MwNy, (int)value);
|
||||
}
|
||||
|
||||
static void __OnClipboard(MwWidget handle, void* user, void* call) {
|
||||
((MwCXX::Base*)user)->OnClipboard((MwCXX::String)(char*)call);
|
||||
}
|
||||
|
||||
static void __OnDarkTheme(MwWidget handle, void* user, void* call) {
|
||||
((MwCXX::Base*)user)->OnDarkTheme(*(int*)call);
|
||||
}
|
||||
|
||||
static void __OnFocusIn(MwWidget handle, void* user, void* call) {
|
||||
((MwCXX::Base*)user)->OnFocusIn();
|
||||
}
|
||||
|
||||
static void __OnFocusOut(MwWidget handle, void* user, void* call) {
|
||||
((MwCXX::Base*)user)->OnFocusOut();
|
||||
}
|
||||
|
||||
static void __OnKey(MwWidget handle, void* user, void* call) {
|
||||
((MwCXX::Base*)user)->OnKey(*(int*)call);
|
||||
}
|
||||
|
||||
static void __OnKeyRelease(MwWidget handle, void* user, void* call) {
|
||||
((MwCXX::Base*)user)->OnKeyRelease(*(int*)call);
|
||||
}
|
||||
|
||||
static void __OnMouseDown(MwWidget handle, void* user, void* call) {
|
||||
((MwCXX::Base*)user)->OnMouseDown(*(MwMouse*)call);
|
||||
}
|
||||
|
||||
static void __OnMouseMove(MwWidget handle, void* user, void* call) {
|
||||
((MwCXX::Base*)user)->OnMouseMove(*(MwPoint*)call);
|
||||
}
|
||||
|
||||
static void __OnMouseUp(MwWidget handle, void* user, void* call) {
|
||||
((MwCXX::Base*)user)->OnMouseUp(*(MwMouse*)call);
|
||||
}
|
||||
|
||||
static void __OnResize(MwWidget handle, void* user, void* call) {
|
||||
((MwCXX::Base*)user)->OnResize();
|
||||
}
|
||||
|
||||
static void __OnTick(MwWidget handle, void* user, void* call) {
|
||||
((MwCXX::Base*)user)->OnTick();
|
||||
}
|
||||
|
||||
void MwCXX::Base::RegisterHandlers() {
|
||||
MwAddUserHandler(this->widget, MwNclipboardHandler, __OnClipboard, (void*)this);
|
||||
MwAddUserHandler(this->widget, MwNdarkThemeHandler, __OnDarkTheme, (void*)this);
|
||||
MwAddUserHandler(this->widget, MwNfocusInHandler, __OnFocusIn, (void*)this);
|
||||
MwAddUserHandler(this->widget, MwNfocusOutHandler, __OnFocusOut, (void*)this);
|
||||
MwAddUserHandler(this->widget, MwNkeyHandler, __OnKey, (void*)this);
|
||||
MwAddUserHandler(this->widget, MwNkeyReleaseHandler, __OnKeyRelease, (void*)this);
|
||||
MwAddUserHandler(this->widget, MwNmouseDownHandler, __OnMouseDown, (void*)this);
|
||||
MwAddUserHandler(this->widget, MwNmouseMoveHandler, __OnMouseMove, (void*)this);
|
||||
MwAddUserHandler(this->widget, MwNmouseUpHandler, __OnMouseUp, (void*)this);
|
||||
MwAddUserHandler(this->widget, MwNresizeHandler, __OnResize, (void*)this);
|
||||
MwAddUserHandler(this->widget, MwNtickHandler, __OnTick, (void*)this);
|
||||
}
|
||||
52
src/widget/box.cc
Normal file
52
src/widget/box.cc
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
#include <MwCXX/Widget/Box.h>
|
||||
|
||||
MwCXX::Box::Box(MwWidget widget, MwCXX::Base* parent) : MwCXX::Base(widget, parent) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
MwCXX::Box::Box(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwBoxClass, name, parent, x, y, width, height) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
int MwCXX::Box::GetOrientation() {
|
||||
return (int)MwGetInteger(this->widget, MwNorientation);
|
||||
}
|
||||
|
||||
void MwCXX::Box::SetOrientation(int value) {
|
||||
MwSetInteger(this->widget, MwNorientation, (int)value);
|
||||
}
|
||||
|
||||
int MwCXX::Box::GetMargin() {
|
||||
return (int)MwGetInteger(this->widget, MwNmargin);
|
||||
}
|
||||
|
||||
void MwCXX::Box::SetMargin(int value) {
|
||||
MwSetInteger(this->widget, MwNmargin, (int)value);
|
||||
}
|
||||
|
||||
int MwCXX::Box::GetPadding() {
|
||||
return (int)MwGetInteger(this->widget, MwNpadding);
|
||||
}
|
||||
|
||||
void MwCXX::Box::SetPadding(int value) {
|
||||
MwSetInteger(this->widget, MwNpadding, (int)value);
|
||||
}
|
||||
|
||||
int MwCXX::Box::GetHasBorder() {
|
||||
return (int)MwGetInteger(this->widget, MwNhasBorder);
|
||||
}
|
||||
|
||||
void MwCXX::Box::SetHasBorder(int value) {
|
||||
MwSetInteger(this->widget, MwNhasBorder, (int)value);
|
||||
}
|
||||
|
||||
int MwCXX::Box::GetInverted() {
|
||||
return (int)MwGetInteger(this->widget, MwNinverted);
|
||||
}
|
||||
|
||||
void MwCXX::Box::SetInverted(int value) {
|
||||
MwSetInteger(this->widget, MwNinverted, (int)value);
|
||||
}
|
||||
|
||||
void MwCXX::Box::RegisterHandlers() {
|
||||
}
|
||||
|
|
@ -1,12 +1,10 @@
|
|||
#include <MwCXX/Widget/Box.h>
|
||||
|
||||
MwCXX::Box::Box(MwWidget widget)
|
||||
: MwCXX::Base(widget) {
|
||||
MwCXX::Box::Box(MwWidget widget, MwCXX::Base* parent) : MwCXX::Base(widget, parent) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
MwCXX::Box::Box(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height)
|
||||
: MwCXX::Base(MwBoxClass, name, parent, x, y, width, height) {
|
||||
MwCXX::Box::Box(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwBoxClass, name, parent, x, y, width, height) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
|
|
|
|||
66
src/widget/button.cc
Normal file
66
src/widget/button.cc
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
#include <MwCXX/Widget/Button.h>
|
||||
|
||||
MwCXX::Button::Button(MwWidget widget, MwCXX::Base* parent) : MwCXX::Base(widget, parent) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
MwCXX::Button::Button(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwButtonClass, name, parent, x, y, width, height) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
MwLLPixmap MwCXX::Button::GetPixmap() {
|
||||
return (MwLLPixmap)MwGetVoid(this->widget, MwNpixmap);
|
||||
}
|
||||
|
||||
void MwCXX::Button::SetPixmap(MwLLPixmap value) {
|
||||
MwSetVoid(this->widget, MwNpixmap, (MwLLPixmap)value);
|
||||
}
|
||||
|
||||
MwCXX::String MwCXX::Button::GetText() {
|
||||
return (MwCXX::String)MwGetText(this->widget, MwNtext);
|
||||
}
|
||||
|
||||
void MwCXX::Button::SetText(MwCXX::String value) {
|
||||
#ifndef MWCXX_USE_C_STRING
|
||||
MwSetText(this->widget, MwNtext, value.c_str());
|
||||
#else
|
||||
MwSetText(this->widget, MwNtext, (MwCXX::String)value);
|
||||
#endif
|
||||
}
|
||||
|
||||
int MwCXX::Button::GetFlat() {
|
||||
return (int)MwGetInteger(this->widget, MwNflat);
|
||||
}
|
||||
|
||||
void MwCXX::Button::SetFlat(int value) {
|
||||
MwSetInteger(this->widget, MwNflat, (int)value);
|
||||
}
|
||||
|
||||
int MwCXX::Button::GetPadding() {
|
||||
return (int)MwGetInteger(this->widget, MwNpadding);
|
||||
}
|
||||
|
||||
void MwCXX::Button::SetPadding(int value) {
|
||||
MwSetInteger(this->widget, MwNpadding, (int)value);
|
||||
}
|
||||
|
||||
int MwCXX::Button::GetFillArea() {
|
||||
return (int)MwGetInteger(this->widget, MwNfillArea);
|
||||
}
|
||||
|
||||
void MwCXX::Button::SetFillArea(int value) {
|
||||
MwSetInteger(this->widget, MwNfillArea, (int)value);
|
||||
}
|
||||
|
||||
static void __OnActivate(MwWidget handle, void* user, void* call) {
|
||||
((MwCXX::Button*)user)->OnActivate();
|
||||
}
|
||||
|
||||
static void __OnChanged(MwWidget handle, void* user, void* call) {
|
||||
((MwCXX::Button*)user)->OnChanged();
|
||||
}
|
||||
|
||||
void MwCXX::Button::RegisterHandlers() {
|
||||
MwAddUserHandler(this->widget, MwNactivateHandler, __OnActivate, (void*)this);
|
||||
MwAddUserHandler(this->widget, MwNchangedHandler, __OnChanged, (void*)this);
|
||||
}
|
||||
|
|
@ -1,12 +1,10 @@
|
|||
#include <MwCXX/Widget/Button.h>
|
||||
|
||||
MwCXX::Button::Button(MwWidget widget)
|
||||
: MwCXX::Base(widget) {
|
||||
MwCXX::Button::Button(MwWidget widget, MwCXX::Base* parent) : MwCXX::Base(widget, parent) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
MwCXX::Button::Button(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height)
|
||||
: MwCXX::Base(MwButtonClass, name, parent, x, y, width, height) {
|
||||
MwCXX::Button::Button(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwButtonClass, name, parent, x, y, width, height) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
|
|
|
|||
25
src/widget/checkbox.cc
Normal file
25
src/widget/checkbox.cc
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#include <MwCXX/Widget/CheckBox.h>
|
||||
|
||||
MwCXX::CheckBox::CheckBox(MwWidget widget, MwCXX::Base* parent) : MwCXX::Base(widget, parent) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
MwCXX::CheckBox::CheckBox(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwCheckBoxClass, name, parent, x, y, width, height) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
int MwCXX::CheckBox::GetChecked() {
|
||||
return (int)MwGetInteger(this->widget, MwNchecked);
|
||||
}
|
||||
|
||||
void MwCXX::CheckBox::SetChecked(int value) {
|
||||
MwSetInteger(this->widget, MwNchecked, (int)value);
|
||||
}
|
||||
|
||||
static void __OnChanged(MwWidget handle, void* user, void* call) {
|
||||
((MwCXX::CheckBox*)user)->OnChanged();
|
||||
}
|
||||
|
||||
void MwCXX::CheckBox::RegisterHandlers() {
|
||||
MwAddUserHandler(this->widget, MwNchangedHandler, __OnChanged, (void*)this);
|
||||
}
|
||||
|
|
@ -1,12 +1,10 @@
|
|||
#include <MwCXX/Widget/CheckBox.h>
|
||||
|
||||
MwCXX::CheckBox::CheckBox(MwWidget widget)
|
||||
: MwCXX::Base(widget) {
|
||||
MwCXX::CheckBox::CheckBox(MwWidget widget, MwCXX::Base* parent) : MwCXX::Base(widget, parent) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
MwCXX::CheckBox::CheckBox(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height)
|
||||
: MwCXX::Base(MwCheckBoxClass, name, parent, x, y, width, height) {
|
||||
MwCXX::CheckBox::CheckBox(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwCheckBoxClass, name, parent, x, y, width, height) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
|
|
|
|||
33
src/widget/combobox.cc
Normal file
33
src/widget/combobox.cc
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
#include <MwCXX/Widget/ComboBox.h>
|
||||
|
||||
MwCXX::ComboBox::ComboBox(MwWidget widget, MwCXX::Base* parent) : MwCXX::Base(widget, parent) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
MwCXX::ComboBox::ComboBox(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwComboBoxClass, name, parent, x, y, width, height) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
int MwCXX::ComboBox::GetAreaShown() {
|
||||
return (int)MwGetInteger(this->widget, MwNareaShown);
|
||||
}
|
||||
|
||||
void MwCXX::ComboBox::SetAreaShown(int value) {
|
||||
MwSetInteger(this->widget, MwNareaShown, (int)value);
|
||||
}
|
||||
|
||||
int MwCXX::ComboBox::GetValue() {
|
||||
return (int)MwGetInteger(this->widget, MwNvalue);
|
||||
}
|
||||
|
||||
void MwCXX::ComboBox::SetValue(int value) {
|
||||
MwSetInteger(this->widget, MwNvalue, (int)value);
|
||||
}
|
||||
|
||||
static void __OnComboBoxChanged(MwWidget handle, void* user, void* call) {
|
||||
((MwCXX::ComboBox*)user)->OnComboBoxChanged(*(int*)call);
|
||||
}
|
||||
|
||||
void MwCXX::ComboBox::RegisterHandlers() {
|
||||
MwAddUserHandler(this->widget, MwNcomboBoxChangedHandler, __OnComboBoxChanged, (void*)this);
|
||||
}
|
||||
|
|
@ -1,12 +1,10 @@
|
|||
#include <MwCXX/Widget/ComboBox.h>
|
||||
|
||||
MwCXX::ComboBox::ComboBox(MwWidget widget)
|
||||
: MwCXX::Base(widget) {
|
||||
MwCXX::ComboBox::ComboBox(MwWidget widget, MwCXX::Base* parent) : MwCXX::Base(widget, parent) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
MwCXX::ComboBox::ComboBox(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height)
|
||||
: MwCXX::Base(MwComboBoxClass, name, parent, x, y, width, height) {
|
||||
MwCXX::ComboBox::ComboBox(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwComboBoxClass, name, parent, x, y, width, height) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
|
|
|
|||
42
src/widget/entry.cc
Normal file
42
src/widget/entry.cc
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
#include <MwCXX/Widget/Entry.h>
|
||||
|
||||
MwCXX::Entry::Entry(MwWidget widget, MwCXX::Base* parent) : MwCXX::Base(widget, parent) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
MwCXX::Entry::Entry(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwEntryClass, name, parent, x, y, width, height) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
MwCXX::String MwCXX::Entry::GetText() {
|
||||
return (MwCXX::String)MwGetText(this->widget, MwNtext);
|
||||
}
|
||||
|
||||
void MwCXX::Entry::SetText(MwCXX::String value) {
|
||||
#ifndef MWCXX_USE_C_STRING
|
||||
MwSetText(this->widget, MwNtext, value.c_str());
|
||||
#else
|
||||
MwSetText(this->widget, MwNtext, (MwCXX::String)value);
|
||||
#endif
|
||||
}
|
||||
|
||||
int MwCXX::Entry::GetHideInput() {
|
||||
return (int)MwGetInteger(this->widget, MwNhideInput);
|
||||
}
|
||||
|
||||
void MwCXX::Entry::SetHideInput(int value) {
|
||||
MwSetInteger(this->widget, MwNhideInput, (int)value);
|
||||
}
|
||||
|
||||
static void __OnActivate(MwWidget handle, void* user, void* call) {
|
||||
((MwCXX::Entry*)user)->OnActivate();
|
||||
}
|
||||
|
||||
static void __OnChanged(MwWidget handle, void* user, void* call) {
|
||||
((MwCXX::Entry*)user)->OnChanged();
|
||||
}
|
||||
|
||||
void MwCXX::Entry::RegisterHandlers() {
|
||||
MwAddUserHandler(this->widget, MwNactivateHandler, __OnActivate, (void*)this);
|
||||
MwAddUserHandler(this->widget, MwNchangedHandler, __OnChanged, (void*)this);
|
||||
}
|
||||
|
|
@ -1,12 +1,10 @@
|
|||
#include <MwCXX/Widget/Entry.h>
|
||||
|
||||
MwCXX::Entry::Entry(MwWidget widget)
|
||||
: MwCXX::Base(widget) {
|
||||
MwCXX::Entry::Entry(MwWidget widget, MwCXX::Base* parent) : MwCXX::Base(widget, parent) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
MwCXX::Entry::Entry(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height)
|
||||
: MwCXX::Base(MwEntryClass, name, parent, x, y, width, height) {
|
||||
MwCXX::Entry::Entry(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwEntryClass, name, parent, x, y, width, height) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
|
|
|
|||
28
src/widget/frame.cc
Normal file
28
src/widget/frame.cc
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
#include <MwCXX/Widget/Frame.h>
|
||||
|
||||
MwCXX::Frame::Frame(MwWidget widget, MwCXX::Base* parent) : MwCXX::Base(widget, parent) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
MwCXX::Frame::Frame(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwFrameClass, name, parent, x, y, width, height) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
int MwCXX::Frame::GetHasBorder() {
|
||||
return (int)MwGetInteger(this->widget, MwNhasBorder);
|
||||
}
|
||||
|
||||
void MwCXX::Frame::SetHasBorder(int value) {
|
||||
MwSetInteger(this->widget, MwNhasBorder, (int)value);
|
||||
}
|
||||
|
||||
int MwCXX::Frame::GetInverted() {
|
||||
return (int)MwGetInteger(this->widget, MwNinverted);
|
||||
}
|
||||
|
||||
void MwCXX::Frame::SetInverted(int value) {
|
||||
MwSetInteger(this->widget, MwNinverted, (int)value);
|
||||
}
|
||||
|
||||
void MwCXX::Frame::RegisterHandlers() {
|
||||
}
|
||||
|
|
@ -1,12 +1,10 @@
|
|||
#include <MwCXX/Widget/Frame.h>
|
||||
|
||||
MwCXX::Frame::Frame(MwWidget widget)
|
||||
: MwCXX::Base(widget) {
|
||||
MwCXX::Frame::Frame(MwWidget widget, MwCXX::Base* parent) : MwCXX::Base(widget, parent) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
MwCXX::Frame::Frame(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height)
|
||||
: MwCXX::Base(MwFrameClass, name, parent, x, y, width, height) {
|
||||
MwCXX::Frame::Frame(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwFrameClass, name, parent, x, y, width, height) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
|
|
|
|||
44
src/widget/image.cc
Normal file
44
src/widget/image.cc
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
#include <MwCXX/Widget/Image.h>
|
||||
|
||||
MwCXX::Image::Image(MwWidget widget, MwCXX::Base* parent) : MwCXX::Base(widget, parent) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
MwCXX::Image::Image(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwImageClass, name, parent, x, y, width, height) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
MwLLPixmap MwCXX::Image::GetPixmap() {
|
||||
return (MwLLPixmap)MwGetVoid(this->widget, MwNpixmap);
|
||||
}
|
||||
|
||||
void MwCXX::Image::SetPixmap(MwLLPixmap value) {
|
||||
MwSetVoid(this->widget, MwNpixmap, (MwLLPixmap)value);
|
||||
}
|
||||
|
||||
int MwCXX::Image::GetHasBorder() {
|
||||
return (int)MwGetInteger(this->widget, MwNhasBorder);
|
||||
}
|
||||
|
||||
void MwCXX::Image::SetHasBorder(int value) {
|
||||
MwSetInteger(this->widget, MwNhasBorder, (int)value);
|
||||
}
|
||||
|
||||
int MwCXX::Image::GetInverted() {
|
||||
return (int)MwGetInteger(this->widget, MwNinverted);
|
||||
}
|
||||
|
||||
void MwCXX::Image::SetInverted(int value) {
|
||||
MwSetInteger(this->widget, MwNinverted, (int)value);
|
||||
}
|
||||
|
||||
int MwCXX::Image::GetFillArea() {
|
||||
return (int)MwGetInteger(this->widget, MwNfillArea);
|
||||
}
|
||||
|
||||
void MwCXX::Image::SetFillArea(int value) {
|
||||
MwSetInteger(this->widget, MwNfillArea, (int)value);
|
||||
}
|
||||
|
||||
void MwCXX::Image::RegisterHandlers() {
|
||||
}
|
||||
|
|
@ -1,12 +1,10 @@
|
|||
#include <MwCXX/Widget/Image.h>
|
||||
|
||||
MwCXX::Image::Image(MwWidget widget)
|
||||
: MwCXX::Base(widget) {
|
||||
MwCXX::Image::Image(MwWidget widget, MwCXX::Base* parent) : MwCXX::Base(widget, parent) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
MwCXX::Image::Image(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height)
|
||||
: MwCXX::Base(MwImageClass, name, parent, x, y, width, height) {
|
||||
MwCXX::Image::Image(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwImageClass, name, parent, x, y, width, height) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
|
|
|
|||
64
src/widget/label.cc
Normal file
64
src/widget/label.cc
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
#include <MwCXX/Widget/Label.h>
|
||||
|
||||
MwCXX::Label::Label(MwWidget widget, MwCXX::Base* parent) : MwCXX::Base(widget, parent) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
MwCXX::Label::Label(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwLabelClass, name, parent, x, y, width, height) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
MwCXX::String MwCXX::Label::GetText() {
|
||||
return (MwCXX::String)MwGetText(this->widget, MwNtext);
|
||||
}
|
||||
|
||||
void MwCXX::Label::SetText(MwCXX::String value) {
|
||||
#ifndef MWCXX_USE_C_STRING
|
||||
MwSetText(this->widget, MwNtext, value.c_str());
|
||||
#else
|
||||
MwSetText(this->widget, MwNtext, (MwCXX::String)value);
|
||||
#endif
|
||||
}
|
||||
|
||||
int MwCXX::Label::GetAlignment() {
|
||||
return (int)MwGetInteger(this->widget, MwNalignment);
|
||||
}
|
||||
|
||||
void MwCXX::Label::SetAlignment(int value) {
|
||||
MwSetInteger(this->widget, MwNalignment, (int)value);
|
||||
}
|
||||
|
||||
int MwCXX::Label::GetBold() {
|
||||
return (int)MwGetInteger(this->widget, MwNbold);
|
||||
}
|
||||
|
||||
void MwCXX::Label::SetBold(int value) {
|
||||
MwSetInteger(this->widget, MwNbold, (int)value);
|
||||
}
|
||||
|
||||
int MwCXX::Label::GetSevenSegment() {
|
||||
return (int)MwGetInteger(this->widget, MwNsevenSegment);
|
||||
}
|
||||
|
||||
void MwCXX::Label::SetSevenSegment(int value) {
|
||||
MwSetInteger(this->widget, MwNsevenSegment, (int)value);
|
||||
}
|
||||
|
||||
int MwCXX::Label::GetLength() {
|
||||
return (int)MwGetInteger(this->widget, MwNlength);
|
||||
}
|
||||
|
||||
void MwCXX::Label::SetLength(int value) {
|
||||
MwSetInteger(this->widget, MwNlength, (int)value);
|
||||
}
|
||||
|
||||
int MwCXX::Label::GetLeftPadding() {
|
||||
return (int)MwGetInteger(this->widget, MwNleftPadding);
|
||||
}
|
||||
|
||||
void MwCXX::Label::SetLeftPadding(int value) {
|
||||
MwSetInteger(this->widget, MwNleftPadding, (int)value);
|
||||
}
|
||||
|
||||
void MwCXX::Label::RegisterHandlers() {
|
||||
}
|
||||
|
|
@ -1,12 +1,10 @@
|
|||
#include <MwCXX/Widget/Label.h>
|
||||
|
||||
MwCXX::Label::Label(MwWidget widget)
|
||||
: MwCXX::Base(widget) {
|
||||
MwCXX::Label::Label(MwWidget widget, MwCXX::Base* parent) : MwCXX::Base(widget, parent) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
MwCXX::Label::Label(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height)
|
||||
: MwCXX::Base(MwLabelClass, name, parent, x, y, width, height) {
|
||||
MwCXX::Label::Label(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwLabelClass, name, parent, x, y, width, height) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
|
|
|
|||
41
src/widget/listbox.cc
Normal file
41
src/widget/listbox.cc
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
#include <MwCXX/Widget/ListBox.h>
|
||||
|
||||
MwCXX::ListBox::ListBox(MwWidget widget, MwCXX::Base* parent) : MwCXX::Base(widget, parent) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
MwCXX::ListBox::ListBox(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwListBoxClass, name, parent, x, y, width, height) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
int MwCXX::ListBox::GetLeftPadding() {
|
||||
return (int)MwGetInteger(this->widget, MwNleftPadding);
|
||||
}
|
||||
|
||||
void MwCXX::ListBox::SetLeftPadding(int value) {
|
||||
MwSetInteger(this->widget, MwNleftPadding, (int)value);
|
||||
}
|
||||
|
||||
int MwCXX::ListBox::GetHasHeading() {
|
||||
return (int)MwGetInteger(this->widget, MwNhasHeading);
|
||||
}
|
||||
|
||||
void MwCXX::ListBox::SetHasHeading(int value) {
|
||||
MwSetInteger(this->widget, MwNhasHeading, (int)value);
|
||||
}
|
||||
|
||||
int MwCXX::ListBox::GetSingleClickSelectable() {
|
||||
return (int)MwGetInteger(this->widget, MwNsingleClickSelectable);
|
||||
}
|
||||
|
||||
void MwCXX::ListBox::SetSingleClickSelectable(int value) {
|
||||
MwSetInteger(this->widget, MwNsingleClickSelectable, (int)value);
|
||||
}
|
||||
|
||||
static void __OnListBoxActivate(MwWidget handle, void* user, void* call) {
|
||||
((MwCXX::ListBox*)user)->OnListBoxActivate(*(int*)call);
|
||||
}
|
||||
|
||||
void MwCXX::ListBox::RegisterHandlers() {
|
||||
MwAddUserHandler(this->widget, MwNlistBoxActivateHandler, __OnListBoxActivate, (void*)this);
|
||||
}
|
||||
|
|
@ -1,12 +1,10 @@
|
|||
#include <MwCXX/Widget/ListBox.h>
|
||||
|
||||
MwCXX::ListBox::ListBox(MwWidget widget)
|
||||
: MwCXX::Base(widget) {
|
||||
MwCXX::ListBox::ListBox(MwWidget widget, MwCXX::Base* parent) : MwCXX::Base(widget, parent) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
MwCXX::ListBox::ListBox(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height)
|
||||
: MwCXX::Base(MwListBoxClass, name, parent, x, y, width, height) {
|
||||
MwCXX::ListBox::ListBox(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwListBoxClass, name, parent, x, y, width, height) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
|
|
|
|||
17
src/widget/menu.cc
Normal file
17
src/widget/menu.cc
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#include <MwCXX/Widget/Menu.h>
|
||||
|
||||
MwCXX::Menu::Menu(MwWidget widget, MwCXX::Base* parent) : MwCXX::Base(widget, parent) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
MwCXX::Menu::Menu(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwMenuClass, name, parent, x, y, width, height) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
static void __OnMenu(MwWidget handle, void* user, void* call) {
|
||||
((MwCXX::Menu*)user)->OnMenu((void*)call);
|
||||
}
|
||||
|
||||
void MwCXX::Menu::RegisterHandlers() {
|
||||
MwAddUserHandler(this->widget, MwNmenuHandler, __OnMenu, (void*)this);
|
||||
}
|
||||
|
|
@ -1,12 +1,10 @@
|
|||
#include <MwCXX/Widget/Menu.h>
|
||||
|
||||
MwCXX::Menu::Menu(MwWidget widget)
|
||||
: MwCXX::Base(widget) {
|
||||
MwCXX::Menu::Menu(MwWidget widget, MwCXX::Base* parent) : MwCXX::Base(widget, parent) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
MwCXX::Menu::Menu(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height)
|
||||
: MwCXX::Base(MwMenuClass, name, parent, x, y, width, height) {
|
||||
MwCXX::Menu::Menu(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwMenuClass, name, parent, x, y, width, height) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
|
|
|
|||
34
src/widget/numberentry.cc
Normal file
34
src/widget/numberentry.cc
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
#include <MwCXX/Widget/NumberEntry.h>
|
||||
|
||||
MwCXX::NumberEntry::NumberEntry(MwWidget widget, MwCXX::Base* parent) : MwCXX::Base(widget, parent) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
MwCXX::NumberEntry::NumberEntry(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwNumberEntryClass, name, parent, x, y, width, height) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
MwCXX::String MwCXX::NumberEntry::GetText() {
|
||||
return (MwCXX::String)MwGetText(this->widget, MwNtext);
|
||||
}
|
||||
|
||||
void MwCXX::NumberEntry::SetText(MwCXX::String value) {
|
||||
#ifndef MWCXX_USE_C_STRING
|
||||
MwSetText(this->widget, MwNtext, value.c_str());
|
||||
#else
|
||||
MwSetText(this->widget, MwNtext, (MwCXX::String)value);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void __OnActivate(MwWidget handle, void* user, void* call) {
|
||||
((MwCXX::NumberEntry*)user)->OnActivate();
|
||||
}
|
||||
|
||||
static void __OnChanged(MwWidget handle, void* user, void* call) {
|
||||
((MwCXX::NumberEntry*)user)->OnChanged();
|
||||
}
|
||||
|
||||
void MwCXX::NumberEntry::RegisterHandlers() {
|
||||
MwAddUserHandler(this->widget, MwNactivateHandler, __OnActivate, (void*)this);
|
||||
MwAddUserHandler(this->widget, MwNchangedHandler, __OnChanged, (void*)this);
|
||||
}
|
||||
|
|
@ -1,12 +1,10 @@
|
|||
#include <MwCXX/Widget/NumberEntry.h>
|
||||
|
||||
MwCXX::NumberEntry::NumberEntry(MwWidget widget)
|
||||
: MwCXX::Base(widget) {
|
||||
MwCXX::NumberEntry::NumberEntry(MwWidget widget, MwCXX::Base* parent) : MwCXX::Base(widget, parent) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
MwCXX::NumberEntry::NumberEntry(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height)
|
||||
: MwCXX::Base(MwNumberEntryClass, name, parent, x, y, width, height) {
|
||||
MwCXX::NumberEntry::NumberEntry(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwNumberEntryClass, name, parent, x, y, width, height) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
|
|
|
|||
13
src/widget/opengl.cc
Normal file
13
src/widget/opengl.cc
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#define MW_OPENGL_NO_INCLUDE
|
||||
#include <MwCXX/Widget/OpenGL.h>
|
||||
|
||||
MwCXX::OpenGL::OpenGL(MwWidget widget, MwCXX::Base* parent) : MwCXX::Base(widget, parent) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
MwCXX::OpenGL::OpenGL(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwOpenGLClass, name, parent, x, y, width, height) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
void MwCXX::OpenGL::RegisterHandlers() {
|
||||
}
|
||||
|
|
@ -1,13 +1,11 @@
|
|||
#define MW_OPENGL_NO_INCLUDE
|
||||
#include <MwCXX/Widget/OpenGL.h>
|
||||
|
||||
MwCXX::OpenGL::OpenGL(MwWidget widget)
|
||||
: MwCXX::Base(widget) {
|
||||
MwCXX::OpenGL::OpenGL(MwWidget widget, MwCXX::Base* parent) : MwCXX::Base(widget, parent) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
MwCXX::OpenGL::OpenGL(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height)
|
||||
: MwCXX::Base(MwOpenGLClass, name, parent, x, y, width, height) {
|
||||
MwCXX::OpenGL::OpenGL(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwOpenGLClass, name, parent, x, y, width, height) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
|
|
|
|||
36
src/widget/progressbar.cc
Normal file
36
src/widget/progressbar.cc
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
#include <MwCXX/Widget/ProgressBar.h>
|
||||
|
||||
MwCXX::ProgressBar::ProgressBar(MwWidget widget, MwCXX::Base* parent) : MwCXX::Base(widget, parent) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
MwCXX::ProgressBar::ProgressBar(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwProgressBarClass, name, parent, x, y, width, height) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
int MwCXX::ProgressBar::GetMinValue() {
|
||||
return (int)MwGetInteger(this->widget, MwNminValue);
|
||||
}
|
||||
|
||||
void MwCXX::ProgressBar::SetMinValue(int value) {
|
||||
MwSetInteger(this->widget, MwNminValue, (int)value);
|
||||
}
|
||||
|
||||
int MwCXX::ProgressBar::GetMaxValue() {
|
||||
return (int)MwGetInteger(this->widget, MwNmaxValue);
|
||||
}
|
||||
|
||||
void MwCXX::ProgressBar::SetMaxValue(int value) {
|
||||
MwSetInteger(this->widget, MwNmaxValue, (int)value);
|
||||
}
|
||||
|
||||
int MwCXX::ProgressBar::GetValue() {
|
||||
return (int)MwGetInteger(this->widget, MwNvalue);
|
||||
}
|
||||
|
||||
void MwCXX::ProgressBar::SetValue(int value) {
|
||||
MwSetInteger(this->widget, MwNvalue, (int)value);
|
||||
}
|
||||
|
||||
void MwCXX::ProgressBar::RegisterHandlers() {
|
||||
}
|
||||
|
|
@ -1,12 +1,10 @@
|
|||
#include <MwCXX/Widget/ProgressBar.h>
|
||||
|
||||
MwCXX::ProgressBar::ProgressBar(MwWidget widget)
|
||||
: MwCXX::Base(widget) {
|
||||
MwCXX::ProgressBar::ProgressBar(MwWidget widget, MwCXX::Base* parent) : MwCXX::Base(widget, parent) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
MwCXX::ProgressBar::ProgressBar(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height)
|
||||
: MwCXX::Base(MwProgressBarClass, name, parent, x, y, width, height) {
|
||||
MwCXX::ProgressBar::ProgressBar(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwProgressBarClass, name, parent, x, y, width, height) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
|
|
|
|||
25
src/widget/radiobox.cc
Normal file
25
src/widget/radiobox.cc
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#include <MwCXX/Widget/RadioBox.h>
|
||||
|
||||
MwCXX::RadioBox::RadioBox(MwWidget widget, MwCXX::Base* parent) : MwCXX::Base(widget, parent) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
MwCXX::RadioBox::RadioBox(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwRadioBoxClass, name, parent, x, y, width, height) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
int MwCXX::RadioBox::GetChecked() {
|
||||
return (int)MwGetInteger(this->widget, MwNchecked);
|
||||
}
|
||||
|
||||
void MwCXX::RadioBox::SetChecked(int value) {
|
||||
MwSetInteger(this->widget, MwNchecked, (int)value);
|
||||
}
|
||||
|
||||
static void __OnChanged(MwWidget handle, void* user, void* call) {
|
||||
((MwCXX::RadioBox*)user)->OnChanged();
|
||||
}
|
||||
|
||||
void MwCXX::RadioBox::RegisterHandlers() {
|
||||
MwAddUserHandler(this->widget, MwNchangedHandler, __OnChanged, (void*)this);
|
||||
}
|
||||
|
|
@ -1,12 +1,10 @@
|
|||
#include <MwCXX/Widget/RadioBox.h>
|
||||
|
||||
MwCXX::RadioBox::RadioBox(MwWidget widget)
|
||||
: MwCXX::Base(widget) {
|
||||
MwCXX::RadioBox::RadioBox(MwWidget widget, MwCXX::Base* parent) : MwCXX::Base(widget, parent) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
MwCXX::RadioBox::RadioBox(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height)
|
||||
: MwCXX::Base(MwRadioBoxClass, name, parent, x, y, width, height) {
|
||||
MwCXX::RadioBox::RadioBox(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwRadioBoxClass, name, parent, x, y, width, height) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
|
|
|
|||
65
src/widget/scrollbar.cc
Normal file
65
src/widget/scrollbar.cc
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
#include <MwCXX/Widget/ScrollBar.h>
|
||||
|
||||
MwCXX::ScrollBar::ScrollBar(MwWidget widget, MwCXX::Base* parent) : MwCXX::Base(widget, parent) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
MwCXX::ScrollBar::ScrollBar(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwScrollBarClass, name, parent, x, y, width, height) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
int MwCXX::ScrollBar::GetShowArrows() {
|
||||
return (int)MwGetInteger(this->widget, MwNshowArrows);
|
||||
}
|
||||
|
||||
void MwCXX::ScrollBar::SetShowArrows(int value) {
|
||||
MwSetInteger(this->widget, MwNshowArrows, (int)value);
|
||||
}
|
||||
|
||||
int MwCXX::ScrollBar::GetAreaShown() {
|
||||
return (int)MwGetInteger(this->widget, MwNareaShown);
|
||||
}
|
||||
|
||||
void MwCXX::ScrollBar::SetAreaShown(int value) {
|
||||
MwSetInteger(this->widget, MwNareaShown, (int)value);
|
||||
}
|
||||
|
||||
int MwCXX::ScrollBar::GetValue() {
|
||||
return (int)MwGetInteger(this->widget, MwNvalue);
|
||||
}
|
||||
|
||||
void MwCXX::ScrollBar::SetValue(int value) {
|
||||
MwSetInteger(this->widget, MwNvalue, (int)value);
|
||||
}
|
||||
|
||||
int MwCXX::ScrollBar::GetMinValue() {
|
||||
return (int)MwGetInteger(this->widget, MwNminValue);
|
||||
}
|
||||
|
||||
void MwCXX::ScrollBar::SetMinValue(int value) {
|
||||
MwSetInteger(this->widget, MwNminValue, (int)value);
|
||||
}
|
||||
|
||||
int MwCXX::ScrollBar::GetMaxValue() {
|
||||
return (int)MwGetInteger(this->widget, MwNmaxValue);
|
||||
}
|
||||
|
||||
void MwCXX::ScrollBar::SetMaxValue(int value) {
|
||||
MwSetInteger(this->widget, MwNmaxValue, (int)value);
|
||||
}
|
||||
|
||||
int MwCXX::ScrollBar::GetOrientation() {
|
||||
return (int)MwGetInteger(this->widget, MwNorientation);
|
||||
}
|
||||
|
||||
void MwCXX::ScrollBar::SetOrientation(int value) {
|
||||
MwSetInteger(this->widget, MwNorientation, (int)value);
|
||||
}
|
||||
|
||||
static void __OnChanged(MwWidget handle, void* user, void* call) {
|
||||
((MwCXX::ScrollBar*)user)->OnChanged();
|
||||
}
|
||||
|
||||
void MwCXX::ScrollBar::RegisterHandlers() {
|
||||
MwAddUserHandler(this->widget, MwNchangedHandler, __OnChanged, (void*)this);
|
||||
}
|
||||
|
|
@ -1,12 +1,10 @@
|
|||
#include <MwCXX/Widget/ScrollBar.h>
|
||||
|
||||
MwCXX::ScrollBar::ScrollBar(MwWidget widget)
|
||||
: MwCXX::Base(widget) {
|
||||
MwCXX::ScrollBar::ScrollBar(MwWidget widget, MwCXX::Base* parent) : MwCXX::Base(widget, parent) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
MwCXX::ScrollBar::ScrollBar(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height)
|
||||
: MwCXX::Base(MwScrollBarClass, name, parent, x, y, width, height) {
|
||||
MwCXX::ScrollBar::ScrollBar(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwScrollBarClass, name, parent, x, y, width, height) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
|
|
|
|||
20
src/widget/submenu.cc
Normal file
20
src/widget/submenu.cc
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
#include <MwCXX/Widget/SubMenu.h>
|
||||
|
||||
MwCXX::SubMenu::SubMenu(MwWidget widget, MwCXX::Base* parent) : MwCXX::Base(widget, parent) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
MwCXX::SubMenu::SubMenu(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwSubMenuClass, name, parent, x, y, width, height) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
int MwCXX::SubMenu::GetLeftPadding() {
|
||||
return (int)MwGetInteger(this->widget, MwNleftPadding);
|
||||
}
|
||||
|
||||
void MwCXX::SubMenu::SetLeftPadding(int value) {
|
||||
MwSetInteger(this->widget, MwNleftPadding, (int)value);
|
||||
}
|
||||
|
||||
void MwCXX::SubMenu::RegisterHandlers() {
|
||||
}
|
||||
|
|
@ -1,12 +1,10 @@
|
|||
#include <MwCXX/Widget/SubMenu.h>
|
||||
|
||||
MwCXX::SubMenu::SubMenu(MwWidget widget)
|
||||
: MwCXX::Base(widget) {
|
||||
MwCXX::SubMenu::SubMenu(MwWidget widget, MwCXX::Base* parent) : MwCXX::Base(widget, parent) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
MwCXX::SubMenu::SubMenu(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height)
|
||||
: MwCXX::Base(MwSubMenuClass, name, parent, x, y, width, height) {
|
||||
MwCXX::SubMenu::SubMenu(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwSubMenuClass, name, parent, x, y, width, height) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
|
|
|
|||
33
src/widget/treeview.cc
Normal file
33
src/widget/treeview.cc
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
#include <MwCXX/Widget/TreeView.h>
|
||||
|
||||
MwCXX::TreeView::TreeView(MwWidget widget, MwCXX::Base* parent) : MwCXX::Base(widget, parent) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
MwCXX::TreeView::TreeView(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwTreeViewClass, name, parent, x, y, width, height) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
int MwCXX::TreeView::GetLeftPadding() {
|
||||
return (int)MwGetInteger(this->widget, MwNleftPadding);
|
||||
}
|
||||
|
||||
void MwCXX::TreeView::SetLeftPadding(int value) {
|
||||
MwSetInteger(this->widget, MwNleftPadding, (int)value);
|
||||
}
|
||||
|
||||
int MwCXX::TreeView::GetSingleClickSelectable() {
|
||||
return (int)MwGetInteger(this->widget, MwNsingleClickSelectable);
|
||||
}
|
||||
|
||||
void MwCXX::TreeView::SetSingleClickSelectable(int value) {
|
||||
MwSetInteger(this->widget, MwNsingleClickSelectable, (int)value);
|
||||
}
|
||||
|
||||
static void __OnTreeViewActivate(MwWidget handle, void* user, void* call) {
|
||||
((MwCXX::TreeView*)user)->OnTreeViewActivate((void*)call);
|
||||
}
|
||||
|
||||
void MwCXX::TreeView::RegisterHandlers() {
|
||||
MwAddUserHandler(this->widget, MwNtreeViewActivateHandler, __OnTreeViewActivate, (void*)this);
|
||||
}
|
||||
|
|
@ -1,12 +1,10 @@
|
|||
#include <MwCXX/Widget/TreeView.h>
|
||||
|
||||
MwCXX::TreeView::TreeView(MwWidget widget)
|
||||
: MwCXX::Base(widget) {
|
||||
MwCXX::TreeView::TreeView(MwWidget widget, MwCXX::Base* parent) : MwCXX::Base(widget, parent) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
MwCXX::TreeView::TreeView(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height)
|
||||
: MwCXX::Base(MwTreeViewClass, name, parent, x, y, width, height) {
|
||||
MwCXX::TreeView::TreeView(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwTreeViewClass, name, parent, x, y, width, height) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
|
|
|
|||
12
src/widget/viewport.cc
Normal file
12
src/widget/viewport.cc
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#include <MwCXX/Widget/Viewport.h>
|
||||
|
||||
MwCXX::Viewport::Viewport(MwWidget widget, MwCXX::Base* parent) : MwCXX::Base(widget, parent) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
MwCXX::Viewport::Viewport(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwViewportClass, name, parent, x, y, width, height) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
void MwCXX::Viewport::RegisterHandlers() {
|
||||
}
|
||||
|
|
@ -1,12 +1,10 @@
|
|||
#include <MwCXX/Widget/Viewport.h>
|
||||
|
||||
MwCXX::Viewport::Viewport(MwWidget widget)
|
||||
: MwCXX::Base(widget) {
|
||||
MwCXX::Viewport::Viewport(MwWidget widget, MwCXX::Base* parent) : MwCXX::Base(widget, parent) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
MwCXX::Viewport::Viewport(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height)
|
||||
: MwCXX::Base(MwViewportClass, name, parent, x, y, width, height) {
|
||||
MwCXX::Viewport::Viewport(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwViewportClass, name, parent, x, y, width, height) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
|
|
|
|||
13
src/widget/vulkan.cc
Normal file
13
src/widget/vulkan.cc
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#define MW_VULKAN_NO_INCLUDE
|
||||
#include <MwCXX/Widget/Vulkan.h>
|
||||
|
||||
MwCXX::Vulkan::Vulkan(MwWidget widget, MwCXX::Base* parent) : MwCXX::Base(widget, parent) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
MwCXX::Vulkan::Vulkan(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwVulkanClass, name, parent, x, y, width, height) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
void MwCXX::Vulkan::RegisterHandlers() {
|
||||
}
|
||||
|
|
@ -1,13 +1,11 @@
|
|||
#define MW_VULKAN_NO_INCLUDE
|
||||
#include <MwCXX/Widget/Vulkan.h>
|
||||
|
||||
MwCXX::Vulkan::Vulkan(MwWidget widget)
|
||||
: MwCXX::Base(widget) {
|
||||
MwCXX::Vulkan::Vulkan(MwWidget widget, MwCXX::Base* parent) : MwCXX::Base(widget, parent) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
MwCXX::Vulkan::Vulkan(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height)
|
||||
: MwCXX::Base(MwVulkanClass, name, parent, x, y, width, height) {
|
||||
MwCXX::Vulkan::Vulkan(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwVulkanClass, name, parent, x, y, width, height) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
|
|
|
|||
64
src/widget/window.cc
Normal file
64
src/widget/window.cc
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
#include <MwCXX/Widget/Window.h>
|
||||
|
||||
MwCXX::Window::Window(MwWidget widget, MwCXX::Base* parent) : MwCXX::Base(widget, parent) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
MwCXX::Window::Window(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwWindowClass, name, parent, x, y, width, height) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
MwCXX::String MwCXX::Window::GetTitle() {
|
||||
return (MwCXX::String)MwGetText(this->widget, MwNtitle);
|
||||
}
|
||||
|
||||
void MwCXX::Window::SetTitle(MwCXX::String value) {
|
||||
#ifndef MWCXX_USE_C_STRING
|
||||
MwSetText(this->widget, MwNtitle, value.c_str());
|
||||
#else
|
||||
MwSetText(this->widget, MwNtitle, (MwCXX::String)value);
|
||||
#endif
|
||||
}
|
||||
|
||||
int MwCXX::Window::GetMain() {
|
||||
return (int)MwGetInteger(this->widget, MwNmain);
|
||||
}
|
||||
|
||||
void MwCXX::Window::SetMain(int value) {
|
||||
MwSetInteger(this->widget, MwNmain, (int)value);
|
||||
}
|
||||
|
||||
MwLLPixmap MwCXX::Window::GetIconPixmap() {
|
||||
return (MwLLPixmap)MwGetVoid(this->widget, MwNiconPixmap);
|
||||
}
|
||||
|
||||
void MwCXX::Window::SetIconPixmap(MwLLPixmap value) {
|
||||
MwSetVoid(this->widget, MwNiconPixmap, (MwLLPixmap)value);
|
||||
}
|
||||
|
||||
MwSizeHints* MwCXX::Window::GetSizeHints() {
|
||||
return (MwSizeHints*)MwGetVoid(this->widget, MwNsizeHints);
|
||||
}
|
||||
|
||||
void MwCXX::Window::SetSizeHints(MwSizeHints* value) {
|
||||
MwSetVoid(this->widget, MwNsizeHints, (MwSizeHints*)value);
|
||||
}
|
||||
|
||||
int MwCXX::Window::GetHasBorder() {
|
||||
return (int)MwGetInteger(this->widget, MwNhasBorder);
|
||||
}
|
||||
|
||||
void MwCXX::Window::SetHasBorder(int value) {
|
||||
MwSetInteger(this->widget, MwNhasBorder, (int)value);
|
||||
}
|
||||
|
||||
int MwCXX::Window::GetInverted() {
|
||||
return (int)MwGetInteger(this->widget, MwNinverted);
|
||||
}
|
||||
|
||||
void MwCXX::Window::SetInverted(int value) {
|
||||
MwSetInteger(this->widget, MwNinverted, (int)value);
|
||||
}
|
||||
|
||||
void MwCXX::Window::RegisterHandlers() {
|
||||
}
|
||||
|
|
@ -1,12 +1,10 @@
|
|||
#include <MwCXX/Widget/Window.h>
|
||||
|
||||
MwCXX::Window::Window(MwWidget widget)
|
||||
: MwCXX::Base(widget) {
|
||||
MwCXX::Window::Window(MwWidget widget, MwCXX::Base* parent) : MwCXX::Base(widget, parent) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
MwCXX::Window::Window(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height)
|
||||
: MwCXX::Base(MwWindowClass, name, parent, x, y, width, height) {
|
||||
MwCXX::Window::Window(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwWindowClass, name, parent, x, y, width, height) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
|
|
|
|||
3
test.cxx
3
test.cxx
|
|
@ -1,6 +1,7 @@
|
|||
#include <MwCXX/Core.h>
|
||||
#include <MwCXX/Widget/Window.h>
|
||||
#include <MwCXX/Widget/Button.h>
|
||||
#include <MwCXX/Dialog/MessageBox.h>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
|
|
@ -8,6 +9,8 @@ class MyButton : public MwCXX::Button {
|
|||
protected:
|
||||
void OnActivate() {
|
||||
std::cout << "Hello" << std::endl;
|
||||
|
||||
MwCXX::MessageBoxGetChild(MwCXX::MessageBox(this->GetParent(), "Hello", "Hello world", MwMB_BUTTONOK | MwMB_ICONNEWS));
|
||||
}
|
||||
|
||||
public:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue