Announcement

Collapse
No announcement yet.

Window problems

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

  • Window problems

    I create a window. Then I add a textbox, button and keyboard on top the window. I create all controls with the image controls(gci, dat). I have two problems:

    1. How do I hide the keyboard without damaging the existing window(truncated)? I tried to put the rectangle(with the same color as the window) on top of the keyboard but it makes the image of window at the bottom of the keyboard becomes damaged/truncated.

    2. How do I keep text/values in textbox always visible when window moves/scroll vertically? Thanks.
    Best Regards

    Edha

  • #2
    1. That should work, can you show a photo of what you mean?
    2. I don't fully understand how you are moving/scrolling the window and what is happenning, Can you show a photo?
    Mark

    Comment


    • #3
      Hello sir,

      I completed the first problem, the fault is in the line of my code.

      For second problem:
      I used uLCD-43DT modules.
      1. On Main window: swap right or left to show Login window.
      2. On Login window: password 12345678 then Enter to show Settings window.
      3. On Settings window: select system(click system icon) to show System window.
      4. On System window: press value from numeric keyboard, eg 123. That value will be display on textbox. Problem in here when I scroll window to up/down, then my value lost from textbox. How to keep a fixed value appears in the textbox when the window on the scroll?

      Code:
      func hideKeyboard()
          if(currentKeyboard==NUMERIC)
               gfx_RectangleFilled(0x0144, 0x0074, 0x0144+154, 0x0074+154, BODY_BACKCOLOR);  // remove numeric keyboard with size(154x154 pixels)
          else if(currentKeyboard==QWERTY)
               gfx_RectangleFilled(0x0001, 0x006E, 0x0001+480, 0x006E+161, BODY_BACKCOLOR);  // remove qwerty keyboard with size(480x161 pixels)
          endif
          drawBodyFrame();
          isKeyboardVisible := FALSE;
      endfunc
      
      func scrollWindow(var windowHandle)
          var i, j, k;
      
          if(currentWindow != MAIN_WINDOW && currentWindow != LOGIN_WINDOW && isKeyboardVisible==TRUE)
              hideKeyboard();
          endif
      
          j := 31; // 2^n+1
          lastOutput := presentReading;
          presentReading := ABS(touchedY2-touchedY1) / j;
          k := (j*(presentReading + lastOutput)) / j++;
          for(i:=0; i<k; i++)
              if(moveDirection==TO_DOWN)
                  if(scrollYDistance >= -TOUCH_AREA_HEIGHT)
                      scrollYDistance -= 5;
                  else
                      scrollYDistance := TOUCH_AREA_HEIGHT;
                  endif
              else if(moveDirection==TO_UP)
                  if(scrollYDistance <= TOUCH_AREA_HEIGHT)
                      scrollYDistance += 5;
                  else
                      scrollYDistance := -TOUCH_AREA_HEIGHT;
                  endif
              endif
              if(moveDirection==TO_DOWN || moveDirection==TO_UP)
                  gfx_ClipWindow(1, HEADER_HEIGHT+1, TOUCH_AREA_WIDTH-1, TOUCH_AREA_HEIGHT-1);
                  gfx_Clipping(ON);
                  img_SetPosition(windowHandle, 0, 1, scrollYDistance);
                  img_Enable(windowHandle, 0);
                  img_Show(windowHandle, 0);
              endif
          nextendfunc
      I send completed code and uSD files(4D.rar) to http://www.4dsystems.com.au/support.

      Thanks.
      Best Regards

      Edha

      Comment


      • #4
        The Scrolling of the image will overwrite the text in the textbox 'immediately', you will need to redraw the text in the new location of the textbox.
        Mark

        Comment


        • #5
          Thank you, my problem solved.
          Best Regards

          Edha

          Comment

          Working...
          X