move some to lowlevel
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@675 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
parent
94e0fe41c0
commit
b617d147c3
7 changed files with 73 additions and 65 deletions
|
|
@ -134,6 +134,8 @@ MWDECL void MwLLGrabPointer(MwLL handle, int toggle);
|
||||||
MWDECL void MwLLSetClipboard(MwLL handle, const char* text);
|
MWDECL void MwLLSetClipboard(MwLL handle, const char* text);
|
||||||
MWDECL char* MwLLGetClipboard(MwLL handle);
|
MWDECL char* MwLLGetClipboard(MwLL handle);
|
||||||
|
|
||||||
|
MWDECL void MwLLMakeToolWindow(MwLL handle);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -691,3 +691,10 @@ char* MwLLGetClipboard(MwLL handle) {
|
||||||
}
|
}
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MwLLMakeToolWindow(MwLL handle) {
|
||||||
|
LPARAM lp = GetWindowLongPtr(handle->hWnd, GWL_STYLE) & WS_VISIBLE;
|
||||||
|
|
||||||
|
SetWindowLongPtr(handle->hWnd, GWL_STYLE, (LPARAM)lp);
|
||||||
|
SetWindowLongPtr(handle->hWnd, GWL_EXSTYLE, (LPARAM)WS_EX_TOOLWINDOW);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -946,3 +946,14 @@ char* MwLLGetClipboard(MwLL handle) {
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MwLLMakeToolWindow(MwLL handle) {
|
||||||
|
XSetWindowAttributes xswa;
|
||||||
|
Atom wndtype = XInternAtom(handle->display, "_NET_WM_WINDOW_TYPE", False);
|
||||||
|
Atom wndmenu = XInternAtom(handle->display, "_NET_WM_WINDOW_TYPE_MENU", False);
|
||||||
|
|
||||||
|
xswa.override_redirect = True;
|
||||||
|
|
||||||
|
XChangeWindowAttributes(handle->display, handle->window, CWOverrideRedirect, &xswa);
|
||||||
|
XChangeProperty(handle->display, handle->window, wndtype, XA_ATOM, 32, PropModeReplace, (unsigned char*)&wndmenu, 1);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,8 +27,7 @@
|
||||||
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
MwCursor MwCursorArrow = {
|
MwCursor MwCursorArrow = {
|
||||||
16, 16, -15, -15,
|
16, 16, -15, -15, {
|
||||||
{
|
|
||||||
0, /* ................ */
|
0, /* ................ */
|
||||||
6, /* .............##. */
|
6, /* .............##. */
|
||||||
30, /* ...........####. */
|
30, /* ...........####. */
|
||||||
|
|
@ -45,11 +44,9 @@ MwCursor MwCursorArrow = {
|
||||||
28672, /* .###............ */
|
28672, /* .###............ */
|
||||||
8192, /* ..#............. */
|
8192, /* ..#............. */
|
||||||
0 /* ................ */
|
0 /* ................ */
|
||||||
}
|
}};
|
||||||
};
|
|
||||||
MwCursor MwCursorArrowMask = {
|
MwCursor MwCursorArrowMask = {
|
||||||
16, 16, -15, -15,
|
16, 16, -15, -15, {
|
||||||
{
|
|
||||||
7, /* .............### */
|
7, /* .............### */
|
||||||
31, /* ...........##### */
|
31, /* ...........##### */
|
||||||
127, /* .........####### */
|
127, /* .........####### */
|
||||||
|
|
@ -66,5 +63,4 @@ MwCursor MwCursorArrowMask = {
|
||||||
63552, /* #####....#...... */
|
63552, /* #####....#...... */
|
||||||
28672, /* .###............ */
|
28672, /* .###............ */
|
||||||
8192 /* ..#............. */
|
8192 /* ..#............. */
|
||||||
}
|
}};
|
||||||
};
|
|
||||||
|
|
|
||||||
|
|
@ -80,6 +80,11 @@ static void click(MwWidget handle) {
|
||||||
MwComboBox cb = handle->internal;
|
MwComboBox cb = handle->internal;
|
||||||
|
|
||||||
cb->opened = cb->opened ? 0 : 1;
|
cb->opened = cb->opened ? 0 : 1;
|
||||||
|
if(cb->opened) {
|
||||||
|
MwLLSetCursor(handle->lowlevel, &MwCursorArrow, &MwCursorArrowMask);
|
||||||
|
} else {
|
||||||
|
MwLLSetCursor(handle->lowlevel, &MwCursorDefault, &MwCursorDefaultMask);
|
||||||
|
}
|
||||||
|
|
||||||
MwForceRender(handle);
|
MwForceRender(handle);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -162,25 +162,12 @@ static void click(MwWidget handle) {
|
||||||
|
|
||||||
static void mwSubMenuAppearImpl(MwWidget handle, MwMenu menu, MwPoint* point) {
|
static void mwSubMenuAppearImpl(MwWidget handle, MwMenu menu, MwPoint* point) {
|
||||||
int i, w = 0, h = 0;
|
int i, w = 0, h = 0;
|
||||||
#ifdef USE_X11
|
|
||||||
XSetWindowAttributes xswa;
|
|
||||||
Atom wndtype = XInternAtom(handle->lowlevel->display, "_NET_WM_WINDOW_TYPE", False);
|
|
||||||
Atom wndmenu = XInternAtom(handle->lowlevel->display, "_NET_WM_WINDOW_TYPE_MENU", False);
|
|
||||||
|
|
||||||
xswa.override_redirect = True;
|
|
||||||
|
|
||||||
XChangeWindowAttributes(handle->lowlevel->display, handle->lowlevel->window, CWOverrideRedirect, &xswa);
|
|
||||||
XChangeProperty(handle->lowlevel->display, handle->lowlevel->window, wndtype, XA_ATOM, 32, PropModeReplace, (unsigned char*)&wndmenu, 1);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
handle->internal = menu;
|
handle->internal = menu;
|
||||||
|
|
||||||
MwLLDetach(handle->lowlevel, point);
|
MwLLDetach(handle->lowlevel, point);
|
||||||
|
|
||||||
#ifdef USE_GDI
|
MwLLMakeToolWindow(handle->lowlevel);
|
||||||
SetWindowLongPtr(handle->lowlevel->hWnd, GWL_STYLE, (LPARAM)0);
|
|
||||||
SetWindowLongPtr(handle->lowlevel->hWnd, GWL_EXSTYLE, (LPARAM)WS_EX_TOOLWINDOW);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
MwLLShow(handle->lowlevel, 1);
|
MwLLShow(handle->lowlevel, 1);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue