Announcement

Collapse
No announcement yet.

Show the numeric keyboard in different location

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Show the numeric keyboard in different location

    I create 15 forms in uLCD-43DT. I have 1 numeric keyboard, and I want to show that keyboard into a forms with a different location. How to do that?
    Best Regards

    Edha

  • #2
    You need to put the keyboard onto each form.

    Or perhaps have a generic keyboard form with a heading that shows it's current purpose.
    Mark

    Comment


    • #3
      I successfully put one numeric keyboard in different forms but with the same location, eg point(x,y): 10.10. I want the numeric keyboard have different locations, eg
      Form1: the keyboard located at the point (x, y): 10, 10,
      Form2: the keyboard located at the point: (x, y): 40, 50.
      How do I move that keyboard, so that the keyboard looks different location for each forms?
      Best Regards

      Edha

      Comment


      • #4
        Sorry, you will need to alter the IMAGE_XPOS and IMAGE_YPOS attributes of all the image control entries associated with the Keyboard.

        That will be ikeyboardx through to and including ikeyboardx+okeyboardx[KbButtons]

        Since the numbers will vary you will need to 'offset' them and save the x+y offsets so that you can undo them when picking a new position.
        Mark

        Comment


        • #5
          Thank you so much for point out. I get it.

          Code:
          #CONST
              NUMERIC_STRUCT_LENGTH    14
          #END
          
          // read from numericKeyboard1.dat
          var loginKeyboardX [NUMERIC_STRUCT_LENGTH]:= [0x00A4, 0x00F0, 0x00A4, 0x00CA, 0x00F0, 0x0116, 0x00A4, 0x00CA, 0x00F0, 0x0116, 0x00A4, 0x00CA, 0x00F0];
          var loginKeyboardY [NUMERIC_STRUCT_LENGTH]:= [0x0046, 0x0046, 0x006C, 0x006C, 0x006C, 0x006C, 0x0092, 0x0092, 0x0092, 0x0092, 0x00B8, 0x00B8, 0x00B8];
          
          // read from numericKeyboard2.dat
          var systemKeyboardX[NUMERIC_STRUCT_LENGTH]:= [0x0145, 0x0191, 0x0145, 0x016B, 0x0191, 0x01B7, 0x0145, 0x016B, 0x0191, 0x01B7, 0x0145, 0x016B, 0x0191];
          var systemKeyboardY[NUMERIC_STRUCT_LENGTH]:= [0x0075, 0x0075, 0x009B, 0x009B, 0x009B, 0x009B, 0x00C1, 0x00C1, 0x00C1, 0x00C1, 0x00E7, 0x00E7, 0x00E7];
          
          var keyboardX[NUMERIC_STRUCT_LENGTH], keyboardY[NUMERIC_STRUCT_LENGTH];
          
          func enableKeyboard(var kbType)
              var i;
              keyboardType := kbType;
          
              switch(window)
                  case LOGIN_WINDOW:
                      mem_Copy(loginKeyboardX, keyboardX, NUMERIC_STRUCT_LENGTH * 2);
                      mem_Copy(loginKeyboardY, keyboardY, NUMERIC_STRUCT_LENGTH * 2);
                      img_SetPosition(numericKeyboardHandle, 0, 0x00A3, 0x0045);
                      break;
                  case SYSTEM_WINDOW:
                      mem_Copy(systemKeyboardX, keyboardX, NUMERIC_STRUCT_LENGTH * 2);
                      mem_Copy(systemKeyboardY, keyboardY, NUMERIC_STRUCT_LENGTH * 2);
                      img_SetPosition(numericKeyboardHandle, 0, 0x0144, 0x0074);
                      break;
              endswitch
          
              if(kbType==NUMERIC)
                  hndl         := numericKeyboardHandle;
                  iKeyboard1   := iNumKeyboard1;
                  oKeyboard1   := oNumKeyboard1;
                  iKeyboard1keystrokes := iNumKeyboard1keystrokes;
              else if(kbType==QWERTY)
                  hndl         := qwertyKeyboardHandle;
                  iKeyboard1   := iQweKeyboard1;
                  oKeyboard1   := oQweKeyboard1;
                  iKeyboard1keystrokes := iQweKeyboard1keystrokes;
              endif
              
              for (i := iKeyboard1 + 1; i<=(iKeyboard1 + oKeyboard1[KbButtons]); i++)
                  img_SetWord(hndl, i, IMAGE_XPOS, keyboardX[i-1]);  // change this value for move keyboard location
                  img_SetWord(hndl, i, IMAGE_YPOS, keyboardY[i-1]);  // change this value for move keyboard location
                  img_SetWord(hndl, i, IMAGE_FLAGS, (img_GetWord(hndl, i, IMAGE_FLAGS) | I_STAYONTOP) & ~I_TOUCH_DISABLE);
              next
              img_Show(hndl, iKeyboard1);
          endfunc
          Last edited by edha; 12th April 2015, 06:40 AM.
          Best Regards

          Edha

          Comment

          Working...
          X