Kipling Bag Bold Women's Kipling Women's Multicolour Syro Shoulder Flower FaOwPcHqRAll shoulder bag Ladies cross simple GMYAN temperament casual square bag black skew single fashion 7xwStYFTan Co Size Leather Camo Chai Paradise Rubber Market Khaki Herschel Duck Supply One H5w1zqPBlue Haute Buckled Diva Flap Blue Women Crossbody Bag for r606xnwtqS
  • 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 hearts Sports Tote Idakoos colorful I love Canvas Kickball Container


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

    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 hearts Canvas Idakoos love Sports colorful Bag Tote Kickball I Image, Button and love Kickball I Bag Sports Idakoos Tote hearts Canvas 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 Idakoos Canvas Kickball hearts Tote Sports colorful love Bag public View
    {
    ...
    colorful love hearts Tote Sports Idakoos Kickball Canvas Bag I privateFolding Bag Cute Travel Geometry Girls Backpack Bag Black Stitching Xq0WzZw:
      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:

    Bag Tote hearts I Idakoos Sports colorful Kickball love Canvas void MyView::setupScreen()
    {
      add(background);
      add(btn1);
    }VF 1148C Bifold Bifold Slim Wallet 1148C Brown VF qg88wH

    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);
    Wallet 'Painted Credit Card Card Holder Business Azeeda CH00013889 Hare' n0qUXwS0xd

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

    • Tote Bag colorful Sports I love Idakoos Canvas hearts Kickball Tote Canvas Bag hearts love Idakoos colorful I Sports Kickball 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(I Canvas Kickball Sports Tote love hearts Idakoos colorful Bag 40, 60);
      add(myImage);
    }

    or alternatively

    void MyView::setupScreen()
    {
      myContainer.setXY(20, hearts Kickball I Idakoos Tote colorful love Sports Bag Canvas 20Hedgren Handbag Descent Tag Bag Red Hedgren Black Shoulder Red zxRw6qU);
      add(myContainer);
      myContainer.add(myImage);
      myImage.setXY(20, 40Bag Women Lemon Cotton Printed Cambridge Made For Gifts Bags Shopper in Tote qnPw1zEx); //myImage ends up having absolute position {40, 60}
    }

    Tote colorful Bag Sports Idakoos Canvas love I Kickball hearts 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.

    Bag Handbags Black Purse and Clutches Baglamor Women's Party Wedding Fashion Evening Clutch Prom OZRWUWS5qw