How get key signal and not deleting it in wxTextCtrl - wxwidgets

In initialize functions on my widgets i have:
Connect(wxEVT_TEXT_ENTER, wxCommandEventHandler(MyTextCtrl::EnterClick));
next I have
void MyTextCtrl::EnterClick(wxCommandEvent &event)
{ wxPrintf(wxT("enter\n"));}
trouble is with signal. the string is putting to console but on editor not working enter. How using specyfic key and no deleting it signal?
I would using key (making some procedure) but i would normal using it deeper

You use
event.Skip();
on the end of functions, nothing more

Related

Creating a Private Key from a String

Use case
We have an app, where a user puts in a private key into a text box and then we save that. We then want to use that string value to create a private key to be able to sign stuff with it.
Ruby example
In Ruby this is done with something like this:
OpenSSL::Key::RSA.new(string_key_value_here)
I know that you can use Erlang's crypto module in Elixir and I thought that the function generate_key/2 could be used here. On further review I don't think that it'll work as the second parameters that it wants for that function are:
{ModulusSizeInBits::integer(), PublicExponent::key_value()}
Is it possible to do something like this with Elixir / Erlang?

PostExecute not firing in SSIS script component

I have a Source Script Component in SQL2012.
I believe if you want to set a Read/write variable in the Scriptcomponent it must be set in the Postexecute method . And I have done so like this;
public override void PostExecute()
{
base.PostExecute();
Variables.value1 = "some value";
}
I tested the variable after the script component ran and found it hadn't been set. I set a break point in the PostExecute method and confirmed it never gets called.
I even wrote a very simple new package and tested it again with the same results. Can anyone tell me why the PostExecute will not fire.
I'm not aware of any restrictions on seting a variable here (regardless of if there are records to process or not).
The variable can be set in the script component, but you can only use it after the Data Flow task is finished (in the next task).
After some testig it appears that when you use a script component as a "Source" the PostExecture event never fires. Works fine a "Transformation". Didn't test out "Destination" type. Nothing in the Microsoft documentation mentions this fact so it's missleading.
I ended up using the rowcount control to count records. Not sure what I would have done if i had needed to to more on the PostExecture event.
I have used a Script Component as a source many times and PostExecute does fire.

IntelliJ auto create new method that NOT exist and auto type conversion?

These two quickfix features are quite simple, but in Intellj I can not find them.
For example:
class A {
}
A a = new A();
a.newMethod();//Eclipse can create "newMethod" function in Class A, if we put mouse at here.
Does there is any shortcut key ?
If you have any problems always try to put your cursor on it and hit 'alt'+'enter' first. It's standard IDEA problem solver.

Intercept Command+key with IMKit (or similar)

I was looking to intercept Command key combinations and thought that IMKit would be a good choice. By extending IMKInputController I can intercept most keys but it seems to ignore modified ones.
I've tried overriding
-(BOOL)inputText:(NSString*)string client:(id)sender;
and (alternatively)
-(BOOL)inputText:(NSString*)string
key:(NSInteger)keyCode
modifiers:(NSUInteger)flags
client:(id)sender;
but no luck; the methods just plain aren't called when the modifiers are applied. To be more specific the command and alt key don't get caught by the methods above. Simple modifiers like shift and ctrl work (and the modifier flags variable is set in the second method). Fire up Apple's sample application NumberInput to see for yourself.
Any suggestions? Am I on totally the wrong track?
Short answer:
Use handleEvent:client: and listen to the NSFlagsChanged event.
IMKInputController implements the IMKServerInput Protocol, which provides three alternatives to handle an event.
Key binding - using inputText:client: and didCommandBySelector:client:
Text data only - using inputText:key:modifiers:client:
Handle all events - using handleEvent:client:
Seems like you've only tried the top two. You can achieve the goal with the third option.
Try the following:
override recognizedEvents: (from IMKStateSetting Protocol)
- (NSUInteger)recognizedEvents:(id)sender
{
return NSKeyDownMask | NSFlagsChangedMask;
}
and use handleEvent:client:
-(BOOL)handleEvent:(NSEvent*)event client:(id)sender
{
NSLog(#"handling event: %#", event);
return false;
}
You can see the printout on every keydown and keyup of the modifiers in Console, including command and alt.

Invisible Marker in Eclipse

I've got an unusual error and I might be missing something - I've written a test plugin that should simply show an error marker on the first line of a file. I'm using this code, triggered from a button press
public void createMarkerForResource(IResource resource) throws CoreException {
HashMap map = new HashMap();
MarkerUtilities.setLineNumber(map, 1);
MarkerUtilities.setMessage(map, "HAZARD");
map.put(IMarker.SEVERITY, IMarker.SEVERITY_WARNING);
MarkerUtilities.createMarker(resource, map, IMarker.TEXT);
}
The code appeared not to work - but on closer inspection something is happening. There is now a 'clickable' area on the ruler, but no icon...
Before:
After:
Any ideas?
(I'm aware there's a similar question - but it was self-solved and as we are using different approaches and getting different responses I thought it was worth opening this one up.)
As far as I can see, you define a org.eclipse.core.resources.textmarker.
But I cannot find a org.eclipse.ui.ide.markerImageProviders with an image for the marker type. So I simply believe, there are no image for this type.
Try using a different type of marker type, define your own marker type or define your own image for the textmarker marker type (not recommended).