Remove XM_STRING_CREATE. Replace it with XmStringCreateLocalized.

This commit is contained in:
Mid Favila 2022-08-21 21:40:57 -04:00
parent 0e9ed3e250
commit 48e0af8465
6 changed files with 24 additions and 32 deletions

View File

@ -24,7 +24,7 @@ void saveFile(Widget parent)
XmString theXmString;
Arg args[1];
theXmString = XM_STRING_CREATE("Save As");
theXmString = XmStringCreateLocalized("Save As");
XtSetArg(args[0], XmNdialogTitle, theXmString);
selDialog = XmCreateFileSelectionDialog(parent, "select", args, 1);
XtAddCallback(selDialog, XmNokCallback, saveFileCbk, NULL);

View File

@ -38,7 +38,7 @@ void createAboutBox(Widget parent)
CLIENT_VERSION, sysState.systemInfo);
theXmString = XM_STRING_GEN_COMP(theString);
theXmString2 = XM_STRING_CREATE("About");
theXmString2 = XmStringCreateLocalized("About");
XtSetArg(args[0], XmNdialogTitle, theXmString2);
XtSetArg(args[1], XmNmessageString, theXmString);
aboutDlgBox = XmCreateInformationDialog(parent, "about", args, 2);
@ -67,7 +67,7 @@ void createCommandsHelpBox(Widget parent)
Widget form;
argcount = 0;
theXmString = XM_STRING_CREATE("Help");
theXmString = XmStringCreateLocalized("Help");
XtSetArg(args[argcount], XmNdialogTitle, theXmString); argcount++;
XtSetArg(args[argcount], XmNautoUnmanage, True); argcount++;
commandsHelpDlgBox = XmCreatePromptDialog(parent, "help", args, argcount);

View File

@ -68,23 +68,23 @@ int main (int argc, char *argv[])
mainWindow = XtVaCreateManagedWidget("main_window", xmMainWindowWidgetClass, topWidget, XmNcommandWindowLocation, XmCOMMAND_BELOW_WORKSPACE, XmNwidth, 600, XmNheight, 500, NULL);
menuBar = XmVaCreateSimpleMenuBar(mainWindow, "menubar",
XmVaCASCADEBUTTON, XM_STRING_CREATE("File"), 'F',
XmVaCASCADEBUTTON, XM_STRING_CREATE("User"), 'U',
XmVaCASCADEBUTTON, XmStringCreateLocalized("File"), 'F',
XmVaCASCADEBUTTON, XmStringCreateLocalized("User"), 'U',
NULL);
XmVaCreateSimplePulldownMenu(menuBar, "file_menu", 0,
fileMenuCall,
XmVaPUSHBUTTON, XM_STRING_CREATE("Preferences..."), 'P', NULL, NULL,
XmVaPUSHBUTTON, XM_STRING_CREATE("Save Conversation"), 'S', NULL, NULL,
XmVaPUSHBUTTON, XM_STRING_CREATE("Quit"), 'Q', NULL, NULL,
XmVaPUSHBUTTON, XmStringCreateLocalized("Preferences..."), 'P', NULL, NULL,
XmVaPUSHBUTTON, XmStringCreateLocalized("Save Conversation"), 'S', NULL, NULL,
XmVaPUSHBUTTON, XmStringCreateLocalized("Quit"), 'Q', NULL, NULL,
NULL);
XmVaCreateSimplePulldownMenu(menuBar, "user_menu", 1,
userMenuCall,
XmVaPUSHBUTTON, XM_STRING_CREATE("Whois"), 'W', NULL, NULL,
XmVaPUSHBUTTON, XM_STRING_CREATE("Client version"), '\0', NULL, NULL,
XmVaPUSHBUTTON, XM_STRING_CREATE("Op"), 'O', NULL, NULL,
XmVaPUSHBUTTON, XM_STRING_CREATE("Deop"), 'D', NULL, NULL,
XmVaPUSHBUTTON, XmStringCreateLocalized("Whois"), 'W', NULL, NULL,
XmVaPUSHBUTTON, XmStringCreateLocalized("Client version"), '\0', NULL, NULL,
XmVaPUSHBUTTON, XmStringCreateLocalized("Op"), 'O', NULL, NULL,
XmVaPUSHBUTTON, XmStringCreateLocalized("Deop"), 'D', NULL, NULL,
NULL);
helpMenu = XtVaCreateManagedWidget("Help",
@ -93,8 +93,8 @@ int main (int argc, char *argv[])
NULL);
XmVaCreateSimplePulldownMenu(menuBar, "Help", 2,
helpMenuCall,
XmVaPUSHBUTTON, XM_STRING_CREATE("About..."), 'A', NULL, NULL,
XmVaPUSHBUTTON, XM_STRING_CREATE("Commands"), 'C', NULL, NULL,
XmVaPUSHBUTTON, XmStringCreateLocalized("About..."), 'A', NULL, NULL,
XmVaPUSHBUTTON, XmStringCreateLocalized("Commands"), 'C', NULL, NULL,
NULL);
XtVaSetValues(menuBar, XmNmenuHelpWidget, helpMenu, NULL);

