TsTrackBar causes Exception

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #36702
    Scurra
    Participant

    Hi,

    I am having a problem with the TsTrackBar. Unfortunately, I could not reproduce the problem in a simple demo-application. All I can do for the moment is to describe you the problem and sending you a call stack. Maybe you have had a similar problem in the past or you have an idea of what's going wrong.

    First, I will explain you what I am doing:

    I have a form in my application which contains a TsTrackbar. Assume that the form is initially not in the maximized state. I place the cursor over the titlebar of the form and hold the left mouse-button. Now I drag the form to the upper border of the screen and release the mouse button. As usual, the form is maximized. But after releasing the mouse button, an EInvalidGraphicOperation exception with message “Scan line index out of range” is thrown. The same exception is thrown, when the form is initially in the maximized state. After I drag the titlebar away from the upper border of the screen (the form is no longer maximized) and releasing the mouse button, the same exception is thrown (with the same message).

    The exception does not occur when I maximize the form by double clicking the titlebar or when using the “maximize”-button in the titlebar.

    I have attached the call stack created by EurekaLog. Using the debugger, I found that GetScanline (the method which raises the exception) is called with parameter Row = 1.

    I am pretty sure that the error originates from the TsTrackBar because when I de-activate the skinManager or when I replace the TsTrackBar by a TTrackBar the exception does not appear anymore.

    The problem is not that urgent as the exception is absorbed somewhere and does not seem to have any side-effects. So it is no problem for me if you first solve problems which are more important than this one :). I continue trying to create a simple demo-project which reproduces the error.

    #54099
    Support
    Keymaster

    Hello! Maybe you can give me Dfm-file for the form with this TrackBar? I'll try to repeat the error with this file.

    #54129
    Scurra
    Participant

    Unfortunately, I am not allowed to send you the dfm-file. I am still trying to reproduce the problem by a simple application but so far without success.

    I found out, that in the first line of procedure TsTrackBar.PaintThumb, the rectangle is set to (Left, Top, Right, Bottom) = (0, 0, 1, 1).

    Later, the local procedure ReturnToCache is called and from there the procedure Stretch. Here, the thrid and the fourth parameter are 1 (because of the width/height of the rectangle above). This causes the error in Stretch because in line 5975, ScanLine[1] is called. 1 is the height of the rectangle/bitmap and hence the exception will be raised from the Graphics unit.

    The question is now, why the rectangle has a width/height of only 1. So far, I could not find the reason.

    I will write you, if I have some more information for you.

    (I am using AlphaControls V10.18 and Delphi XE.)

    #54134
    Support
    Keymaster
    Quote:
    The question is now, why the rectangle has a width/height of only 1. So far, I could not find the reason.

    Which skin used?

    #54145
    Scurra
    Participant

    I could still not reproduce the error 🙁 but I simplified the skin as much as possible. The skin-file is attached to this post.

    The behavior using this skin is now even worse: When I resize the form by dragging the form's border, the same exception as reported above is raised. However, applying the procedure written in the first post of this topic for maximizing/de-maximizing the form, the exception occurs only when maximizing the form (not when de-maximizing the form).

    Some additional notes:

    – The exception does not occur anymore when I remove section “FORM”, “BAR” or “PANEL” from the skin.

    – The critical TsTrackbar is placed on some panels, i. e. the structure looks like

    Code:
    sPanel1
    sPanel2

    sPanel9
    sTrackBar1

    where some of the panels use skin-section “BAR” and some of them use skin-section “PANEL”.

    #54160
    Support
    Keymaster

    Thank you, I will check it.

    #54195
    Support
    Keymaster

    This skin have no images, it's mistake?

    #54198
    Scurra
    Participant

    No, its not a mistake. I just simplified the skin as much as possible such that the error still occurs.

    #54200
    Support
    Keymaster

    This TrackBar has horizontal or vertical position?

    #54235
    Scurra
    Participant

    Its position is horizontal.

    #54269
    Support
    Keymaster

    I can't reproduce it, unfortunately. Maybe you has a some demo-application already?

    #54275
    Scurra
    Participant

    Ok, no problem. I can't reproduce it neither. If I get additional information or a demo-application, I will contact you again.

    #54296
    Scurra
    Participant

    Ok, now I have good and bad news:

    I integrated AlphaControls 10.20 which fixed the bug with the TsTrackbar. Now, however, I have display-bugs with some panels.

    The properties in the dfm-file of one of these panels looks as follows:

    Code:
    object pnlTest: TsPanel
    Left = 758
    Top = 0
    Width = 26
    Height = 132
    Margins.Left = 0
    Margins.Top = 0
    Margins.Right = 0
    Margins.Bottom = 0
    Align = alRight
    BevelEdges = []
    BevelOuter = bvNone
    Padding.Left = 7
    Padding.Top = 2
    Padding.Bottom = 2
    TabOrder = 2
    SkinData.SkinSection = 'BAR'

    The skin 'BAR' in Options.dat looks as follows:

    [BAR]

    GRADIENTPERCENT=0

    OUTERMODE=1

    Am I doing something wrong? I tried to fix the problem by using TsPanel.Invalidate, .Repaint, .Refresh and .Update at the end of the FormResize-procedure.

    When I can reproduce the error, I will upload a demo-project.

    #54327
    Support
    Keymaster

    Wait and try the v10.21, some changes were added there.

    I hope, the problem is gone there.

    #54349
    Scurra
    Participant

    Thank you, the problem is solved now 🙂

Viewing 15 posts - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.