The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 GETN macro with build-in translator: Bug or featur
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

additive

Germany
109 Posts

Posted - 09/06/2010 :  08:55:00 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. 8.1 SR2 German
Operating System: Windows XP

Using GETN_COMBO macro reveals a nice feature, but at the same time is rather
dangerous. A list string, e.g.

strComboList = "Cancel|Error|All";
GETN_COMBO(Demo, "Values:", 0, strComboList)

will be translated to

Abbrechen / Fehler / Alle

during run time (shown in the actual dialog box).

How can I switch this off?
I suppose this behoviour occurs in the German version only.
Is it fixed in newer SRs?

/ Michael

additive

Germany
109 Posts

Posted - 09/06/2010 :  11:21:01 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Please note that not all entries will be translated ...
Go to Top of Page

Penn

China
644 Posts

Posted - 09/07/2010 :  03:58:02 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Michael,

Yes, this translation behavior will occur in the German version. Actually, when using GETN_COMBO macro, the combo list items are usually the numbers. For the string combo list items, the GETN_LIST macro will be used more often.

When using the GETN_LIST macro, the TreeNode::SetAttribute method can be used to prevent such behavior from happening, by passing parameters STR_OCNTRL_OPTNS and OCNTRLPARAM1_NOT_LOCALIZED. For example:

void testCombo()
{
	GETN_BOX(trDemo);
	string strComboList = "Cancel|Error|All";
	
	//GETN_COMBO(Demo, "Values:", 0, strComboList);
	GETN_LIST(Demo, "Values:", 0, strComboList);  // use GETN_LIST
	trDemo.Demo.SetAttribute(STR_OCNTRL_OPTNS, OCNTRLPARAM1_NOT_LOCALIZED);  // prevent translation
	
	if(GetNBox(trDemo))
		out_tree(trDemo);
}


Penn
Go to Top of Page

additive

Germany
109 Posts

Posted - 09/07/2010 :  10:10:47 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you! Works great.
Go to Top of Page

additive

Germany
109 Posts

Posted - 09/16/2010 :  10:21:04 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,
I've found another GETN combo problem.
I'm using GETN_STRLIST now, but if it contains a lot of entries, the combo box will extent over the whole screen. Does anyone how I can avoid this?
GETN_OPTION_MANUAL_RESIZE does not seem to help.




Regards,
Michael
Go to Top of Page

Penn

China
644 Posts

Posted - 09/16/2010 :  11:24:34 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Michael,

We will try to fix this problem in the future version. Thank you for reporting this and sorry for the inconvenience.

By the way, GETN_OPTION_MANUAL_RESIZE is used for dialog size, but not for something like GETN_STRLIST.

Penn
Go to Top of Page

qaoffice

China
4 Posts

Posted - 09/17/2010 :  06:24:58 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Michael,
please use STR_COMBO_DROPPED_VISIBLE_ITEMS attribute to control how many entries is visible.

#include <GetNbox.h>
void GETN_STRLIST_ex1()
{
GETN_BOX( treeTest );
GETN_STRLIST(WksName, "Worksheet Name (please use short name)", "one", "|one|two|three|four|five|one|two|three|four|five|one|two|three|four|five|one|two|three|four|five|one|two|three|four|five|one|two|three|four|five|one|two|three|four|five|one|two|three|four|five|one|two|three|four|five|one|two|three|four|five|one|two|three|four|five|one|two|three|four|five|one|two|three|four|five|one|two|three|four|five|one|two|three|four|five|one|two|three|four|five|one|two|three|four|five|one|two|three|four|five|one|two|three|four|five|one|two|three|four|five")
treeTest.WksName.SetAttribute(STR_COMBO_DROPPED_VISIBLE_ITEMS, 25);
GetNBox( treeTest )
}

Regards,
Kyle
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000