This commit is contained in:
Nishi 2026-04-20 00:47:40 +09:00
commit 76d31322ae
Signed by: nishi
GPG key ID: 27EF69B208EB9343
6 changed files with 14 additions and 12 deletions

View file

@ -526,7 +526,7 @@ static std::string function_source(xl_node_t* node) {
} }
if(type2.type == "widget") { if(type2.type == "widget") {
strm << type2.name + "->GetWidget()"; strm << "(" + type2.name + " == NULL ? NULL : " + type2.name + "->GetWidget())";
} else { } else {
if(type2.type == "string") { if(type2.type == "string") {
strm << std::endl; strm << std::endl;

View file

@ -1,7 +1,7 @@
#include <MwCXX/Dialog/ColorPicker.h> #include <MwCXX/Dialog/ColorPicker.h>
MwCXX::Window* MwCXX::ColorPicker(MwCXX::Base* handle, MwCXX::String title) { MwCXX::Window* MwCXX::ColorPicker(MwCXX::Base* handle, MwCXX::String title) {
return new MwCXX::Window(MwColorPicker(handle->GetWidget(), return new MwCXX::Window(MwColorPicker((handle == NULL ? NULL : handle->GetWidget()),
#ifdef MWCXX_USE_C_STRING #ifdef MWCXX_USE_C_STRING
title title
#else #else

View file

@ -1,7 +1,7 @@
#include <MwCXX/Dialog/DirectoryChooser.h> #include <MwCXX/Dialog/DirectoryChooser.h>
MwCXX::Window* MwCXX::DirectoryChooser(MwCXX::Base* handle, MwCXX::String title) { MwCXX::Window* MwCXX::DirectoryChooser(MwCXX::Base* handle, MwCXX::String title) {
return new MwCXX::Window(MwDirectoryChooser(handle->GetWidget(), return new MwCXX::Window(MwDirectoryChooser((handle == NULL ? NULL : handle->GetWidget()),
#ifdef MWCXX_USE_C_STRING #ifdef MWCXX_USE_C_STRING
title title
#else #else

View file

@ -1,7 +1,7 @@
#include <MwCXX/Dialog/FileChooser.h> #include <MwCXX/Dialog/FileChooser.h>
MwCXX::Window* MwCXX::FileChooser(MwCXX::Base* handle, MwCXX::String title) { MwCXX::Window* MwCXX::FileChooser(MwCXX::Base* handle, MwCXX::String title) {
return new MwCXX::Window(MwFileChooser(handle->GetWidget(), return new MwCXX::Window(MwFileChooser((handle == NULL ? NULL : handle->GetWidget()),
#ifdef MWCXX_USE_C_STRING #ifdef MWCXX_USE_C_STRING
title title
#else #else
@ -11,7 +11,7 @@ MwCXX::Window* MwCXX::FileChooser(MwCXX::Base* handle, MwCXX::String title) {
handle); handle);
} }
MwCXX::Window* MwCXX::FileChooserEx(MwCXX::Base* handle, MwCXX::String title, int dir) { MwCXX::Window* MwCXX::FileChooserEx(MwCXX::Base* handle, MwCXX::String title, int dir) {
return new MwCXX::Window(MwFileChooserEx(handle->GetWidget(), return new MwCXX::Window(MwFileChooserEx((handle == NULL ? NULL : handle->GetWidget()),
#ifdef MWCXX_USE_C_STRING #ifdef MWCXX_USE_C_STRING
title title
#else #else

View file

@ -1,7 +1,7 @@
#include <MwCXX/Dialog/MessageBox.h> #include <MwCXX/Dialog/MessageBox.h>
MwCXX::Window* MwCXX::MessageBox(MwCXX::Base* handle, MwCXX::String text, MwCXX::String title, unsigned int flag) { MwCXX::Window* MwCXX::MessageBox(MwCXX::Base* handle, MwCXX::String text, MwCXX::String title, unsigned int flag) {
return new MwCXX::Window(MwMessageBox(handle->GetWidget(), return new MwCXX::Window(MwMessageBox((handle == NULL ? NULL : handle->GetWidget()),
#ifdef MWCXX_USE_C_STRING #ifdef MWCXX_USE_C_STRING
text text
#else #else
@ -18,8 +18,8 @@ MwCXX::Window* MwCXX::MessageBox(MwCXX::Base* handle, MwCXX::String text, MwCXX:
handle); handle);
} }
MwCXX::Button* MwCXX::MessageBoxGetChild(MwCXX::Window* handle, int child) { MwCXX::Button* MwCXX::MessageBoxGetChild(MwCXX::Window* handle, int child) {
return new MwCXX::Button(MwMessageBoxGetChild(handle->GetWidget(), (int)child), handle); return new MwCXX::Button(MwMessageBoxGetChild((handle == NULL ? NULL : handle->GetWidget()), (int)child), handle);
} }
void MwCXX::MessageBoxDestroy(MwCXX::Window* handle) { void MwCXX::MessageBoxDestroy(MwCXX::Window* handle) {
MwMessageBoxDestroy(handle->GetWidget()); MwMessageBoxDestroy((handle == NULL ? NULL : handle->GetWidget()));
} }

View file

@ -107,11 +107,13 @@ void MwCXX::Base::ForceRender() {
void MwCXX::Base::Reparent(MwCXX::Base* new_parent) { void MwCXX::Base::Reparent(MwCXX::Base* new_parent) {
int i; int i;
for(i = 0; i < this->parent->children.size(); i++) { if(this->parent != NULL) {
if(this->parent->children[i] == this) { for(i = 0; i < this->parent->children.size(); i++) {
this->parent->children.erase(this->parent->children.begin() + i); if(this->parent->children[i] == this) {
this->parent->children.erase(this->parent->children.begin() + i);
break; break;
}
} }
} }