update
This commit is contained in:
parent
7f7c653815
commit
bcf9f8a123
13 changed files with 225 additions and 4 deletions
|
|
@ -41,6 +41,8 @@ static std::string get_ctype(typeinfo type, int name = 1, int do_ptr = 1) {
|
|||
ret += "int";
|
||||
} else if(type.type == "short") {
|
||||
ret += "short";
|
||||
} else if(type.type == "double") {
|
||||
ret += "double";
|
||||
} else if(type.type == "string") {
|
||||
ret += "MwCXX::String";
|
||||
} else if(type.type == "pixmap") {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,9 @@
|
|||
#include <MwCXX/Widget/Box.h>
|
||||
#include <MwCXX/Widget/Button.h>
|
||||
#include <MwCXX/Widget/Calendar.h>
|
||||
#include <MwCXX/Widget/Chart.h>
|
||||
#include <MwCXX/Widget/CheckBox.h>
|
||||
#include <MwCXX/Widget/Clock.h>
|
||||
#include <MwCXX/Widget/Entry.h>
|
||||
#include <MwCXX/Widget/Frame.h>
|
||||
#include <MwCXX/Widget/Image.h>
|
||||
|
|
|
|||
30
include/MwCXX/Widget/Chart.h
Normal file
30
include/MwCXX/Widget/Chart.h
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#ifndef __MWCXX_WIDGET_CHART_H__
|
||||
#define __MWCXX_WIDGET_CHART_H__
|
||||
|
||||
#include <MwCXX/MachDep.h>
|
||||
#include <MwCXX/Widget/Base.h>
|
||||
|
||||
#include <Mw/Widget/Chart.h>
|
||||
|
||||
namespace MwCXX {
|
||||
class Chart : public MwCXX::Base {
|
||||
protected:
|
||||
virtual void RegisterHandlers();
|
||||
|
||||
public:
|
||||
Chart(MwWidget widget, MwCXX::Base* parent = NULL);
|
||||
Chart(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height);
|
||||
|
||||
int GetType();
|
||||
void SetType(int value);
|
||||
int GetMinValue();
|
||||
void SetMinValue(int value);
|
||||
int GetMaxValue();
|
||||
void SetMaxValue(int value);
|
||||
|
||||
int Set(int index, MwCXX::String text, double value, MwCXX::String color);
|
||||
void Delete(int index);
|
||||
};
|
||||
}; // namespace MwCXX
|
||||
|
||||
#endif
|
||||
27
include/MwCXX/Widget/Clock.h
Normal file
27
include/MwCXX/Widget/Clock.h
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#ifndef __MWCXX_WIDGET_CLOCK_H__
|
||||
#define __MWCXX_WIDGET_CLOCK_H__
|
||||
|
||||
#include <MwCXX/MachDep.h>
|
||||
#include <MwCXX/Widget/Base.h>
|
||||
|
||||
#include <Mw/Widget/Clock.h>
|
||||
|
||||
namespace MwCXX {
|
||||
class Clock : public MwCXX::Base {
|
||||
protected:
|
||||
virtual void RegisterHandlers();
|
||||
|
||||
public:
|
||||
Clock(MwWidget widget, MwCXX::Base* parent = NULL);
|
||||
Clock(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height);
|
||||
|
||||
int GetHour();
|
||||
void SetHour(int value);
|
||||
int GetMinute();
|
||||
void SetMinute(int value);
|
||||
int GetSecond();
|
||||
void SetSecond(int value);
|
||||
};
|
||||
}; // namespace MwCXX
|
||||
|
||||
#endif
|
||||
|
|
@ -24,7 +24,10 @@ namespace MwCXX {
|
|||
|
||||
void (*ComboBoxChangedHandler)(MwCXX::ComboBox* widget, int value);
|
||||
|
||||
void Add();
|
||||
void Add(int index, MwCXX::String text);
|
||||
MwCXX::String Get(int index, MwCXX::String text);
|
||||
void Delete(int index);
|
||||
void Reset();
|
||||
};
|
||||
}; // namespace MwCXX
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,8 @@ namespace MwCXX {
|
|||
void SetHasBorder(int value);
|
||||
int GetInverted();
|
||||
void SetInverted(int value);
|
||||
MwLLPixmap GetIconPixmap();
|
||||
void SetIconPixmap(MwLLPixmap value);
|
||||
};
|
||||
}; // namespace MwCXX
|
||||
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ namespace MwCXX {
|
|||
|
||||
MwCXX::Base* Add(MwCXX::String name);
|
||||
MwCXX::Base* GetFrame(MwCXX::String name);
|
||||
void Focus(MwCXX::String name);
|
||||
};
|
||||
}; // namespace MwCXX
|
||||
|
||||
|
|
|
|||
2
objs.mk
2
objs.mk
|
|
@ -1 +1 @@
|
|||
OBJS += src/dialog/colorpicker.o src/dialog/filechooser.o src/dialog/directorychooser.o src/dialog/messagebox.o src/widget/baseauto.o src/widget/box.o src/widget/button.o src/widget/calendar.o src/widget/checkbox.o src/widget/entry.o src/widget/frame.o src/widget/image.o src/widget/label.o src/widget/listbox.o src/widget/menu.o src/widget/numberentry.o src/widget/scrollbar.o src/widget/submenu.o src/widget/viewport.o src/widget/window.o src/widget/progressbar.o src/widget/radiobox.o src/widget/combobox.o src/widget/treeview.o src/widget/subwindow.o src/widget/table.o src/widget/tab.o src/widget/opengl.o src/widget/vulkan.o
|
||||
OBJS += src/dialog/colorpicker.o src/dialog/filechooser.o src/dialog/directorychooser.o src/dialog/messagebox.o src/widget/baseauto.o src/widget/box.o src/widget/button.o src/widget/calendar.o src/widget/chart.o src/widget/checkbox.o src/widget/clock.o src/widget/entry.o src/widget/frame.o src/widget/image.o src/widget/label.o src/widget/listbox.o src/widget/menu.o src/widget/numberentry.o src/widget/scrollbar.o src/widget/submenu.o src/widget/viewport.o src/widget/window.o src/widget/progressbar.o src/widget/radiobox.o src/widget/combobox.o src/widget/treeview.o src/widget/subwindow.o src/widget/table.o src/widget/tab.o src/widget/opengl.o src/widget/vulkan.o
|
||||
|
|
|
|||
63
src/widget/chart.cc
Normal file
63
src/widget/chart.cc
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
#include <MwCXX/Widget/Chart.h>
|
||||
|
||||
MwCXX::Chart::Chart(MwWidget widget, MwCXX::Base* parent) : MwCXX::Base(widget, parent) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
MwCXX::Chart::Chart(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwChartClass, name, parent, x, y, width, height) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
int MwCXX::Chart::GetType() {
|
||||
return (int)MwGetInteger(this->widget, MwNtype);
|
||||
}
|
||||
|
||||
void MwCXX::Chart::SetType(int value) {
|
||||
MwSetInteger(this->widget, MwNtype, (int)value);
|
||||
}
|
||||
|
||||
int MwCXX::Chart::GetMinValue() {
|
||||
return (int)MwGetInteger(this->widget, MwNminValue);
|
||||
}
|
||||
|
||||
void MwCXX::Chart::SetMinValue(int value) {
|
||||
MwSetInteger(this->widget, MwNminValue, (int)value);
|
||||
}
|
||||
|
||||
int MwCXX::Chart::GetMaxValue() {
|
||||
return (int)MwGetInteger(this->widget, MwNmaxValue);
|
||||
}
|
||||
|
||||
void MwCXX::Chart::SetMaxValue(int value) {
|
||||
MwSetInteger(this->widget, MwNmaxValue, (int)value);
|
||||
}
|
||||
|
||||
void MwCXX::Chart::RegisterHandlers() {
|
||||
}
|
||||
|
||||
int MwCXX::Chart::Set(int index, MwCXX::String text, double value, MwCXX::String color)
|
||||
{
|
||||
int out;
|
||||
|
||||
MwVaWidgetExecute(this->widget, "mwChartSet", &out, index,
|
||||
#ifdef MWCXX_USE_C_STRING
|
||||
text
|
||||
#else
|
||||
text.c_str()
|
||||
#endif
|
||||
, value,
|
||||
#ifdef MWCXX_USE_C_STRING
|
||||
color
|
||||
#else
|
||||
color.c_str()
|
||||
#endif
|
||||
);
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
void MwCXX::Chart::Delete(int index)
|
||||
{
|
||||
MwVaWidgetExecute(this->widget, "mwChartDelete", NULL, index );
|
||||
}
|
||||
|
||||
37
src/widget/clock.cc
Normal file
37
src/widget/clock.cc
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
#include <MwCXX/Widget/Clock.h>
|
||||
|
||||
MwCXX::Clock::Clock(MwWidget widget, MwCXX::Base* parent) : MwCXX::Base(widget, parent) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
MwCXX::Clock::Clock(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwClockClass, name, parent, x, y, width, height) {
|
||||
this->RegisterHandlers();
|
||||
}
|
||||
|
||||
int MwCXX::Clock::GetHour() {
|
||||
return (int)MwGetInteger(this->widget, MwNhour);
|
||||
}
|
||||
|
||||
void MwCXX::Clock::SetHour(int value) {
|
||||
MwSetInteger(this->widget, MwNhour, (int)value);
|
||||
}
|
||||
|
||||
int MwCXX::Clock::GetMinute() {
|
||||
return (int)MwGetInteger(this->widget, MwNminute);
|
||||
}
|
||||
|
||||
void MwCXX::Clock::SetMinute(int value) {
|
||||
MwSetInteger(this->widget, MwNminute, (int)value);
|
||||
}
|
||||
|
||||
int MwCXX::Clock::GetSecond() {
|
||||
return (int)MwGetInteger(this->widget, MwNsecond);
|
||||
}
|
||||
|
||||
void MwCXX::Clock::SetSecond(int value) {
|
||||
MwSetInteger(this->widget, MwNsecond, (int)value);
|
||||
}
|
||||
|
||||
void MwCXX::Clock::RegisterHandlers() {
|
||||
}
|
||||
|
||||
|
|
@ -35,8 +35,43 @@ void MwCXX::ComboBox::RegisterHandlers() {
|
|||
this->ComboBoxChangedHandler = NULL;
|
||||
}
|
||||
|
||||
void MwCXX::ComboBox::Add()
|
||||
void MwCXX::ComboBox::Add(int index, MwCXX::String text)
|
||||
{
|
||||
MwVaWidgetExecute(this->widget, "mwComboBoxAdd", NULL );
|
||||
MwVaWidgetExecute(this->widget, "mwComboBoxAdd", NULL, index,
|
||||
#ifdef MWCXX_USE_C_STRING
|
||||
text
|
||||
#else
|
||||
text.c_str()
|
||||
#endif
|
||||
);
|
||||
}
|
||||
|
||||
MwCXX::String MwCXX::ComboBox::Get(int index, MwCXX::String text)
|
||||
{
|
||||
char* out;
|
||||
|
||||
MwVaWidgetExecute(this->widget, "mwComboBoxGet", &out, index,
|
||||
#ifdef MWCXX_USE_C_STRING
|
||||
text
|
||||
#else
|
||||
text.c_str()
|
||||
#endif
|
||||
);
|
||||
|
||||
#ifdef MWCXX_USE_C_STRING
|
||||
return out;
|
||||
#else
|
||||
return MwCXX::String(out);
|
||||
#endif
|
||||
}
|
||||
|
||||
void MwCXX::ComboBox::Delete(int index)
|
||||
{
|
||||
MwVaWidgetExecute(this->widget, "mwComboBoxDelete", NULL, index );
|
||||
}
|
||||
|
||||
void MwCXX::ComboBox::Reset()
|
||||
{
|
||||
MwVaWidgetExecute(this->widget, "mwComboBoxReset", NULL );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,6 +24,14 @@ void MwCXX::Frame::SetInverted(int value) {
|
|||
MwSetInteger(this->widget, MwNinverted, (int)value);
|
||||
}
|
||||
|
||||
MwLLPixmap MwCXX::Frame::GetIconPixmap() {
|
||||
return (MwLLPixmap)MwGetVoid(this->widget, MwNiconPixmap);
|
||||
}
|
||||
|
||||
void MwCXX::Frame::SetIconPixmap(MwLLPixmap value) {
|
||||
MwSetVoid(this->widget, MwNiconPixmap, (MwLLPixmap)value);
|
||||
}
|
||||
|
||||
void MwCXX::Frame::RegisterHandlers() {
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -57,3 +57,14 @@ MwCXX::Base* MwCXX::Tab::GetFrame(MwCXX::String name)
|
|||
return out;
|
||||
}
|
||||
|
||||
void MwCXX::Tab::Focus(MwCXX::String name)
|
||||
{
|
||||
MwVaWidgetExecute(this->widget, "mwTabFocus", NULL,
|
||||
#ifdef MWCXX_USE_C_STRING
|
||||
name
|
||||
#else
|
||||
name.c_str()
|
||||
#endif
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue