Remove X button in input - Metro - windows-8

I write a Metro program in Javascript. The problem is Windows8 automatically adds an X button to it. Now how to edit or remove that button? Below is my layout, the X button overlaps the email input.

Details are here:
http://msdn.microsoft.com/en-us/library/windows/apps/hh465498.aspx
You need to use the -ms-clear pseudo element, and style it either as you need it, or display none it:
input::-ms-clear {
display: none;
}
Note that you likely want to not display none it, since this removes the easy-to-touch X that removes the current input.

Related

How to use a button to change style of a TextInput

Need to make a button change the color of the font from a TextInput textbox to atleast 4 different colors.
so, i'm quite new in react-native and im having a problem to solve one of my assignments, my teacher asked us to create a button that changes the color of the font inside a Text Input text box to one of 4 different colors presets onPress , couldn't figure it out on my own and cant seem to find any tutorial with this kinda of examples, just found some tutorials that only explain how to change the color from the buttons onPress.
Since you mentioned this is your assignment from your teacher, I would not provide any code, but just a general guideline on how to create the code yourself so that you could try and make it yourself.
What you need to do are :
Create the 4 styles for the text color as const that you can refer to later.
You would also want to have a state to indicate which color you want to show and change it according to the button pressed.
And you would need to pick the correct style from the const made from step 1 above based on the state like shown on this link.
Hope you good luck ini finishing your assignment.

Can I use waitForElementWidth Selenium command independently

I just started playing with Selenium and I ran into an issue. I have a link that toggles a hidden div into view using a scroll transition. I am trying to test this function using selenium and the following steps:
1.click on toggle button
2.wait for open transition to finish
3.click on toggle button again to close
My question is can i use waitForElementWidth command for step number 2 without first storing my width with storeElementWidth? lets say I already know the final width of the div when viewable is 200px. Can i do something like:
command: waitForElementWidth
target: id=mydiv
value: 200
It seems to fail for some reason.
EDIT: I am aware that I can use the Pause command with the amount of time that the transition is set for but I am trying to stay away from set times which might change later.
I actually found the answer to this is yes you can use it independently. What i was doing wrong is that I was entering the value as a string in quotations when i just needed to enter it as simple value.

Dialog display in Dojo

How to unblock the screen when a dialog being displayed?
Usually when a dialog appears underlay(screen) is blocked and gets grey coloured. But i need to provide access to underlay even a dialog appears. How to do it?
I think the easiest way to do that is to hide the underlay using css. Dojo will always give the underlay the same id as the dialog followed by _underlay. So if your dialog has the id myDialog then just add the following css somewhere:
#myDialog_underlay {
display: none;
}
More info can be found at http://docs.dojocampus.org/dijit/Dialog

How to receive mouse and keyboard events and override default behaviour for Eclipse ITextEditor?

I'd like to create an Eclipse plugin that emulates the behaviour of the vi text editor. This would require changing the way mouse and keyboard events are handled. So, for example if the user presses "h" while in Normal Mode, the cursor should move left, rather than inserting the "h" character into the text buffer. I've found an old mailing list post that describes how to listen to changes in the document, and changes in the presentation, but nothing that describes how to intercept low-level keyboard and mouse events, such that the default behaviour can be overridden. What would be the best way to accomplish this?
One idea would be for a particular active text editor you would want to grab the low-level StyledText widget that is rendering the actual text and also accepting keyboard input and add a KeyListener there.
AbstractTextEditor textEditor = ...
ITextViewer viewer = textEditor.getSourceViewer();
StyledText textWidget = viewer.getTextWidget();
textWidget.addKeyListener(...);

How can I find text location with Selenium?

I'm trying to find the location of some text on a web page using Selenium.
I can use the isTextPresent function to tell me if the text occurs, but then I want to know where it actually is.
The wider problem is that I want to click on this text.
The problem is that I don't seem to be able to click on this text, which I think is in some control embedded on the page. So, it doesn't seem to be detected as a link or button or option etc. However, I need to click on it to make a selection.
Any thoughts?
Your solution xpath=//*[text()='hello'] will click the first clickable element with the text "hello" in the source code. If you want to be more specific, you can add more cases to the xpath like this
xpath=//*[#id='exampleId']//*[text()='hello']
Now this will click element with text 'hello' that's found after some element with id 'exampleId'.
Xpath is great usage and you should answers above. However, I realised, that sometimes Selenium does not allow you to click something, because it thinks the text is hidden by CSS
So far I do not have any workaround for it and instead of clicking a button I am closing completly whole browser window.
But in my case its div hidden by CSS showing actual version number of such application. So I only take a screenshot of it:
File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
File destination = new File("path/to/outputfiles/versionNumber.png");
FileUtils.copyFile(scrFile, destination);
Got it !
I don't know the answer to how to find the location,
but, the more important bit is to click on that text.
I can just use an XPath locator in the click method, like :-
Click(xpath=//*[text()="hello"])
This will click on the element that has a text value of "hello".
In my case, this is unique, so that's specific enough.
${x_axis}= Get Horizontal Position xpath=//*[text()="Log files"]
Get Horizontal Position returns the position of 'Log files' wrt the left end(X-axis length).
the position is an integer value... so can be compared easily as well.