git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@203 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
Nishi 2025-10-07 11:04:51 +00:00
commit 8c030ba778
12 changed files with 13 additions and 24 deletions

View file

@ -6,11 +6,10 @@
class MwOOWidget { class MwOOWidget {
protected: protected:
MwClass widget_class = NULL;
MwWidget widget; MwWidget widget;
public: public:
MwOOWidget(const char* name, MwOOWidget* parent, int x, int y, int w, int h); MwOOWidget(MwClass widget_class, const char* name, MwOOWidget* parent, int x, int y, int w, int h);
~MwOOWidget(void); ~MwOOWidget(void);
}; };

View file

@ -1,8 +1,8 @@
/* $Id$ */ /* $Id$ */
#include <MwOO/Base.h> #include <MwOO/Base.h>
MwOOWidget::MwOOWidget(const char* name, MwOOWidget* parent, int x, int y, int w, int h){ MwOOWidget::MwOOWidget(MwClass widget_class, const char* name, MwOOWidget* parent, int x, int y, int w, int h){
this->widget = MwCreateWidget(this->widget_class, name, parent->widget, x, y, w, h); this->widget = MwCreateWidget(widget_class, name, parent->widget, x, y, w, h);
} }
MwOOWidget::~MwOOWidget(void){ MwOOWidget::~MwOOWidget(void){

View file

@ -2,6 +2,5 @@
#include <MwOO/Widget/Button.h> #include <MwOO/Widget/Button.h>
#include <Mw/Widget/Button.h> #include <Mw/Widget/Button.h>
MwOOButtonWidget::MwOOButtonWidget(const char* name, MwOOWidget* parent, int x, int y, int w, int h) : MwOOWidget(name, parent, x, y, w, h){ MwOOButtonWidget::MwOOButtonWidget(const char* name, MwOOWidget* parent, int x, int y, int w, int h) : MwOOWidget(MwButtonClass, name, parent, x, y, w, h){
this->widget_class = MwButtonClass;
} }

View file

@ -2,6 +2,5 @@
#include <MwOO/Widget/Frame.h> #include <MwOO/Widget/Frame.h>
#include <Mw/Widget/Frame.h> #include <Mw/Widget/Frame.h>
MwOOFrameWidget::MwOOFrameWidget(const char* name, MwOOWidget* parent, int x, int y, int w, int h) : MwOOWidget(name, parent, x, y, w, h){ MwOOFrameWidget::MwOOFrameWidget(const char* name, MwOOWidget* parent, int x, int y, int w, int h) : MwOOWidget(MwFrameClass, name, parent, x, y, w, h){
this->widget_class = MwFrameClass;
} }

View file

@ -2,6 +2,5 @@
#include <MwOO/Widget/Image.h> #include <MwOO/Widget/Image.h>
#include <Mw/Widget/Image.h> #include <Mw/Widget/Image.h>
MwOOImageWidget::MwOOImageWidget(const char* name, MwOOWidget* parent, int x, int y, int w, int h) : MwOOWidget(name, parent, x, y, w, h){ MwOOImageWidget::MwOOImageWidget(const char* name, MwOOWidget* parent, int x, int y, int w, int h) : MwOOWidget(MwImageClass, name, parent, x, y, w, h){
this->widget_class = MwImageClass;
} }

View file

@ -2,6 +2,5 @@
#include <MwOO/Widget/Menu.h> #include <MwOO/Widget/Menu.h>
#include <Mw/Widget/Menu.h> #include <Mw/Widget/Menu.h>
MwOOMenuWidget::MwOOMenuWidget(const char* name, MwOOWidget* parent, int x, int y, int w, int h) : MwOOWidget(name, parent, x, y, w, h){ MwOOMenuWidget::MwOOMenuWidget(const char* name, MwOOWidget* parent, int x, int y, int w, int h) : MwOOWidget(MwMenuClass, name, parent, x, y, w, h){
this->widget_class = MwMenuClass;
} }

View file

@ -2,6 +2,5 @@
#include <MwOO/Widget/OpenGL.h> #include <MwOO/Widget/OpenGL.h>
#include <Mw/Widget/OpenGL.h> #include <Mw/Widget/OpenGL.h>
MwOOOpenGLWidget::MwOOOpenGLWidget(const char* name, MwOOWidget* parent, int x, int y, int w, int h) : MwOOWidget(name, parent, x, y, w, h){ MwOOOpenGLWidget::MwOOOpenGLWidget(const char* name, MwOOWidget* parent, int x, int y, int w, int h) : MwOOWidget(MwOpenGLClass, name, parent, x, y, w, h){
this->widget_class = MwOpenGLClass;
} }

View file

@ -2,6 +2,5 @@
#include <MwOO/Widget/ScrollBar.h> #include <MwOO/Widget/ScrollBar.h>
#include <Mw/Widget/ScrollBar.h> #include <Mw/Widget/ScrollBar.h>
MwOOScrollBarWidget::MwOOScrollBarWidget(const char* name, MwOOWidget* parent, int x, int y, int w, int h) : MwOOWidget(name, parent, x, y, w, h){ MwOOScrollBarWidget::MwOOScrollBarWidget(const char* name, MwOOWidget* parent, int x, int y, int w, int h) : MwOOWidget(MwScrollBarClass, name, parent, x, y, w, h){
this->widget_class = MwScrollBarClass;
} }

View file

@ -2,6 +2,5 @@
#include <MwOO/Widget/SubMenu.h> #include <MwOO/Widget/SubMenu.h>
#include <Mw/Widget/SubMenu.h> #include <Mw/Widget/SubMenu.h>
MwOOSubMenuWidget::MwOOSubMenuWidget(const char* name, MwOOWidget* parent, int x, int y, int w, int h) : MwOOWidget(name, parent, x, y, w, h){ MwOOSubMenuWidget::MwOOSubMenuWidget(const char* name, MwOOWidget* parent, int x, int y, int w, int h) : MwOOWidget(MwSubMenuClass, name, parent, x, y, w, h){
this->widget_class = MwSubMenuClass;
} }

View file

@ -2,6 +2,5 @@
#include <MwOO/Widget/Vulkan.h> #include <MwOO/Widget/Vulkan.h>
#include <Mw/Widget/Vulkan.h> #include <Mw/Widget/Vulkan.h>
MwOOVulkanWidget::MwOOVulkanWidget(const char* name, MwOOWidget* parent, int x, int y, int w, int h) : MwOOWidget(name, parent, x, y, w, h){ MwOOVulkanWidget::MwOOVulkanWidget(const char* name, MwOOWidget* parent, int x, int y, int w, int h) : MwOOWidget(MwVulkanClass, name, parent, x, y, w, h){
this->widget_class = MwVulkanClass;
} }

View file

@ -2,6 +2,5 @@
#include <MwOO/Widget/Window.h> #include <MwOO/Widget/Window.h>
#include <Mw/Widget/Window.h> #include <Mw/Widget/Window.h>
MwOOWindowWidget::MwOOWindowWidget(const char* name, MwOOWidget* parent, int x, int y, int w, int h) : MwOOWidget(name, parent, x, y, w, h){ MwOOWindowWidget::MwOOWindowWidget(const char* name, MwOOWidget* parent, int x, int y, int w, int h) : MwOOWidget(MwWindowClass, name, parent, x, y, w, h){
this->widget_class = MwWindowClass;
} }

View file

@ -37,9 +37,8 @@ foreach my $f (@files) {
print(OUT "#include <Mw/Widget/$name.h>\n"); print(OUT "#include <Mw/Widget/$name.h>\n");
print(OUT "\n"); print(OUT "\n");
print(OUT print(OUT
"MwOO${name}Widget::MwOO${name}Widget(const char* name, MwOOWidget* parent, int x, int y, int w, int h) : MwOOWidget(name, parent, x, y, w, h){\n" "MwOO${name}Widget::MwOO${name}Widget(const char* name, MwOOWidget* parent, int x, int y, int w, int h) : MwOOWidget(Mw${name}Class, name, parent, x, y, w, h){\n"
); );
print(OUT " this->widget_class = Mw${name}Class;\n");
print(OUT "}\n"); print(OUT "}\n");
close(OUT); close(OUT);