COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :
Old 05-17-2017, 07:49 AM   #1
Tired_Joe
Human being with feelings
 
Join Date: Apr 2015
Posts: 55
Default Text entry "comma" to "period"

Hello,
I am using WDL-OL and I am trying to extend the IKnobMultiControlText from IPlugMultiTarget example to add the possibility to use comma "," values.
But I can´t input these "," values and I can´t find a way to implement this.

I want to have the same behaviour like a "."

so the userinput "131,23" should be "131.23"

Can anybody help me?
Tired_Joe is offline   Reply With Quote
Old 05-18-2017, 04:09 AM   #2
JD Young
Human being with feelings
 
JD Young's Avatar
 
Join Date: Nov 2014
Location: Leiden, the Netherlands
Posts: 36
Default

Hi Joe,


I'm by no means an expert on this, but it seems to me that the PromptUserInput functionality is different for Mac and PC.

The actual input checking for PC seems to be done in:

IGraphicsWin::ParamEditProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)

And for Mac in:

IGraphicsCarbon::TextEntryHandler(EventHandlerCall Ref pHandlerCall, EventRef pEvent, void* pGraphicsCarbon)

If you look at these functions, it appears the input checking is hard-coded in. This would mean you would need to change Iplug. However, maybe I'm missing something.

Hope this helps you on your way!


JD


Update: in addition you might need to edit this function as well, to replace commas with periods so they get converted from char* to double correctly:

IGraphics::SetFromStringAfterPrompt(IControl* pControl, IParam* pParam, char *txt)

Last edited by JD Young; 05-18-2017 at 06:05 AM.
JD Young is offline   Reply With Quote
Old 05-18-2017, 05:11 PM   #3
earlevel
Human being with feelings
 
Join Date: Dec 2015
Posts: 331
Default

Quote:
Originally Posted by JD Young View Post
I'm by no means an expert on this, but it seems to me that the PromptUserInput functionality is different for Mac and PC.
Yeah, I've complained about this before (Handling arrow keys in a text control)—entry fields should not rely on platform-native code...oh well...
earlevel is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 06:12 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.