new constant

git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@252 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
NishiOwO
2025-10-10 11:45:27 +00:00
parent 0c28c9d104
commit 0fd866977b
14 changed files with 65 additions and 42 deletions

View File

@@ -111,7 +111,7 @@ MwLL MwLLCreate(MwLL parent, int x, int y, int width, int height) {
RegisterClassEx(&wc);
r->copy_buffer = 1;
r->hWnd = CreateWindow(parent == NULL ? "milsko" : "STATIC", "Milsko", parent == NULL ? (WS_OVERLAPPEDWINDOW) : (WS_CHILD | WS_VISIBLE), x, y, width, height, parent == NULL ? NULL : parent->hWnd, 0, wc.hInstance, NULL);
r->hWnd = CreateWindow(parent == NULL ? "milsko" : "STATIC", "Milsko", parent == NULL ? (WS_OVERLAPPEDWINDOW) : (WS_CHILD | WS_VISIBLE), x == MwDEFAULT ? CW_USEDEFAULT : x, y == MwDEFAULT ? CW_USEDEFAULT : y, width, height, parent == NULL ? NULL : parent->hWnd, 0, wc.hInstance, NULL);
r->hInstance = wc.hInstance;
u->ll = r;

View File

@@ -27,6 +27,8 @@ MwLL MwLLCreate(MwLL parent, int x, int y, int width, int height) {
MwLLCreateCommon(r);
if(x == MwDEFAULT) x = 0;
if(y == MwDEFAULT) y = 0;
if(width < 1) width = 1;
if(height < 1) height = 1;
@@ -37,19 +39,19 @@ MwLL MwLLCreate(MwLL parent, int x, int y, int width, int height) {
r->display = parent->display;
p = parent->window;
}
r->window = XCreateSimpleWindow(r->display, p, x, y, width, height, 0, 0, WhitePixel(r->display, XDefaultScreen(r->display)));
r->window = XCreateSimpleWindow(r->display, p, x, y, width, height, 0, 0, WhitePixel(r->display, XDefaultScreen(r->display)));
XSetLocaleModifiers("");
if((r->xim = XOpenIM(r->display, 0, 0, 0)) == NULL){
if((r->xim = XOpenIM(r->display, 0, 0, 0)) == NULL) {
XSetLocaleModifiers("@im=none");
r->xim = XOpenIM(r->display, 0, 0, 0);
}
r->xic = XCreateIC(r->xim,
XNInputStyle, XIMPreeditNothing | XIMStatusNothing,
XNClientWindow, r->window,
XNFocusWindow, r->window,
NULL);
XNInputStyle, XIMPreeditNothing | XIMStatusNothing,
XNClientWindow, r->window,
XNFocusWindow, r->window,
NULL);
XSetICFocus(r->xic);
r->copy_buffer = 1;

View File

@@ -21,8 +21,8 @@ struct _MwLL {
void* user;
Atom wm_delete;
int copy_buffer;
XIM xim;
XIC xic;
XIM xim;
XIC xic;
unsigned int width;
unsigned int height;

View File

@@ -2,12 +2,12 @@
#include <Mw/Milsko.h>
static int create(MwWidget handle) {
int st;
MwEntry e;
int st;
MwEntry e;
if((st = MwEntryClass->create(handle)) != 0) return st;
e = handle->internal;
e = handle->internal;
e->right = 32;
return 0;
@@ -33,7 +33,7 @@ static void key(MwWidget handle, int code) {
ok = 1;
} else if(code == '.' && strchr(str, (int)'.') == NULL) {
ok = 1;
}else if(code == MwLLKeyBackSpace || code == MwLLKeyLeft || code == MwLLKeyRight){
} else if(code == MwLLKeyBackSpace || code == MwLLKeyLeft || code == MwLLKeyRight) {
ok = 1;
}