
buzzdx
Members-
Posts
28 -
Joined
-
Last visited
buzzdx's Achievements
Newbie (1/14)
7
Reputation
-
Textfields not accepting UMLAUT (ÄÜÖ) when using SetText()
buzzdx replied to buzzdx's topic in Programming
Well, to be honest I never had this problem before and have been working with std::string like .. forever basically. I'm not sure what you mean by funny chars. If you mean ä, ü, ö etc., it usually works just fine in my other applications which use wxWidgets for UI and also databases like SQLite or MySQL. If you mean like smileys or something, then yeah, std::string can't use that. Anyway, problem solved, thanks ? While writing this I read the post you linked xD Nicely written ^^ -
Textfields not accepting UMLAUT (ÄÜÖ) when using SetText()
buzzdx replied to buzzdx's topic in Programming
So I got it working now. The problem was indeed that I was using std::string to work on the field data. Simply converting it by creating a new WString from the string then did not work either. The solution is to just use wstring and not string to get and modify the data and finally update the data in the textfield. If you, for some reason, have to use string somewhere in the code and need to convert it to wstring you can use this code: std::wstring S2WS(const std::string& s) { int len; int slength = (int)s.length() + 1; len = MultiByteToWideChar(CP_ACP, 0, s.c_str(), slength, 0, 0); wchar_t* buf = new wchar_t[len]; MultiByteToWideChar(CP_ACP, 0, s.c_str(), slength, buf, len); std::wstring r(buf); delete[] buf; return r; } -
Textfields not accepting UMLAUT (ÄÜÖ) when using SetText()
buzzdx replied to buzzdx's topic in Programming
So the problem is I'm not using the right char set? In my application the user enters something into a textbox. Then it gets stored into a string, gets modified and put back into the textfield, which is where the exception is thrown. Do I need to use wstring instead of string, or your WString class? I tried to convert the modified sting variable to your WString type like: txt->SetText(Wstring(stringvar)); but that didn't work either. -
Hi, I just tried to use the SetText method on a textfield with a value containing "ä". This results in an exception being thrown: std::range_error. The following code reproduces the error: auto txttarget = CreateTextField(515, 5, 400, 24, detailpanel); txttarget->SetText("ä"); It's the same for ö and ü. Am I doing something wrong or is this a bug?
-
So this one is a bit hard to explain. By mystake I created a button which was partly below another widget created after the button. So half the button is visible, but the lower part is hidden behind a tree view. When I click on the button (press and let go) and then move the mouse down, leaving the button by entering the area of the tree control, the button does not notice it lost focus and will keep the blue border. It will notice only when I click on something else in the window. The following setup should illustrate and recreate the "problem". I'm not sure if it can be called a bug though, usually buttons won't be half behind other widgets i guess. //Get displays auto displays = GetDisplays(); //Create window mainwindow = CreateWindow("xyz", 0, 0, 1040, 827, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); //Create user interface ui = CreateInterface(mainwindow); iVec2 sz = ui->root->ClientSize(); auto mainpanel = CreatePanel(0, 9, sz.x, sz.y, ui->root); auto btn_bdx = CreateButton("", 904, 80 /*20*/, 80, 80, mainpanel); tree = CreateTreeView(10, 125, sz.x - 20, 500, mainpanel, TreeViewStyle::TREEVIEW_DEFAULT); To replicate the behaviour: Move mouse onto button, click once. Then move mouse down onto the tree ctrl. The button will keep the blue border/focus state. Click anywhere in the window and the button will notice it has no focus anymore and remove blue border. Thanks,
-
In the create slider function documentation it says the slider has a defined range. I could not find a function in the documentation that does that. I found the SetRange() function which seems to be doing that, but I'm not sure why it takes an x and y value for a one dimensional slider. Could you please clarify how to set the range of a slider and add it to the docs? Thanks,
-
In my project I created a button to delete items. When the button is pressed and the item gets deleted the button will be turned off/disabled. Since the mouse is still over the button when it gets disabled, the button will then keep its blue border even when the mouse moves out of it afterwards. So it seems like it's not detecting the loss of focus while being disabled. However, it will lose the stuck border as soon as I click on anything else in the window. I tried this to overcome the problem: // first try to fix it btn->SetState(false); btn->Redraw(); // trying to emit the mouseleave, but I think it can't get handled before the next line of code. either way has no effect. EmitEvent(Event(EVENT_MOUSELEAVE, btn)); btn->Disable(); // try to fix and redraw after disabling, no effect btn->SetState(false); btn->Redraw(); but nothing worked so far.
-
Ultra AppKit - Is it possible to get a DLL version of Ultra AppKit?
buzzdx replied to buzzdx's topic in Programming
Alright, will do tomorrow. Bed is calling ^^ Good night! -
Ultra AppKit - Is it possible to get a DLL version of Ultra AppKit?
buzzdx replied to buzzdx's topic in Programming
I'll try to do that, sure. For the one with the button border we had already talked about a few weeks ago too, or just the new ones? -
Ultra AppKit - Is it possible to get a DLL version of Ultra AppKit?
buzzdx replied to buzzdx's topic in Programming
Hi again, I'm currently facing a problem which is linked to the last one. Right now I have a button, and upon pressing the button it needs to get disabled. This time the mouse is still on the button at the time it gets disabled and thus again keeps the blue border. I think this should be fixed when you put in that fake mouse-leave event to button->disable(). However, is there a way to make this work as of now? I tried this: // first try to fix it btn->SetState(false); btn->Redraw(); // trying to emit the mouseleave, but I think it can't get handled before the next line of code. either way has no effect. EmitEvent(Event(EVENT_MOUSELEAVE, btn)); btn->Disable(); // try to fix and redraw after disabling, no effect btn->SetState(false); btn->Redraw(); So far I couldn't get it to work. Do you have any idea how to get it work, or should I leave it be at the moment and wait for a new release? Thanks edit: I noticed the keyboard combinations SHIFT+POS1 as well as SHIFT+END do not seem to work in textfields for selecting text. Is it possible to add these? edit 2: By mistake I placed a button so that it is half hidden, i.e. it is half hidden behind another control. when clicking the button and then moving the mouse onto the control which is drawn over it, the button will not notice that the other control gained focus and keep its blue border. on the other hand when the widget above the button was clicked before and the mouse moves between the two the border works properly, i.e. blue when mouse is over and no blue border when it leaves again. edit 3: Is the function SetRange() the one for setting the, well .. range, for a slider widget? I think it's missing in the documentation? -
Ultra AppKit - Is it possible to get a DLL version of Ultra AppKit?
buzzdx replied to buzzdx's topic in Programming
Great, I assume that should work. Thanks. -
Ultra AppKit - Is it possible to get a DLL version of Ultra AppKit?
buzzdx replied to buzzdx's topic in Programming
Hi there, I've discovered another small thing I wanted to let you know about and maybe there is a way to fix this. So I have several buttons which get enabled and disabled depending on what type of item is selected in my treeview. One button is for adding files. In the event handler of that button I call the RequestFile() function which opens the popup dialog. After a file has been selected the dialog closes and the new item is added to my data structure. The tree then rebuilts itself to reflect the changes and call the function to enable/disable buttons. At this time, sometimes the add file button still has the blue border as if the mouse was hovering over it, yet, the mouse has been moved away the moment the popup dialog opened. During the popup dialog, which disabled the main window, the button also stays in this hover state, having the blue border. Now when my code disables the button, it still retains the blue border, but now since it is disabled, it won't go away even when hovering over and then leaving it with the mouse. I managed to fix this by adding btn->SetState(false); btn->Redraw(); before btn->Disable(); for now. Not sure if both are needed, but it works right now. Maybe you could add code to make the buttons lose the hover state when disabling them? Or is what I do here like .. a fringe case and not worth adding to the library?