[melonDS] add support for non-resizable windows
This commit is contained in:
parent
5bd78c1932
commit
ac495d0e12
2
ui.h
2
ui.h
|
@ -130,7 +130,7 @@ _UI_EXTERN void uiWindowSetBorderless(uiWindow *w, int borderless);
|
||||||
_UI_EXTERN void uiWindowSetChild(uiWindow *w, uiControl *child);
|
_UI_EXTERN void uiWindowSetChild(uiWindow *w, uiControl *child);
|
||||||
_UI_EXTERN int uiWindowMargined(uiWindow *w);
|
_UI_EXTERN int uiWindowMargined(uiWindow *w);
|
||||||
_UI_EXTERN void uiWindowSetMargined(uiWindow *w, int margined);
|
_UI_EXTERN void uiWindowSetMargined(uiWindow *w, int margined);
|
||||||
_UI_EXTERN uiWindow *uiNewWindow(const char *title, int width, int height, int hasMenubar);
|
_UI_EXTERN uiWindow *uiNewWindow(const char *title, int width, int height, int hasMenubar, int resizable);
|
||||||
|
|
||||||
typedef struct uiButton uiButton;
|
typedef struct uiButton uiButton;
|
||||||
#define uiButton(this) ((uiButton *) (this))
|
#define uiButton(this) ((uiButton *) (this))
|
||||||
|
|
|
@ -229,7 +229,7 @@ void uiWindowSetMargined(uiWindow *w, int margined)
|
||||||
uiprivSetMargined(w->childHolderContainer, w->margined);
|
uiprivSetMargined(w->childHolderContainer, w->margined);
|
||||||
}
|
}
|
||||||
|
|
||||||
uiWindow *uiNewWindow(const char *title, int width, int height, int hasMenubar)
|
uiWindow *uiNewWindow(const char *title, int width, int height, int hasMenubar, int resizable)
|
||||||
{
|
{
|
||||||
uiWindow *w;
|
uiWindow *w;
|
||||||
|
|
||||||
|
@ -275,5 +275,7 @@ uiWindow *uiNewWindow(const char *title, int width, int height, int hasMenubar)
|
||||||
// TODO we really need to clean this up, especially since see uiWindowDestroy() above
|
// TODO we really need to clean this up, especially since see uiWindowDestroy() above
|
||||||
g_object_ref(w->widget);
|
g_object_ref(w->widget);
|
||||||
|
|
||||||
|
gtk_window_set_resizable(w->window, resizable?TRUE:FALSE);
|
||||||
|
|
||||||
return w;
|
return w;
|
||||||
}
|
}
|
||||||
|
|
|
@ -452,7 +452,7 @@ static void setClientSize(uiWindow *w, int width, int height, BOOL hasMenubar, D
|
||||||
logLastError(L"error resizing window");
|
logLastError(L"error resizing window");
|
||||||
}
|
}
|
||||||
|
|
||||||
uiWindow *uiNewWindow(const char *title, int width, int height, int hasMenubar)
|
uiWindow *uiNewWindow(const char *title, int width, int height, int hasMenubar, int resizable)
|
||||||
{
|
{
|
||||||
uiWindow *w;
|
uiWindow *w;
|
||||||
WCHAR *wtitle;
|
WCHAR *wtitle;
|
||||||
|
@ -465,8 +465,11 @@ uiWindow *uiNewWindow(const char *title, int width, int height, int hasMenubar)
|
||||||
hasMenubarBOOL = TRUE;
|
hasMenubarBOOL = TRUE;
|
||||||
w->hasMenubar = hasMenubarBOOL;
|
w->hasMenubar = hasMenubarBOOL;
|
||||||
|
|
||||||
#define style WS_OVERLAPPEDWINDOW
|
int style = WS_OVERLAPPEDWINDOW;
|
||||||
#define exstyle 0
|
int exstyle = 0;
|
||||||
|
|
||||||
|
if (!resizable)
|
||||||
|
style &= ~(WS_THICKFRAME | WS_MAXIMIZEBOX);
|
||||||
|
|
||||||
wtitle = toUTF16(title);
|
wtitle = toUTF16(title);
|
||||||
w->hwnd = CreateWindowExW(exstyle,
|
w->hwnd = CreateWindowExW(exstyle,
|
||||||
|
|
Loading…
Reference in New Issue