Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4273084
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T07:39:54+00:00 2026-05-21T07:39:54+00:00

My slider had a child button widget. I have recently changed my gui to

  • 0

My slider had a child button widget. I have recently changed my gui to send the mouse coordinates as relative to the widget, so if the widget is at 50,50 and the mouse is at 50,50, it will now report as 0,0.

This has created some problems for my slider. When I would drag around the button it would position to value.

The only solution I have thought of is to take the given mouse coordinate, add back the absolute position of the button, then subtract the absolute position of the slider.

I was however hoping for a solution that did not envole absolute positioning.

I used to receive the absolute mouse position, when I did, I positioned it like this:

int mousePos = getOrientation() == AGUI_HORIZONTAL ? 
    mouseArgs.getPosition().getX() - getAbsolutePosition().getX() :
mouseArgs.getPosition().getY() - getAbsolutePosition().getY();

setValue(positionToValue(mousePos));

mouseArgs gives the mouse position relative to the button. Not relative to the slider, which is what would be needed.

I can obtain the relative locations of the widgets, but I don’t think that would do it.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T07:39:55+00:00Added an answer on May 21, 2026 at 7:39 am

    Since this is a custom GUI, I’m going to make some assumptions and restate your question to make sure I’m answering your question.

    You have a slider widget that contains a thumb widget. The user can click and drag the thumb to reposition it. Your GUI sends mouse notifications to your widgets in local relative space rather than absolute screen space. Your question is how can the thumb widget respond to the mouse events to move itself around without having to use absolute coordinates?

    You can do this by changing who’s responsibility it is to move the thumb widget. It should be the job of the slider widget to position its thumb widget. By doing it that way, all your coordinates can be in the slider widget’s local relative space. Basically it’d be something like (assuming you have some kind of event notification):

    1. When created, the slider widget registers for the various mouse events on its child thumb widget.
    2. When the thumb receives mouse events, it raises the event passing along its local coordinate.
    3. Slider widget receives these events and translates the coordinate from thumb local space to slider local space (i.e., click_x = thumb_x + thumb_mouse_x).
    4. Slider can then use this coordinate, which is in the slider’s local relative space, to move the thumb.

    In general, parents should be responsible for their children’s layout.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i Had load my image Buffered image now need to brighten it using Slider
I used Easy Slider jQuery plugin before and never had problem until now. And
I have a Coda slider on one webpage (hand-crafted, not using the plugin, but
I have an slider animation but on clX.click event #close div hides before it
I have a slider on my page. What I want to do is, to
I'm working on adapting a jQuery slider that originally had 10 thumbnails. I only
I was wondering if anyone who has had experience using the Jquery Nivo Slider
I have created a basic unlock slider like you use to unlock the iPhone.
I have set up a JS slider using jquery at: http://jsfiddle.net/indigoclothing/H4MW9/21/ It works well
In a tableviewcell I have a UISlider. If I move the slider knob, go

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.