boolean IsMouseInOtherMenu(XlibMenu *xlibMenu, int x, int y) { FcitxLightUI *lightui = xlibMenu->owner; FcitxInstance* instance = lightui->owner; FcitxUIMenu** menupp; for (menupp = (FcitxUIMenu **) utarray_front(&instance->uimenus); menupp != NULL; menupp = (FcitxUIMenu **) utarray_next(&instance->uimenus, menupp) ) { XlibMenu* otherXlibMenu = (XlibMenu*) (*menupp)->uipriv; if (otherXlibMenu == xlibMenu) continue; XWindowAttributes attr; XGetWindowAttributes(lightui->dpy, otherXlibMenu->menuWindow, &attr); if (attr.map_state != IsUnmapped && IsInBox(x, y, attr.x, attr.y, attr.width, attr.height)) { return true; } } XlibMenu* otherXlibMenu = lightui->mainMenuWindow; if (otherXlibMenu == xlibMenu) return false; XWindowAttributes attr; XGetWindowAttributes(lightui->dpy, otherXlibMenu->menuWindow, &attr); if (attr.map_state != IsUnmapped && IsInBox(x, y, attr.x, attr.y, attr.width, attr.height)) { return true; } return false; }
void cDraw::Engine_Scroll(int x, int y, int &studio, char **typ, int max, LPSTR text, IDirect3DDevice9* pDevice) { if (IsInBox(x + 128, y, 266, 20)) Draw_Border(x + 130, y, 265, 20, 1, ForestGreen, pDevice); Draw_Border(x + 303, y + 2, 18, 15, 2, ForestGreen, pDevice); Draw_Box(x + 306, y + 5, 14, 11, ForestGreen, pDevice); Draw_Text(x + 314, y + 3, AliceBlue, "<", C_Text); Draw_Border(x + 374, y + 2, 18, 15, 2, ForestGreen, pDevice); Draw_Box(x + 377, y + 5, 14, 11, ForestGreen, pDevice); Draw_Text(x + 385, y + 3, AliceBlue, ">", C_Text); if (IsInBox(x + 374, y + 2, 18, 15) && (State_Key(VK_LBUTTON, 1000))) { if (studio >= 0 && studio<max) { studio++; } } if (IsInBox(x + 306, y + 2, 18, 15) && (State_Key(VK_LBUTTON, 1000))) { if (studio != 0) { studio--; } } Draw_Text(x + 350, y + 3, AliceBlue, typ[studio], C_Text); Draw_Text(x + 135, y + 2, AliceBlue, text, L_Text); }
void cDraw::Engine_CheckBox(int x, int y, int &Var, LPSTR text, IDirect3DDevice9* pDevice) { Draw_Text(x + 135, y + 2, AliceBlue, text, L_Text); Draw_Border(x + 374, y + 2, 18, 15, 2, ForestGreen, pDevice); if (IsInBox(x + 128, y, 266, 20)) Draw_Border(x + 130, y, 265, 20, 1, ForestGreen, pDevice); if (IsInBox(x + 374, y + 2, 18, 15)) if (State_Key(VK_LBUTTON, 1000)) Var = !Var; if (Var) DrawBox(x + 377, y + 5, 14, 11, ForestGreen, pDevice); }
void cMenu::Item_Button(char* text) { int x = (ItemMenu).x, y = (ItemMenu).y, h = 22, w = ButWidth; D3DCOLOR in_mause_pos = color_But; Render.render_Box(x, y, w, h, color_But); if (IsInBox(x, y, w, h)) { in_mause_pos = color_InBut; if (State_Key(VK_LBUTTON, 30)) { if (Button_Mass[Button_Number] != 1) Button_Mass[Button_Number] = 1; } } if (Button_Mass[Button_Number]) { in_mause_pos = vivid_red; for (int i = 0; i < MAIN_ITEM; i++) if (i != Button_Number) Button_Mass[i] = 0; } Render.render_Box(x, y, 4, h, in_mause_pos); Render.render_Border(x, y, w, h, 1, color_Bord); Render.render_Border(x, y, 4, h, 1, color_Bord); Render.render_String(x + (w / 2), y + 4, color_Text_Contrl, DT_CENTER, text); Button_Number = Button_Number + 1; if (Button_Max < Button_Number) Button_Max = Button_Number; (ItemMenu).y = y + 20; }
void cDraw::Engine_Button(int x, int y, int &Var, LPSTR text, IDirect3DDevice9* pDevice) { if (IsInBox(x, y, 130, 25)) { DrawBox(x + 3, y + 3, 120, 21, ForestGreen, pDevice); if (State_Key(VK_LBUTTON, 1000)) { Varm.Menu0 = Varm.Menu1 = Varm.Menu2 = Varm.Menu3 = Varm.Menu4 = Varm.cvet = 0; Var = !Var; } } if (Var) DrawBox(x + 3, y + 3, 120, 21, ForestGreen, pDevice); Draw_Border(x, y, 124, 25, 2, ForestGreen, pDevice); Draw_Text(x + 64, y + 5, AliceBlue, text, C_Text); }
/* Настройка цвета */ void cDraw::M1Chams(int x, int y, char *Text, int &Var, DWORD CoLoR1, DWORD CoLoR2, DWORD CoLoR3, DWORD CoLoR4, DWORD CoLoR5, DWORD CoLoR6, DWORD CoLoR7, DWORD CoLoR8, DWORD CoLoR9, DWORD CoLoR10, IDirect3DDevice9* mDevice) { DWORD CoL; DWORD R_COL = WHITE; DWORD Color = WHITE; if (IsInBox(x + 374, y + 2, 18, 15)) { R_COL = ForestGreen; Color = ForestGreen; if (State_Key(VK_LBUTTON, 1000)) { if (Var >= 0){ Var++; } } if (State_Key(VK_LBUTTON, 1000)) { if (Var != 0) { Var--; } } } switch (Var) { case 1: CoL = CoLoR1; break; case 2: CoL = CoLoR2; break; case 3: CoL = CoLoR3; break; case 4: CoL = CoLoR4; break; case 5: CoL = CoLoR5; break; case 6: CoL = CoLoR6; break; case 7: CoL = CoLoR7; break; case 8: CoL = CoLoR8; break; case 9: CoL = CoLoR9; break; case 10: CoL = CoLoR10; break; case 11: Var = 0; break; } if (Var>0) { DrawBox(x + 377, y + 5, 14, 11, CoL, mDevice); Color = ForestGreen; } DrawBorder(x + 374, y + 2, 18, 15, ForestGreen, mDevice); Draw_Text(x + 135, y + 2, AliceBlue, Text, L_Text); }