wip
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good

This commit is contained in:
Nishi 2026-04-29 15:14:38 +09:00
commit 150581e716
6 changed files with 29 additions and 13 deletions

View file

@ -126,6 +126,7 @@ static MwWidget frame(const char* name, int width, int height, MwClass cl, ...)
MwVaApply(f, MwVaApply(f,
"VhandledWidget", w, "VhandledWidget", w,
MwNratio, MwGetInteger(w, MwNratio),
NULL); NULL);
} }
@ -305,6 +306,18 @@ int main() {
f = frame("Separator", -PaddingContent, -PaddingContent, MwSeparatorClass, NULL); f = frame("Separator", -PaddingContent, -PaddingContent, MwSeparatorClass, NULL);
add(f); add(f);
#if 0
f = frame("SubWindow", -PaddingContent, -PaddingContent, MwViewportClass,
MwNratio, 3,
NULL);
w = child(f);
MwViewportSetSize(w, 512, 512);
MwVaCreateWidget(MwSubWindowClass, "swnd", MwViewportGetViewport(w), 0, 0, 512, 512,
MwNtitle, "Sub window",
NULL);
add(f);
#endif
f = frame("TreeView", -PaddingContent, -PaddingContent, MwTreeViewClass, NULL); f = frame("TreeView", -PaddingContent, -PaddingContent, MwTreeViewClass, NULL);
w = child(f); w = child(f);
v = MwTreeViewAdd(w, NULL, NULL, "abc"); v = MwTreeViewAdd(w, NULL, NULL, "abc");

View file

@ -2,7 +2,8 @@
#include "../../external/stb_ds.h" #include "../../external/stb_ds.h"
MwApplication::MwApplication(MwRect rc, MwLL handle) : BApplication("application/milsko-generic") { MwApplication::MwApplication(MwRect rc, MwLL handle)
: BApplication("application/milsko-generic") {
BScreen* scr = new BScreen(); BScreen* scr = new BScreen();
float x = (scr->Frame().Width() - rc.width) / 2; float x = (scr->Frame().Width() - rc.width) / 2;
float y = (scr->Frame().Height() - rc.height) / 2; float y = (scr->Frame().Height() - rc.height) / 2;
@ -47,7 +48,8 @@ void MwApplication::MessageReceived(BMessage* message) {
} }
} }
MwView::MwView(MwLL handle, BRect frame, uint32 resizingMode, uint32 flags) : BView(frame, NULL, resizingMode, flags | B_FRAME_EVENTS) { MwView::MwView(MwLL handle, BRect frame, uint32 resizingMode, uint32 flags)
: BView(frame, NULL, resizingMode, flags | B_FRAME_EVENTS) {
this->handle = handle; this->handle = handle;
this->locker = new BLocker(); this->locker = new BLocker();
@ -307,7 +309,8 @@ void MwView::SetColor(MwLLColor color) {
this->PostMessage(&msg); this->PostMessage(&msg);
} }
MwWindow::MwWindow(BRect frame, window_type type, uint32 flags) : BWindow(frame, "Milsko", type, flags) { MwWindow::MwWindow(BRect frame, window_type type, uint32 flags)
: BWindow(frame, "Milsko", type, flags) {
} }
void MwWindow::MessageReceived(BMessage* message) { void MwWindow::MessageReceived(BMessage* message) {

View file

@ -58,7 +58,7 @@ static void draw(MwWidget handle) {
MwLLColor base = MwParseColor(handle, MwGetText(handle, MwNbackground)); MwLLColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
MwLLColor dark = MwLightenColor(handle, base, -64, -64, -64); MwLLColor dark = MwLightenColor(handle, base, -64, -64, -64);
MwScrollBar scr = handle->internal; MwScrollBar scr = handle->internal;
int or; int or ;
int uy, dy, ux, dx; int uy, dy, ux, dx;
MwLLPixmap bgpx = MwGetVoid(handle, MwNbackgroundPixmap); MwLLPixmap bgpx = MwGetVoid(handle, MwNbackgroundPixmap);