xulrunner tab close button - xul

I have an xul window with a tab box. The tab and tappanel elements are generated as needed in Javascript.
I want the tabs to have a close button. The docs for the 'tabs' tag talks about a 'closebutton' attribute buts says it is no longer supported.
I am trying to create content inside the tab. Right now it contains two label tags. The first is the actual tab label and the second is a red X (actually unicode \u2716). It displays fine but I cannot seem to get an event to fire when the X is clicked.
I have tried using the onclick attribute and closebutton.addEventListener('click').
I also tried using a toolbarbutton instead of a label. It displays the X but does not draw the button around it when the mouse hovers. Most importantly I cannot get the button event to fire.

Related

How can I click a button that's only clickable from the bottom half?

So I'm trying to hit this button to activate the dropdown menu, but it seems that only half of it works, Im afraid the automation is clicking the top bottom or somewhere where is not active, let me illustrate with a few screenshots, which will contain a comparisson. ALSO can I click on one of the options from the dropdown without "activating it"? (clicking the DropDown Button)
Now another example from the button fully working
I have found that the button fully works if it's the first one to be clicked, if I click something else, then this issue happens, and that's only button with this issue

OSX: Move keyboard focus between textfields and buttons using tab key

I am trying to toggle between textfields and buttons on my view using keyboard's tab button. The switching between textfields work but it does not switch between buttons. The view is shown as below.I did not find enough resources online to proceed further. Does anyone know how to resolve this?
There is nothing you can do with that issue.
It turns out that in the System Preferences > Keyboard > Shortcuts there is a checkbox, where you can change behaviour of the whole system:
To move keyboard focus only between text boxes and lists
To move keyboard between any of controls
And by default first checkbox is pressed.
As an addition. By default, NSWindow assigns an initial first responder and constructs a key view loop with the objects it finds. You can also change key view loop by calling this method: setNextKeyView.
For example,
[firstTextBox setNextKeyView:secondTextBox];
[secondTextBox setNextKeyView:secondButton];
[secondButton setNextKeyView:firstButton];
[firstButton setNextKeyView:firstTextBox];
This means that for users who expect moving control focus through all controls, this will work. And for those who have disabled this feature in settings, this won't work.
You can right-click on text field, drag "nextKeyView" and drop on another text field that you want to focus next when user press tab. Look like my picture below:
To add to #mjonka's answer, To move focus between controls is dependent on user's keyboard-shortcuts settings. What could be alternate solution is to just selecting your desired action button in your xib file and setting "Key Equivalent" value field to "enter" key in Attributes inspector as shown below. Same thing can be done for cancel button by setting "Key Equivalent" value to "Esc" key.

Selenium IDE - selecting an button outside the frame

I am relatively new to Selenium. We are using the Selenium IDE to do some regression testing. I have a menu bar that has different buttons on it that will drop down a menu when you hover over any of the buttons (there are 4 buttons on the menu bar). So when i select one of the menu items from the dropdown, it opens a page inside the same window. This page looking at the debug info in Selenium seems to be a frame. This frame open right under the menu bar and the menu bar is still visible. Once the page has loaded completely, I want to go outside the frame and click on a button on the menu bar and click on the next item to verify. This doesnt seem to work, once the page (frame) has loaded then nothing happens. I have tried using window focus, select frame, mouse over commands but nothing seem to work. i have also used the relative = parent and relative = top commands with the select frame command but cant get it to work.
Any tips or suggestions are welcome. If I am not clear on the description I can provide more details. Thanks for the assist.
If the control is outside of the frame Selenium is pointing to, then you need to switch back to default content, and possibly switch to the frame the control is in.
Driver.SwitchTo().DefaultContent();
Driver.SwitchTo().Frame(frameID);
you should firstly switch to appropriate frame where your button is located in:
1. Switch to frame
Command: selectFrame
Target: your_frame_id
2. Click button
Command: click
Target: your_button_id (or you can use XPath or CSS selector instead)

Adding an image to 1 of the tabs on a TabControl, blocks my tab's text

Using Visual Studio 2005 (vb.net) (windows forms) on Windows XP, I have a standard Microsoft TabControl.
A button click adds/removes an image from 1 of the Tabs.
Seems like the image is placed OVER my tab's text, making it unreadable.
Why isn't it like it should be: Image on the left. Followed by text on the right.
Why is the image being placed OVER my tab's text? Do I need to do some kind of "refresh" or "redraw" before it will appear as it should?
I don't see any way to "make the image appear on the left edge of the tab". (NOT the tab-page.) ... and then place the text just to the right of the image. (Just like a normal image+text tab can do.)
The code is pretty simple, it just gets an image from my ImageList:
cfgTab.ImageKey = "PadLockClosed.png" ' Show CLOSED PadLock
The tab's text changes from:
This is my tab text
to:
T(IMAGE HERE)is my tab text
The image appears OVER the beginning of my text. But if I move to another tab, then move back, the image appears in the correct position:
(IMAGE HERE) This is my tab text
You can use docking and anchoring on your Control property so it will be placed according on what you want it to display.
Manage WinForm controls using the Anchor and Dock properties
Resizing a Single Control In WinForms
Regards

How to get the Spotlight-like text input effect in menu bar?

I want to have an icon in the menubar in my Mac app - and the icon should spawn a menu upon clicking. While having more entries in the menu, I would like to have a top row as a universal text entry field - like it is in Spotlight:
http://dl.dropbox.com/u/3943878/_mine/Screen%20shot%202011-07-16%20at%2012.29.18.png
Is it possible to add such a field to NSMenu? Or should I do it as a panel-type window?
If you're using xcode 4 , make a custom view in interface builder and add a textfield or anything you want to it. In IB also drag and drop a "Menu" from the objects library with as many items as you want in it. Then simply ctrl+click the menu item you want to make into the text field (In your case it would be the top one) and drag to the custom view and select "view". Now when you open the menu, instead of showing a menu item in that space, it shows whatever was in your custom view.
EDIT: As for your comment here's what you should do. Make your menu an outlet by opening the assistant editor view and ctrl+click from your menu to the header file that you want to use. now, simply make a method that will run whenever the menu will open, conveniently apple already made this, it's called menuWillOpen.
- (void)menuWillOpen: nameOfYourMenu{
[self performSelector:#selector(methodExecutedWhenMenuIsClicked) withObject:nil afterDelay:0.0 inModes:[NSArray arrayWithObject:NSRunLoopCommonModes]];
the delay at 0 will make it happen immediately, it must be done in the common modes run loop so that the menu will be updated even while it's open. Now just make the methodExecutedWhenMenuIsClicked and set it so the text field responds.
- (void)methodExecutedWhenMenuIsClicked{
[[yourTextfiled window] makeFirstResponder:yourTextField];
You can put any view in a menu using -[NSMenuItem setView:]. See the long comment in NSMenuItem.h and the section Views in Menus in Application Menu and Pop-up List Programming Topics.
You're probably going to struggle quite a bit. I just tried doing the same thing, and reading the Views in Menus in Application Menu and Pop-up List Programming Topics document referenced by Ahruman, I found this:
A view in a menu item can receive all mouse events as normal, but keyboard events are not supported. During “non-sticky” menu tracking (that is, manipulating menus with the mouse button held down), a view in a menu item receives mouseDragged: events.
I think we're SOL. Apparently Spotlight pops up a borderless window instead.