How to change background color regarding position of the cursor - background

I have the following problem: How to write javascript code, when I move the cursor on the first third of the display, to change the background color. When it's the second or third part of the display, to change the background color.
I need three different colors regarding the position of the cursor.

Related

Creating a Horizontal ScrollView with Section Titles

I want to create a horizontal scrollable "timeline" that has sticky section names (dates):
The horizontal lines are dividers for different dates. The date stays on until this divider (circled red in the last picture) "pushes" it away from the screen.
In other words, the date stays on the screen until another date pushes it away.
Is there a way to achieve something like this?

Oracle Apex - change color of cards

The image:
shows a snippet of a dashboard from oracle apex. In the image you can see a 6 boxes and grey cards (the circles in each box at the top right corner) which contain a number inside of them. There is a way to conditionally change the color of the grey circle through sql as the circle is defined as a card. That means I can operate with the help of this link https://apex.oracle.com/pls/apex/apex_pm/r/ut/color-and-status-modifiers.
My question is, if there is way to conditionally change the color of each box instead of the round card. I want to do that because there is no correlation between the color of the card and the number inside of it.
An alternative would be to change the color of the text (which I had to censor) either next to the circle or in the subbox.

Psychtoolbox scale slider

I'm trying to make a slider for a simple scale where the user can see mouse movement ONLY in the horizontal axis (fixed y location on the horizontal scale).
In more detail: When the scale appears, I want the cursor to appear as a short vertical line (aka slider) in the center of the horizontal scale.
When the user moves the mouse, the slider should move accordingly on the horizontal axis (without reflecting any changes in the vertical axis, i.e. it should stay on the scale)
I'm stuck on both changing the appearance of the cursor to a vertical line slider and on limiting the cursor's movement to the horizontal axis.
Here's what I've tried:
I can successfully place the cursor with SetMouse.
I tried ShowCursor to change the appearance of the cursor, but this only has a few named options and the numbered ones are not portable across OSs ("mapping of numbers to shapes is operating system dependent"), which I need. Any other ideas on how to change the cursor to a vertical line slider?
As for limiting the movement to horizontal, I couldn't find any PTB functions that seem to do this. I did find some workarounds in Matlab to make user GUIs, but it seems these can't be used with PTB's screen. Any ideas would be great!
I'm a still very new to PTB so thank you so much for your help!
I wrote a function for exactly that called slideScale. If you want to see how it works see the test script.
The crucial thing for you is to create a loop, which runs until a click has been made and record the position of the cursor for instance with the function GetMouse(), which gives you the x- and y-coordinates of the cursor. Then, the only thing you basically need is to update the position of your vertical line using the x-coordinate you recorded with GetMouse() without changing the y-coordinates, for which you can just use a fixed value.

UIButtons Alignment

I am trying to implement like word cloud in my app.
The image shown is like word cloud with left alignment.
What I did was, for placing the buttons I am checking whether the width of the text is greater than total width of the screen, if it is greater place the button in next row i.e increment the y position, if it is not just place the buttons. Everything is working fine. But what I want now is , i want to move the buttons alignment, like, I want to start the first button from center of the screen. Please help me to do this...

Set the UITableView Section border color

How does one set the UITableView Section border color? I have tried and cant seem to change it. its default is white, I want to set it to a gray color.
The white color is because the separator style is set to Single Line Edged. If you change it to Single Line the white lines will disappear. Not sure if that solves your problem but I don't think you change the color without doing a lot more work.
I believe what Apple uses for its contact heading is tableView:viewForHeaderInSection: for section 0, instead of a cell in the first section. You can still specify a transparent background and the pinstripe will show behind it. The border will not be there as grouped table view section headers do not have borders.
Whether you built your custom cell in Interface Builder or using code, it should be a fairly trivial task to migrate those views from a UITableViewCell to a UIView for use with tableView:viewForHeaderInSection:.
I don't know if you'll be able to keep the Details title for, say, section 1, unless you make a label containing that word and add it to the section 0 header view manually.
Finally if all the above advise didnt help then check this link out.