Ejemplo n.º 1
0
static gboolean
skbdwin_button_press(GtkWidget *w, GdkEventButton *ev, gpointer p)
{

	if (ev->type == GDK_BUTTON_PRESS) {
		switch (ev->button) {
		case 1:
			softkbd_down((int)ev->x, (int)ev->y);
			break;
		}
		return TRUE;
	}
	return FALSE;
}
Ejemplo n.º 2
0
static LRESULT CALLBACK skproc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) {

	switch(msg) {
		case WM_CREATE:
			np2class_wmcreate(hWnd);
			winloc_setclientsize(hWnd, skbdwin.width, skbdwin.height);
			np2class_windowtype(hWnd, (skbdcfg.type & 1) + 1);
			break;

		case WM_PAINT:
			skpaintmsg(hWnd);
			break;

		case WM_LBUTTONDOWN:
			if ((softkbd_down(LOWORD(lp), HIWORD(lp))) &&
				(skbdcfg.type & 1)) {
				return(SendMessage(hWnd, WM_NCLBUTTONDOWN, HTCAPTION, 0L));
			}
			break;

		case WM_LBUTTONDBLCLK:
			if (softkbd_down(LOWORD(lp), HIWORD(lp))) {
				skbdcfg.type ^= 1;
				wintypechange(hWnd, (skbdcfg.type & 1) + 1);
				sysmng_update(SYS_UPDATEOSCFG);
			}
			break;

		case WM_LBUTTONUP:
			softkbd_up();
			break;

		case WM_KEYDOWN:
		case WM_KEYUP:
			SendMessage(hWndMain, msg, wp, lp);
			break;

		case WM_ENTERMENULOOP:
			soundmng_disable(SNDPROC_SUBWIND);
			break;

		case WM_EXITMENULOOP:
			soundmng_enable(SNDPROC_SUBWIND);
			break;

		case WM_ENTERSIZEMOVE:
			soundmng_disable(SNDPROC_SUBWIND);
			winlocex_destroy(skbdwin.wlex);
			skbdwin.wlex = np2_winlocexallwin(hWnd);
			break;

		case WM_MOVING:
			winlocex_moving(skbdwin.wlex, (RECT *)lp);
			break;

		case WM_EXITSIZEMOVE:
			winlocex_destroy(skbdwin.wlex);
			skbdwin.wlex = NULL;
			soundmng_enable(SNDPROC_SUBWIND);
			break;

		case WM_MOVE:
			if (!(GetWindowLong(hWnd, GWL_STYLE) &
									(WS_MAXIMIZE | WS_MINIMIZE))) {
				RECT rc;
				GetWindowRect(hWnd, &rc);
				skbdcfg.posx = rc.left;
				skbdcfg.posy = rc.top;
				sysmng_update(SYS_UPDATEOSCFG);
			}
			break;

		case WM_CLOSE:
			DestroyWindow(hWnd);
			break;

		case WM_DESTROY:
			np2class_wmdestroy(hWnd);
			dd2_release(skbdwin.dd2hdl);
			skbdwin.hwnd = NULL;
			break;

		default:
			return(DefWindowProc(hWnd, msg, wp, lp));
	}
	return(0L);
}