Change cursor to pointer on hover right side of td - html-table

I have a table with td's. I would like it so that the user sees the cursor change into a pointer when he/she reaches the right border of the specific td, and revert back to the normal pointer when the user is not hovering the right border.
Googled a lot but I cannot seem to find an answer. There's hope someone here can help me...?
I would like it to be pure CSS, but maybe there is need for some query too?

you can use CSS to modify the behavior of the type of cursor in your case you can use
your_td_tag:hover {
cursor:progress
}
If you specifically want to select border only you have to use some javascript hacky stuff
$('div').click(function(e){
if( e.offsetX <= parseInt($(this).css('borderLeftWidth'))){
$("div").css("cursor:progress");
}
});
here div can be replaced by any tag and cursor-progress can be replaced by your desired cursor.
there are various types of cursors available by default
auto
crosshair
default
e-resize
grab
help
move
n-resize
ne-resize
nw-resize
pointer
progress
s-resize
se-resize
sw-resize
text
w-resize
wait
not-allowed
no-drop
you can also use your custom cursor as follows
your_td_tag_selector:hover{
cursor: url('some-cursor.ico'), default;
}
the default here is used as a fallback mechanism so if some-cursor.ico is not supported or not available it will fall back to default cursor.
let me know if it solves your problem..

Related

How do you handle game battle combos? - Scratch 3.0

I'm new to programming, and I was wondering how you are able to handle consecutive, timed key presses in order for the character to do something different. For example, in games like 'Super Smash Bros.' you press one button for a character to punch, and if you press it again, they will do their second punch; pressing it once more will result in a kick. How am I able to program this in Scratch 3.0 (preferrably, but an explanation in another programming language might help)?
By the way, if this helps, I am using a 'state' variable in order to handle other animations such as running; I want the character to be able to animate when the timed key presses occur.
Makey makey (in the extensions) does something similar to that, but if you wanted to make your own from scratch (no pun intended) you could do something like this example that I made: https://scratch.mit.edu/projects/382244376/
As stated earlier, makey makey is the only option...
I know, they only have a few selected options
BUT!
try this:
You usually use
when (up right down left v) pressed:
// Do something
Why don't you use
when (join(up up right right left left up down)()) pressed:
// Do Something
Yes, its the join()() block. Fill up the first blank with the combos you want, separated by a space, and leave the 2nd one empty. Drag it into the selectable part of the Makey Makey hat block, and there you go!

If statement on global variable doesn't execute function gotoAndStop();

I'm making a simple concept game, in which I've made buttons which are targets, when the user clicks said targets, it executes this code:
on (release){
_global.targetCount++;
Target1._visible=false;
if(_global.targetCount==3){
gotoAndStop(4);
}
}
the global variable was declared on the frame like this:
_global.targetCount = 0;
and the buttons do disappear when I click on them like they should, but as soon as I click the final 3rd one and it disappears, it doesn't successfully check that the if(_global.targetCount==3) and proceed to the 4th frame.
I've tried declaring the variable differently like so:
var targetCount:Number = 0;
also tried doing it like this but on using the check code button it said my syntax was wrong:
var _global.targetCount:Number = 0;
and calling every instance as just targetCount, but that didn't fix it either,
I've searched and tinkered with the code, but I can't find clear examples on global variables, the little I've used here I found by reading this:
https://www.kirupa.com/developer/actionscript/tricks/global.htm
So I was wondering if anyone here could help me by letting me know the many mistakes I've done, and how to improve them.
All help is gladly appreciated!
Every keyframe on stage is new closure. If you have variable on frame 2 and you want change/set or read value of this variable on frame 3, that variable does not exist and it is undefined. If you will try increment that undefined value you get NaN and gotoAndStop(NaN) doing nothing.
Insert trace(_global.targetCount); between _global.targetCount++; and Target1._visible=false; for debug.

How do I attach a QRegexpValidator to QFileDialog if I only want say identifier file names?

The question is pretty straightforward and in the title.
Googling didn't help on this one. How do I get the QFileDialog to use a QValidator on its save name field?
Thanks.
The following is a bit of a kludge but appears to work.
You can use QObject::findChildren to locate the dialog's QLineEdit child widgets. Assuming there's only one such widget you can then apply the validator to that...
QFileDialog fd;
auto children = fd.findChildren<QLineEdit *>();
if (children.size() == 1) {
/*
* Apply a validator that forces the user to enter a name
* beginning with a lower case `a' -- a bit pointless but...
*/
QRegExpValidator validator(QRegExp("^a"));
/*
* Apply the validator.
*/
children.front()->setValidator(&validator);
fd.exec();
}
A quick test suggests it appears to work just fine. Like I said though: it does feel like a bit of a kludge.

Tree view with floating window

When I move my mouse to a row in tree view and stay here for a second, I want to see a floating window. (Like in developer mode.)
How Can I solve it? Any idea?
When you declare your field or fields that get rendered on a listview make sure you give to the __init__ method the help='My Floating Test' argument. That will cause a floating window to be shown when you hover on that field.
For example check:
addons/account/models/account.py
tag_ids = fields.Many2many('account.account.tag', 'account_account_account_tag', string='Tags', help="Optional tags you may want to assign for custom reporting")
The string on the help attribu will be shown on all the views that render this field upon hovering on it and pausing for 1 second.
If you want to modify the window that is shown, you can extend the
t-name="WidgetLabel.tooltip" template that is located in addons/web/static/src/xml/base_common.xml

How to cast a Revit Element as a Revit.DB.Opening

I am relatively new at programming in Revit. I am currently getting a list of elements in my drawing that are of type door or window. What I want to do is cast these as an opening however I get an error when I try to cast them as a Autodesk.Revit.DB.Opening.
Code Below:
// filter for current design option
var designOptionFilter = S2E.Revit.Tools.Library.Cache.DesignOptionFilter;
List<Element> elements = collector.WherePasses(designOptionFilter).ToElements().ToList();
var list = new List<Autodesk.Revit.DB.Opening>();
foreach (var element in elements) {
var opening = (Opening)element;
if (opening.Host.Id == wallId) {
list.Add(opening);
}
}
return list;
As you can see I am testing if the id of the host matches the wall I am woking on. At least that is what I would like to do. All I am looking for is how to cast an element as an Opening.
Thanks, Rich
Considering a Door is a FamilyInstance and an Opening is not, I am unsure of how you would cast the door FamilyInstance to an opening type.
But, since the FamilyInstance has a Host parameter, just check that against the wall ID and it should work, no casting needed.
It depends on what your filter is selecting on whether the cast you have will work. As you don't provide details on the exact error you are getting it is hard to be more precise.
Also you have in one place (Opening) used as your cast yet you use the full type name "Autodesk.Revit.DB.Opening" when you create your list. If you really need to do that maybe Opening is not the "Opening" you thought it was.
You can also use element.Cast() to perform the cast.
Likewise if you know that all your elements returned by the filter are only ever going to be Opening types then you can use
collector.WherePasses(designOptionFilter).Cast<Opening>()
to achieve the same thing.