Ejemplo n.º 1
0
boolean MessageWindowEventHandler(void *arg, XEvent* event)
{
    MessageWindow* messageWindow = (MessageWindow*) arg;
    if (event->type == ClientMessage
            && event->xclient.data.l[0] == messageWindow->owner->killAtom
            && event->xclient.window == messageWindow->window
       )
    {
        XUnmapWindow(messageWindow->owner->dpy, messageWindow->window);
        return true;
    }

    if (event->xany.window == messageWindow->window)
    {
        switch (event->type)
        {
        case Expose:
            DrawMessageWindow(messageWindow, NULL, NULL, 0);
            DisplayMessageWindow(messageWindow);
            break;
        case ButtonRelease:
        {
            switch (event->xbutton.button)
            {
            case Button1:
                XUnmapWindow(messageWindow->owner->dpy, messageWindow->window);
                break;
            }
        }
        break;
        }
        return true;
    }
    return false;
}
Ejemplo n.º 2
0
void ClassicUIDisplayMessage(void* arg, char* title, char** msg, int length)
{
    FcitxClassicUI* classicui = (FcitxClassicUI*) arg;
    XMapRaised(classicui->dpy, classicui->messageWindow->window);
    DrawMessageWindow(classicui->messageWindow, title, msg, length);
}
Ejemplo n.º 3
0
void DrawParamScreen(void)
{
  SetFont(SMALL_FONT);
  LcdText(1, 0, 118, 7, screens[ps_screen].header);
  LcdLine(0, 8, 127, 8);  
  LcdLine(0, 9, 127, 9);
  LcdLine(0, 20, 127, 20);  
  LcdLine(0, 31, 127, 31);  
  LcdLine(0, 42, 127, 42);  
  LcdLine(0, 53, 127, 53); 
  //LcdLine(0, 54, 127, 54);
  
  LcdLine(42, 10, 42, 52);
  LcdLine(86, 10, 86, 52);
  LcdLine(119, 0, 119, 7);
  
  if(GetPasswordEntered()) LcdText(121, 1, 127, 7, "P");
  
  LcdText(1, 11, 41, 18, GetNameByTag(screens[ps_screen].var1));
  if(ps_focus == 0)
  {
    LcdSetColor(BLACK);
    LcdRect(43, 10, 85, 19);
    LcdSetColor(WHITE);
  };
  LcdText(44, 11, 85, 18, "9234.567");
  LcdSetColor(BLACK);
  LcdText(88, 11, 127, 18, GetUnitByTag(screens[ps_screen].var1));
  
  LcdText(1, 22, 41, 29, "variabl2");
  if(ps_focus == 1)
  {
    LcdSetColor(BLACK);
    LcdRect(43, 21, 85, 30);
    LcdSetColor(WHITE);
  };
  LcdText(44, 22, 85, 29, "9234.567");
  LcdSetColor(BLACK);    
  LcdText(88, 22, 127, 29, "some_tx2");

  LcdText(1, 33, 41, 40, "variabl3");
  if(ps_focus == 2)
  {
    LcdSetColor(BLACK);
    LcdRect(43, 32, 85, 41);
    LcdSetColor(WHITE);
  };
  LcdText(44, 33, 85, 40, "9234.567");
  LcdSetColor(BLACK);    
  LcdText(88, 33, 127, 40, "some_tx3");

  LcdText(1, 44, 41, 51, "variabl4");
  if(ps_focus == 3)
  {
    LcdSetColor(BLACK);
    LcdRect(43, 43, 85, 52);
    LcdSetColor(WHITE);
  };
  LcdText(44, 44, 85, 51, "9234.567");
  LcdSetColor(BLACK);  
  LcdText(88, 44, 127, 51, "some_tx4");
  
  //control buttons
  /*
  if(ps_focus == 4)
  {
    LcdSetColor(BLACK);
    LcdRect(0, 55, 41, 63);
    LcdSetColor(WHITE);
  };
  LcdText(1, 56, 41, 63, "Назад");
  LcdSetColor(BLACK);  

  if(ps_focus == 5)
  {
    LcdSetColor(BLACK);
    LcdRect(43, 55, 85, 63);
    LcdSetColor(WHITE);
  };  
  LcdText(44, 56, 85, 63, "Гл. экр.");
  LcdSetColor(BLACK);
  
  if(ps_focus == 6)
  {
    LcdSetColor(BLACK);
    LcdRect(87, 55, 127, 63);
    LcdSetColor(WHITE);
  };
  LcdText(88, 56, 127, 63, "Вперед");  
  LcdSetColor(BLACK);
  */
  LcdClear();
  DrawButton(0, 53, BTN_BACK, ps_focus == 4);
  DrawButton(42, 53, BTN_HOME, ps_focus == 5);
  DrawButton(84, 53, BTN_FORWARD, ps_focus == 6);
  
  DrawMessageWindow("строка1", "строка2", "строка2", MB_OK + MB_CANCEL);
  
  DrawEditorScreen();
    
  LcdDraw();
}