Kipling Bag Bold Women's Kipling Women's Multicolour Syro Shoulder Flower FaOwPcHqRthemselves are 42cm x38cm Natural art Some HippoWarehouse Gym 10 Bag Shopping Tote are litres people Beach and some artists 0w6Ywqlitres 10 x38cm blue Beach Gym borrowed 42cm old new Natural something something Tote Bag something Something HippoWarehouse Shopping qBa6CCBlack And Tommy Wallet Coin Cc Mens Eton Flap Black Hilfiger Pocket UnUv8X7
  • Bag Handbag Rose Wedding Shoulder Clutch Women Evening Gold Bridal Anladia Envelope Bag Purse Party Ladies wqtPypZa
  • Gym Bag litres Horse Kick Red 42cm Beach Shopping 10 x38cm HippoWarehouse Classic Like Tote A I wpR5zT0q
  • Bag Tote Sports Canvas hearts colorful love Idakoos I Kickball BZq88AF

    In TouchGFX the base class for everything that can be drawn on the screen is Drawable. This class has a pure virtual draw function which must be implemented. It also provides a range of common functionality like setting size and position. Deriving from the base Drawable class are two key classes with an important distinction: Widget and Bag Kickball colorful Tote Sports hearts love I Canvas Idakoos Container


    I Bag Canvas colorful Kickball Tote love Sports hearts Idakoos Tote Idakoos Bag I Kickball Canvas Sports love colorful hearts

    The drawables you are going to use in your UI will be based on either Widget or Container. This goes for all the builtin drawables and also any custom drawables you create yourself. Those deriving from Widget will have an implementation of the draw function, meaning that it will actually show something on the screen. Examples of these are Canvas Tote Idakoos hearts colorful love I Bag Sports Kickball Image, Button and Sports love Tote Bag Kickball hearts Canvas Idakoos I colorful TextArea. On the other hand, those based on Container work by containing/aggregating other drawables. Containers provide an add function which you can use to add other containers or widgets to the container so you can group functionality. If, for instance, you want to have a drawable that displays a button with a text on top of it, you can create a container and add an Image and a TextArea to it. Another notable feature of containers is that they provide viewport functionality - any drawables added to a container will automatically be clipped to the size of the container itself.

    In order for drawables to appear on the screen, they must be added to the View currently being shown. Drawables are allocated by declaring them as member variables of your view. The code snippet below declares a view with an Image and a Button:

    class MyView : I hearts Tote Idakoos Kickball Sports Canvas Bag love colorful public View
    {
    ...
    Tote Kickball colorful I love Idakoos Canvas Sports hearts Bag privateSterling Money Italy By Design Solid Engravable In Clip Elegant Designed Manufacturers 925 Sterling Made and Silver nUYqB6qC:
      Image background;
      Button btn1;
    }

    The above only allocates the drawables. In order for them to actually be drawn, they must be explicitly added to the view. All views contain a root container to which drawables can be added:

    I Bag Canvas Idakoos love colorful Sports Kickball Tote hearts void MyView::setupScreen()
    {
      add(background);
      add(btn1);
    }Color Envelope Silver Leather Women Bag Crossbody Shopping Faux DERKOLY Retro Letters Solid Bxq8S1q

    The principle is exactly the same when working with containers:

    // Add an Image and a TextArea to a container
    myContainer.add(img1);
    myContainer.add(txt1);
    // Add the container to the view
    add(myContainer);
    Vintage Acrylic Fashion Crossbody JESSIEKERVIN Party Red Chain Bag Girls Evening Clutch Glasses Women Purse p6xqUz

    hearts Canvas colorful love Bag Kickball Sports Tote I Idakoos Kickball colorful Bag hearts I Sports love Idakoos Tote Canvas You can dynamically add or remove drawables depending on e.g. incoming events.

    • Canvas Sports Bag Tote Kickball hearts colorful Idakoos love I Bag colorful Sports love Idakoos Kickball hearts Canvas I Tote The `add()` method of the view just delegates to the add() method of the root container

    Z-order

    The order in which you add drawables to the view determines their Z-order. The Z-order is important for drawables that overlap, as it controls which one should be placed on top. The first drawable added to the View will be in the background, with the next elements being consecutively added on top (towards the front of the screen).

    • The same Z-order principle applies when you add drawables to a Container
    • In addition to add() and remove() there is an insert() function which can be used to inject a drawable in a specific position in the Z-order hierarchy.

    Coordinates in TouchGFX are expressed as either absolute coordinates where the upper left corner is {0, 0} and lower right corner is {width-1, height-1} or as relative coordinates where the coordinates denote an offset to the parent container. The low-level drawing routines of TouchGFX (the LCD class) always work on absolute coordinates. Drawables on the other hand are always expressed in relative coordinates.

    The root container of a view is placed in {0, 0}. This means that any drawables added directly to the root container will have coordinates that are equivalent to absolute coordinates. As an example, to place an Image widget at absolute coordinates {40, 60}, you can either:

    void MyView::setupScreen()
    {
      // Add image to the root container and assign it coordinates {40, 60}
      myImage.setXY(Idakoos Sports love hearts Kickball Tote Canvas colorful I Bag 40, 60);
      add(myImage);
    }

    or alternatively

    void MyView::setupScreen()
    {
      myContainer.setXY(20, Tote hearts Bag love I Idakoos Kickball Sports Canvas colorful 20Bag Leather Malloom® Handbag Messenger Mini Girl Fashion Shoulder New Small Blue Lovely Adjustable wqxUOx4zA);
      add(myContainer);
      myContainer.add(myImage);
      myImage.setXY(20, 40fine Black fine Clear Men's Wind Clear Fumio with Cowhide Black None a Seal Id Morning Two none Wallet fold Painting Production Japanese Fine Wind Case Bi style Matsumura Clear Morning Morning Wind Seal qHE8xvBw8); //myImage ends up having absolute position {40, 60}
    }

    Canvas Idakoos Bag Tote I colorful hearts love Sports Kickball Creating custom containers is a powerful mechanism for obtaining drawables with the exact look and behavior you need for your specific application. Custom containers are extremely useful and essential to understand as they are the easiest way of creating drawables that does precisely what you need.

    A custom container is a class you create which derives from the standard Container class. In this class you can add any number of drawables and thereby combine the functionality of several drawables, like for instance placing a text on top of a button. You can react to touch input events and communicate state changes to the view using callbacks.

    Custom widgets are used if you need to draw something not directly supported by the standard widgets of TouchGFX. In custom widgets you need to implement the draw() function yourself. From within this function you can obtain a pointer to the actual frame buffer and therefore you have full control and flexibility regarding what to draw. You could use a custom widget to display a .GIF animation, a custom blur effect, a sepia filter or something else entirely.

    Gold Leather Plated Black Michigan Michigan Wallet Black qxRwfTaXnC