TsSlider Orientation

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #36785
    Gino D
    Participant

    Hi,

    I have 2 TsSliders, one which has an orientation that's horizontal and one vertical. I have added the required skinsections to the skin to change the thumbs and sliders (SLIDER_ON, SLIDER_OFF, THUMB_ON, THUMB_OFF).

    I would like to apply 2 different bitmaps to set the 'control borders' for each orientation (coVertical, coHorizontal), is this possible?

    #54516
    Support
    Keymaster

    Hello! Sorry for a delay.

    You can add your new section with custom name and specify this section in the sSlider1.SkinData.SkinSection property.

    You tried this way?

    #54565
    Gino D
    Participant
    'Support' wrote:

    Hello! Sorry for a delay.

    You can add your new section with custom name and specify this section in the sSlider1.SkinData.SkinSection property.

    You tried this way?

    Thank you for your reply!

    I am aware of this, but the TsSlider seems to be an exception where you don't have one skinsection, but multiple fixed-name skinsections for each part of the slider (the thumb's states and the slider's states: SLIDER_ON, SLIDER_OFF, THUMB_ON, THUMB_OFF). What I need would be something like sSlider1.ThumbOn.SkinData.SkinSection, sSlider1.sliderOn.SkinData.SkinSection, sSlider1.ThumbOff.SkinData.SkinSection and sSlider1.sliderOff.SkinData.SkinSection, which currently doesn't appear to be possible at design time…

    #54566
    Gino D
    Participant

    To further illustrate:

    – I used the background bitmap to create a vertical line

    [attachment=7524:HowItIsVertical.png]

    – Because horizontal sliders use the same bitmap, the line stays vertical, resulting in this:

    [attachment=7525:HowItIsHorizontal.png]

    – If i could set a second bitmap for horizontal sliders, i would be able to use a horizontal line as well:

    [attachment=7526:HowItShouldBe.png]

    #54587
    Support
    Keymaster

    Maybe I not quite understand the issue.

    Why you can't specify required SkinSections when needed, like this:

    Code:
    procedure TForm1.sSlider2SliderChange(Sender: TObject);
    begin
    if sSlider2.SliderOn then begin
    sSlider2.ThumbSection := 'THUMB_VERT_ON';
    sSlider2.SkinData.SkinSection := 'SLIDER_VERT_ON';
    end
    else begin
    sSlider2.ThumbSection := 'THUMB_VERT_OFF';
    sSlider2.SkinData.SkinSection := 'SLIDER_VERT_OFF';
    end;
    end;

    You can use any skin section here…

    Your suggestion for adding new properties is not bad, but such property as ThumbSection should be removed in this case?

    And, SkinData is a common property for all control, which contains many special information for the control skinning, can't be removed.

    #55006
    Gino D
    Participant

    Thank you! This was the solution for me, I was not aware that the property 'ThumbSection' had been introduced (was working with an older version).

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