View File

@ -56,14 +56,6 @@ void rmvFdToSelectMask(int fd);
void quitApplication();
void appendText(char *msg);
#ifdef HAVE_XMSTRINGCREATELOCALIZED
#define XM_STRING_CREATE(str)\
XmStringCreateLocalized(str)
#else
#define XM_STRING_CREATE(str)\
XmStringCreateSimple(str)
#endif
/* remember to check for XmFONTLIST_DEFAULT_TAG when used */
#ifdef HAVE_XMSTRINGGENERATE

View File

@ -87,7 +87,7 @@ void helpButtStartupCbk()
Widget startupPrefsHelpDlgBox;
argcount = 0;
theXmString = XM_STRING_CREATE("Help");
theXmString = XmStringCreateLocalized("Help");
XtSetArg(args[argcount], XmNdialogTitle, theXmString); argcount++;
theXmString2 = XM_STRING_GEN_COMP("Set nickname and name you want to use.\n\nEnter the server you want to connect to.");
XtSetArg(args[argcount], XmNmessageString, theXmString2); argcount++;
@ -123,7 +123,7 @@ void setPreferences(Widget mainWin)
char myName[MAX_NAME_LEN];
argcount = 0;
labelString = XM_STRING_CREATE("Startup Prefs");
labelString = XmStringCreateLocalized("Startup Prefs");
XtSetArg(args[argcount], XmNdialogTitle, labelString); argcount++;
XtSetArg(args[argcount], XmNautoUnmanage, True); argcount++;
startPrefDiag = XmCreatePromptDialog(mainWin, "startup_prefs", args, argcount);
@ -138,7 +138,7 @@ void setPreferences(Widget mainWin)
prefForm = XtVaCreateWidget("form", xmFormWidgetClass, startPrefDiag,
XmNfractionBase, 18, NULL);
labelString = XM_STRING_CREATE("Name:");
labelString = XmStringCreateLocalized("Name:");
XtVaCreateManagedWidget("name_label",
xmLabelWidgetClass, prefForm,
XmNlabelString, labelString,
@ -147,7 +147,7 @@ void setPreferences(Widget mainWin)
NULL);
XmStringFree(labelString);
labelString = XM_STRING_CREATE("Nick:");
labelString = XmStringCreateLocalized("Nick:");
XtVaCreateManagedWidget("nick_label",
xmLabelWidgetClass, prefForm,
XmNlabelString, labelString,
@ -156,7 +156,7 @@ void setPreferences(Widget mainWin)
NULL);
XmStringFree(labelString);
labelString = XM_STRING_CREATE("Server:");
labelString = XmStringCreateLocalized("Server:");
XtVaCreateManagedWidget("server_label",
xmLabelWidgetClass, prefForm,
XmNlabelString, labelString,
@ -190,7 +190,7 @@ void setPreferences(Widget mainWin)
XmNrightAttachment, XmATTACH_POSITION, XmNrightPosition, 18,
NULL);
labelString = XM_STRING_CREATE("Port: ");
labelString = XmStringCreateLocalized("Port: ");
portLabel = XtVaCreateManagedWidget("port_label",
xmLabelWidgetClass, prefForm,
XmNlabelString, labelString,
@ -324,7 +324,7 @@ void helpButtPrefCbk()
Widget startupPrefsHelpDlgBox;
argcount = 0;
theXmString = XM_STRING_CREATE("Help");
theXmString = XmStringCreateLocalized("Help");
XtSetArg(args[argcount], XmNdialogTitle, theXmString); argcount++;
theXmString2 = XM_STRING_GEN_COMP("This panel sets the startup preferences.\n\
Ok will save them to the user\'s defaults.\n\n\

View File

@ -13,7 +13,7 @@ void addUserToList(char *nick, Widget listWidget)
{
XmString tempXmString;
tempXmString = XM_STRING_CREATE(nick);
tempXmString = XmStringCreateLocalized(nick);
if (XmListItemExists(listWidget, tempXmString) == False)
XmListAddItem(listWidget, tempXmString, 0);
XmStringFree(tempXmString);
@ -23,7 +23,7 @@ void removeUserFromList(char *nick, Widget listWidget)
{
XmString tempXmString;
tempXmString = XM_STRING_CREATE(nick);
tempXmString = XmStringCreateLocalized(nick);
XmListDeleteItem(listWidget, tempXmString);
XmStringFree(tempXmString);
}
@ -32,7 +32,7 @@ void renameUserInList(char *oldNick, char *newNick, Widget listWidget)
{
XmString tempXmString;
tempXmString = XM_STRING_CREATE(oldNick);
tempXmString = XmStringCreateLocalized(oldNick);
if (XmListItemPos(listWidget, tempXmString))
{
removeUserFromList(oldNick, listWidget);