I use this event to draw my websdk in the window editor
problem: if the websdk is inside a webcontainer, and some locks are in place, the rectangle is drawn with the size of the original websdk and not the streched one
how can I get the height and width of the streched websdk here in place of g.height and g.width ?
thanks.
Sub DrawControlInLayoutEditor(g As Graphics) Handles DrawControlInLayoutEditor
Dim mVisible As String = StringProperty("Visible")
If mVisible<>"true" Then
g.Transparency = 70
g.DrawingColor = &c00000000
g.DrawRoundRectangle 0,0,g.Width,g.Height,5,5
g.DrawLine 0,0,g.Width,g.Height
g.DrawLine 0,g.Height,g.Width,0
Return
End If
g.DrawingColor = &c00000000
// But if the Enabled property is turned off...
If Not BooleanProperty("Enabled") Then
g.Transparency = 70
Else
g.Transparency = 0
End If
// draw the button caption depending on the size and outline
g.FontSize = 16
g.Italic = True
Dim mName As String = StringProperty("Name")
g.DrawText(mName, 10, 20)
g.DrawRoundRectangle 0,0,g.Width,g.Height,5,5
End Sub
My guess is that this is a bug that Xojo needs to fix. Again, this is only a guess.
The āstretchā works directly on the WebPage but not inside the container (for IDE representation only). On the Browser it works correctly.
IDE:
Browser:
Maybe @Ricardo_Cruz can confirm if he can do something to make the IDE work correctly or if there is need for extra code.
Right and thatās what I was getting at (sorry Alberto, Iām typing faster than reading).
IIRC, we (when I worked at Xojo) found that redrawing each containerās contents was very processor intensive and slowed things way down if you had more than two or three containers on a page.
They may have optimized things since then, so weād need @Ricardo_Cruz to chime in here.
Just keep in mind that drawing each websdk control involves running a xojoscript. We translated the entire Graphics object into a context object (plus a few things you needed to access properties and constants), an escape mechanism (so drawing these could not lock up the IDE with an endless loop), add your drawing script and then run it to create a picture that the IDE can use. With precompiled scripts that should be very fast, but thereās still going to be some overhead.