Back to index

plt-scheme  4.2.1
Defines | Functions
Choice.cc File Reference
#include "wx.h"
#include "widgets.h"

Go to the source code of this file.

Defines

#define Uses_XtIntrinsic
#define Uses_wxChoice
#define Uses_wxMenu
#define Uses_ArrowWidget
#define Uses_TraversingEnforcerWidget
#define Uses_LabelWidget

Functions

char * wxchoice_unprotect_amp (char *s)
static char * protect_amp (char *s)

Define Documentation

Definition at line 35 of file Choice.cc.

Definition at line 37 of file Choice.cc.

Definition at line 36 of file Choice.cc.

#define Uses_wxChoice

Definition at line 32 of file Choice.cc.

#define Uses_wxMenu

Definition at line 33 of file Choice.cc.

Definition at line 31 of file Choice.cc.


Function Documentation

static char* protect_amp ( char *  s) [static]

Definition at line 209 of file Choice.cc.

{
  if (strchr(s, '&')) {
    /* protect "&" */
    int i, amp = 0;
    char *s2;
    for (i = 0; s[i]; i++) {
      if (s[i] == '&')
       amp++;
    }

    s2 = new WXGC_ATOMIC char[i + amp + 1];
    for (i = 0, amp = 0; s[i]; i++, amp++) {
      s2[amp] = s[i];
      if (s[i] == '&') {
       s2[++amp] = '&';
      }
    }
    s2[amp] = 0;
    return s2;
  } else
    return s;
}

Here is the call graph for this function:

Here is the caller graph for this function:

char * wxchoice_unprotect_amp ( char *  s)

Definition at line 233 of file Choice.cc.

{
  if (strchr(s, '&')) {
    /* strip "&&" */
    int i, amp = 0;
    char *s2;
    for (i = 0; s[i]; i++) {
      if (s[i] == '&') {
       amp++;
       i++;
      }
    }

    s2 = new WXGC_ATOMIC char[i - amp + 1];
    amp = 0;
    for (i = 0; s[i]; i++, amp++) {
      if (s[i] == '&')
       i++;
      s2[amp] = s[i];
    }
    s2[amp] = 0;
    return s2;
  } else
    return s;
}

Here is the call graph for this function:

Here is the caller graph for this function: