playground/application command shortcut different behavior - qooxdoo

sorry my english. Hi
check this little example
Playground example
Go to table, start edition of some cell, then press Escape, and press Escape again:
the edition cancel, and the command's execute listener work fine.
All is Ok.
Now copy this example to blank new Qooxdoo 5.0.2 application, run and edit a cell.
The behavior change: the command completely nullifies the table's keypress listener when I press Escape key.
What is good, what is bad?
If I change the line
if (! table.isEditing()) this.debug("escape");
to
if (! table.isEditing()) {
this.debug("escape")
} else {
table.cancelEditing();
table.focus();
}
the behavior is reasonable.
But I want the Playground behavior. And I want understand, because when I subclass table widget and interact with several commands I get similar problems.
I'm doing something wrong? How can solutionate this differente behavior?
Im using Firefox 49 and Windows 8.1.
Thanks

Related

Protractor click element only when present

Alright, so I thought this would be easy but I've spend a few hours searching and trying different methods with no avail. I need to tell protractor to only click on a button when it is present. To water it down basically my test checks if a certain value is present on a page. The page can be in one of two states, automatic mode, which contains my value I'm testing or design mode, which contains other values which are irrelevant for this test. If its in design mode, we first need to click on automatic mode which produces a prompt asking us if we are sure we want to continue and switch to automatic mode - this prompt contains the continue button I need to check for and click. If the page is already in automatic mode however, I don't need to perform this check, I can proceed to validate weather or not my value is present. Basically I tried this:
if (continueButton.isDisplayed()) {
continueButton.click();
}
what happens I get a "No element found using locator:..." error. I tried a few different ways such as using isElementPresent, and some of the expected condition options but more or less I get the same results. How can I achieve this scenario where my test checks if a button is present and clicks it, and if it isn't present continues with the test.
You can achieve this by using promises.
continueButton.isDisplayed().then(function (isDisplayed) {
if(isDisplayed){
continueButton.click();
}
});
browser.wait() and elementToBeClickable Expected Condition is exactly what might help:
var EC = protractor.ExpectedConditions;
browser.wait(EC.elementToBeClickable(continueButton), 5000);
continueButton.click();

What's a way to implement backspace working in field in ncurses

I am try to create tui via ncurses. And I have same problem.
There are two fields:
Name
_______
Password
_______
How to implement backspace-support in each field ?
And how to use '*' to show each character in password-field ? (Now I use field_opts_off(field[1], O_PUBLIC);and it doesn't show characters in password-field, only move cursor).
Thank you.
There is no tutorial for the forms package that I recall. However, the ncurses test-programs (which are available separately as ncurses-examples) contains a program demo_forms which does implement deletion by maintaining the edited field contents as a hidden field buffer, and decrementing its length in the case for REQ_DEL_CHAR.
Here is a screenshot of the program:
Regarding the "non-ncurses" suggestion: dialog is a curses/ncurses application, and has no particular dependency upon bash.
"Non-ncurses" solution (just for an alternative):
You can use dialog program to perform this task in a very easy way. Just run some linux system commands from C to achieve a nice TUI.
If you want to install it, the package name is dialog too.
For a textfield, you can do: dialog --inputbox <text> <height> <width> [<init>]
For a password field: dialog --passwordbox <text> <height> <width> [<init>]
For more info: http://bash.cyberciti.biz/guide/Bash_display_dialog_boxes

KDevelop: transform selected text?

I was wondering whether there was a function in KDevelop similar to the one that we used to have in Quanta (miss you, Quanta, btw).
I would like to set a keyboard shortcut, and apply a text transformation upon hitting it. Example:
I select my text to be translated, and I get back: <?=_('my text to be translated'?>
As you can see, this saves me a lot of awkward keystrokes...
I only found this feature in PHPStorm (where it is called "Live Templates"). I defined it like this: <?=t('$SELECTION$')?> and I can call it by hitting CTRL+ALT+J, and select it from the dropdown that appears.
You should be able to do that using a snippet with the following text: <?=_('%{selection}'?>
And you can bind a Shortcut to a snippet.
However my tests showed that this doesn't work correctly - there seems to be a bug somewhere.
As alternative you can write a script that does insert the text. See the documentation.

Installshield 2011: Take path from one window, take text from second

Good day, everyone. I have that task assigned which consists in creating simple installscript-only project, that should have 2 windows: first will prompt user to enter a path and create text file in this specified location, while second will promt for text input and save anything user writes into this text file.
Funny point is that I have small installshield experience (completed tutorials... well, yeah, that's all) and very little programming experience on top of that. As far as i understand, I should first create two custom dialog windows (for example by cloning them from standard ones), then create .rul files with functions, determining behavior for each. After which, include them into main setup.rul and call functions at specific point of time.
Question is - what exact dialog windows/functions/points of time will be best for such task? For reference i searched into "Serial Number Validation Sample Project" but, honestly, the way it customized default window is just confused me even more... So, please, can anybody help? Thank you.
For future reference, here's working solution.
Asked that same question at flexera forums, and here's what I got:
Off the top of my head (without InstallShield handy to check this) 1)
Create an InstallScript project, just accept all of the defaults in
the new project wizard unless you want to add localization or
something. 2) Your description implies that you do not need
maintenance (repair, modify, uninstall) support. If correct go to
Project\Settings and on the Maintenance tab select 'no uninstall or
maintenance'. 3) You can put your code at the top of the
OnFirstUIBefore function and then call Exit so that the rest of that
default code is never executed, since you are not installing anything.
As part of your InstallShield IDE, in the Start menu (for IS2012
Spring) is a tool that demonstrates all of the built in dialogs. You
can look through those choices and select the dialog that is best for
your situation. It sounds like you want to:
Call AskPath or SdAskDestPath (there are several other possibilities)
Then call AskText and save that string.
If you need to make layout or text changes to the default dialogs look
at your Dialogs view and select which ever dialog you selected above
and edit it. (If you decide to use skins make sure you select the skin
before you make any dialog layout changes.)
Then do something similar to the functional body of the WriteLine
example http://kb.flexerasoftware.com/doc/Helpnet/installshield14langref/LangrefWriteLine_Example.htm
The actual WriteLine example function prototype is for a MSI custom
action which is not what you want. Ignore the function protoype and
just use the code in your project to create the file at the path you
already collected and write the line of text that you collected.
Then call Exit;
(big thanks to user phill_mn for that answer)
And here's the code for setup.rul:
#include "ifx.h"
function OnFirstUIBefore()
number nvFileHandle;
string svResult;
string szTargetPath, szFeatures;
BOOL bLicenseAccepted;
begin
AskPath ("Please choose a path where text file will be saved","c:\\",szTargetPath);
MessageBox("File yourtext.txt wiil be created or overwritten at " +szTargetPath, INFORMATION);
AskText ("Please enter some text to save into that file", "Text goes here", svResult);
OpenFileMode (FILE_MODE_APPEND);
if (CreateFile (nvFileHandle, szTargetPath, "yourtext.txt") < 0) then
MessageBox ("Creating failed.", SEVERE);
abort;
else
if (WriteLine(nvFileHandle, svResult) < 0) then
MessageBox ("Writing failed.", SEVERE);
else
MessageBox ("Success.", INFORMATION);
endif;
endif;
CloseFile (nvFileHandle);
Do(EXIT);
return 0;
end;

Issue with configuring conTEXT to compile for Unrealscript

I have been going through Rachel Cordone's Unreal Development Kit Game Programming with UnrealScript Beginner's Guide book and having an issue using the conTEXT text editor.
As per instructed through the book I have followed all the steps to configure it but it won't compile once I press F9 - considering the last step to configure is to set the Enivronment Options/Execute Keys section. Here are the steps the book lays out (just that certain tab):
7) Now we are going to set up the conText to compile code. On the Execute Keys tab, click on Add, then type .uc into the Extensions field that comes up.
8) Once that's done four keys, F9 through F12, will show up in the User Exec Keys window. Let's click on F9 to make it convenient. Once clicked the option on the right become available.
9) For the Execute line, click on the button to the right of the field and navigate to out UDK installation's Binaries\Win64 folder, and select UDK.exe. For Start In, copy the Execute line but leave out UDK.exe.
10) In the Parameters field, type "make" without the quote marks. This tells UDK.exe that we want to compile code instead of opening the game.
11) Change Save to All Files Before Execution.
12) Check Capture Console Output and Scroll Console to the Last Line...
Then all I have to do is press F9 and it will compile - but it doesn't! It gives me:
No user command associated with extension '.uc'
Use 'Environment Options/Execute Keys' dialog to assign commands.
It seems it is not registering the changes no matter what I do (yes I clicked apply before saying okay but even still nothing). Any ideas?
The instructions may be out of date. You'll need to select your ".uc" entry, hit "Edit", and change it to just "uc".
Also, if you use UDK.com instead of UDK.exe the console output will go directly into Context instead of going to a separate popup.

Resources