mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2025-12-31 06:30:52 +00:00
add MwShow
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@713 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
@@ -293,6 +293,13 @@ MWDECL void MwToggleDarkTheme(MwWidget handle, int toggle);
|
|||||||
*/
|
*/
|
||||||
MWDECL MwWidget MwGetParent(MwWidget handle);
|
MWDECL MwWidget MwGetParent(MwWidget handle);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief Show widget
|
||||||
|
* @param handle Widget
|
||||||
|
* @param toggle Toggle
|
||||||
|
*/
|
||||||
|
MWDECL void MwShow(MwWidget handle, int toggle);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -334,6 +334,13 @@
|
|||||||
<widget name="handle" />
|
<widget name="handle" />
|
||||||
</arguments>
|
</arguments>
|
||||||
</function>
|
</function>
|
||||||
|
<function name="MwLibraryInit" />
|
||||||
|
<function name="MwShow">
|
||||||
|
<arguments>
|
||||||
|
<widget name="handle" />
|
||||||
|
<integer name="toggle" />
|
||||||
|
</arguments>
|
||||||
|
</function>
|
||||||
</functions>
|
</functions>
|
||||||
</header>
|
</header>
|
||||||
<header name="Error">
|
<header name="Error">
|
||||||
|
|||||||
@@ -43,7 +43,7 @@
|
|||||||
MwLLMakePopup = MwLLMakePopupImpl; \
|
MwLLMakePopup = MwLLMakePopupImpl; \
|
||||||
\
|
\
|
||||||
MwLLBeginStateChange = MwLLBeginStateChangeImpl; \
|
MwLLBeginStateChange = MwLLBeginStateChangeImpl; \
|
||||||
MwLLEndStateChange = MwLLEndStateChangeImpl; \
|
MwLLEndStateChange = MwLLEndStateChangeImpl; \
|
||||||
\
|
\
|
||||||
MwLLSetBackground = MwLLSetBackgroundImpl; \
|
MwLLSetBackground = MwLLSetBackgroundImpl; \
|
||||||
\
|
\
|
||||||
|
|||||||
@@ -570,7 +570,7 @@ static void MwLLSetCursorImpl(MwLL handle, MwCursor* image, MwCursor* mask) {
|
|||||||
|
|
||||||
static void MwLLDetachImpl(MwLL handle, MwPoint* point) {
|
static void MwLLDetachImpl(MwLL handle, MwPoint* point) {
|
||||||
RECT rc, rc2;
|
RECT rc, rc2;
|
||||||
LPARAM lp = GetWindowLongPtr(handle->gdi.hWnd, GWL_STYLE);
|
LPARAM lp = GetWindowLongPtr(handle->gdi.hWnd, GWL_STYLE);
|
||||||
LPARAM lp2 = GetWindowLongPtr(handle->gdi.hWnd, GWL_EXSTYLE);
|
LPARAM lp2 = GetWindowLongPtr(handle->gdi.hWnd, GWL_EXSTYLE);
|
||||||
|
|
||||||
lp &= WS_VISIBLE;
|
lp &= WS_VISIBLE;
|
||||||
@@ -579,9 +579,9 @@ static void MwLLDetachImpl(MwLL handle, MwPoint* point) {
|
|||||||
|
|
||||||
GetClientRect(handle->gdi.hWnd, &rc2);
|
GetClientRect(handle->gdi.hWnd, &rc2);
|
||||||
|
|
||||||
if(lp2 & WS_EX_TOOLWINDOW){
|
if(lp2 & WS_EX_TOOLWINDOW) {
|
||||||
SetWindowLongPtr(handle->gdi.hWnd, GWL_STYLE, (LPARAM)lp);
|
SetWindowLongPtr(handle->gdi.hWnd, GWL_STYLE, (LPARAM)lp);
|
||||||
}else{
|
} else {
|
||||||
SetWindowLongPtr(handle->gdi.hWnd, GWL_STYLE, (LPARAM)WS_OVERLAPPEDWINDOW | lp);
|
SetWindowLongPtr(handle->gdi.hWnd, GWL_STYLE, (LPARAM)WS_OVERLAPPEDWINDOW | lp);
|
||||||
}
|
}
|
||||||
SetParent(handle->gdi.hWnd, NULL);
|
SetParent(handle->gdi.hWnd, NULL);
|
||||||
@@ -702,7 +702,7 @@ static char* MwLLGetClipboardImpl(MwLL handle) {
|
|||||||
static void MwLLMakeToolWindowImpl(MwLL handle) {
|
static void MwLLMakeToolWindowImpl(MwLL handle) {
|
||||||
LPARAM lp = GetWindowLongPtr(handle->gdi.hWnd, GWL_STYLE) & (WS_VISIBLE | WS_CHILD);
|
LPARAM lp = GetWindowLongPtr(handle->gdi.hWnd, GWL_STYLE) & (WS_VISIBLE | WS_CHILD);
|
||||||
RECT rc;
|
RECT rc;
|
||||||
int w, h;
|
int w, h;
|
||||||
|
|
||||||
SetWindowLongPtr(handle->gdi.hWnd, GWL_STYLE, (LPARAM)lp);
|
SetWindowLongPtr(handle->gdi.hWnd, GWL_STYLE, (LPARAM)lp);
|
||||||
SetWindowLongPtr(handle->gdi.hWnd, GWL_EXSTYLE, (LPARAM)WS_EX_TOOLWINDOW);
|
SetWindowLongPtr(handle->gdi.hWnd, GWL_EXSTYLE, (LPARAM)WS_EX_TOOLWINDOW);
|
||||||
@@ -715,12 +715,13 @@ static void MwLLMakeToolWindowImpl(MwLL handle) {
|
|||||||
SetWindowPos(handle->gdi.hWnd, NULL, 0, 0, w, h, SWP_FRAMECHANGED | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER);
|
SetWindowPos(handle->gdi.hWnd, NULL, 0, 0, w, h, SWP_FRAMECHANGED | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MwLLBeginStateChangeImpl(MwLL handle){
|
static void MwLLBeginStateChangeImpl(MwLL handle) {
|
||||||
(void)handle;
|
(void)handle;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MwLLEndStateChangeImpl(MwLL handle){
|
static void MwLLEndStateChangeImpl(MwLL handle) {
|
||||||
(void)handle;;
|
(void)handle;
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int MwLLGDICallInitImpl(void) {
|
static int MwLLGDICallInitImpl(void) {
|
||||||
|
|||||||
@@ -971,11 +971,11 @@ static void MwLLMakeToolWindowImpl(MwLL handle) {
|
|||||||
XChangeProperty(handle->x11.display, handle->x11.window, wndtype, XA_ATOM, 32, PropModeReplace, (unsigned char*)&wndmenu, 1);
|
XChangeProperty(handle->x11.display, handle->x11.window, wndtype, XA_ATOM, 32, PropModeReplace, (unsigned char*)&wndmenu, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MwLLBeginStateChangeImpl(MwLL handle){
|
static void MwLLBeginStateChangeImpl(MwLL handle) {
|
||||||
MwLLShow(handle, 0);
|
MwLLShow(handle, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MwLLEndStateChangeImpl(MwLL handle){
|
static void MwLLEndStateChangeImpl(MwLL handle) {
|
||||||
MwLLShow(handle, 1);
|
MwLLShow(handle, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -629,3 +629,7 @@ int MwLibraryInit(void) {
|
|||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MwShow(MwWidget handle, int toggle) {
|
||||||
|
MwLLShow(handle->lowlevel, toggle);
|
||||||
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ static void draw(MwWidget handle) {
|
|||||||
MwRect fr;
|
MwRect fr;
|
||||||
MwRect rr;
|
MwRect rr;
|
||||||
MwLLColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
|
MwLLColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
|
||||||
int inverted;
|
int inverted;
|
||||||
|
|
||||||
if(MwGetInteger(handle, MwNhasBorder)) {
|
if(MwGetInteger(handle, MwNhasBorder)) {
|
||||||
inverted = MwGetInteger(handle, MwNinverted);
|
inverted = MwGetInteger(handle, MwNinverted);
|
||||||
|
|||||||
Reference in New Issue
Block a user