How does the IDE draw controls?

  1. 7 months ago

    Garry P

    29 Jan 2017 Pre-Release Testers Europe (Torquay, UK)

    I'm fascinated by how the IDE draws the native windows and controls in the UI designer. Are they actual windows and widgets somehow shoe horned into the app or are they just accurately drawn on a canvas?

    I ask for two reasons:

    1). Shear curiosity as a programmer
    2). I've been toying around with a wireframing/prototyping app and getting some insight as to how Xojo do it would be great.

  2. Edited 7 months ago by Norman P

    The window frame on OS X uses private API's in OS X - dont need private API's on Windows or Linux
    Desktop controls are drawn using draw into

  3. Garry P

    30 Jan 2017 Pre-Release Testers Europe (Torquay, UK)

    So when you say desktop controls are drawn using DrawInto do you mean they are just cleverly crafted images drawn to a canvas or are there declares that provide the image of a button/popupmenu, etc that you can then render?

  4. Christoph D

    30 Jan 2017 Pre-Release Testers, Xojo Pro

    To my understanding the Drawinto just returns an image of the control. It's static for sure.

  5. Emile S

    30 Jan 2017 Europe (France, Strasbourg)

    @Christoph Dnbsp;Vocht control

    or window ?

    To be honest, I do not understand the use(or to use DrawInto in that case).

  6. Garry P

    30 Jan 2017 Pre-Release Testers Europe (Torquay, UK)

    So is there an API for Win/Linux that will return an image of the various windows and controls that can then be drawn to a Xojo canvas?

  7. Edited 7 months ago by Norman P

    @Garry P So when you say desktop controls are drawn using DrawInto do you mean they are just cleverly crafted images drawn to a canvas or are there declares that provide the image of a button/popupmenu, etc that you can then render?

    No
    Literally RectControl.DrawInto
    We dont need a button you can push - just the picture

    Its basically much the same technique displayed in the Example project "CanvasDragRect.xojo_binary_project" just using pictures of controls

  8. 4 months ago

    Garry P

    Apr 18 Pre-Release Testers Europe (Torquay, UK)

    Finally got round to playing with this. If you literally cut and paste the example from (RectControl.DrawInto ) it works but the drawn control is blurry. I'm guessing this is a HiDPI issue. Is there something special that needs to be done to render the control crisply?

  9. Norman P

    Apr 18 Xojo Inc

    just making sure you draw into a picture that is, when on a hidpi screen, also set to be hidpi etc

  10. Thomas T

    Apr 19 Pre-Release Testers Europe (Germany, Munich)

    Now, if you could rephrase the title of this discussion to a useful one that actually tells us what it's talking about, such as "How does the IDE draw controls in the UI designer", making a bookmark of it would actually help finding this later again when I ever get to add this feature to Arbed ;)

or Sign Up to reply!