Exemplo n.º 1
0
ASlider::ASlider( wxWindow * parent,
                  wxWindowID id,
                  wxString name,
                  const wxPoint & pos, 
                  const wxSize & size,
                  int style,
                  bool popup,
                  bool canUseShift,
                  float stepValue, 
                  int orientation /*= wxHORIZONTAL*/) 
: wxPanel( parent, id, pos, size, wxWANTS_CHARS )
{
   mLWSlider = new LWSlider( this,
                             name,
                             wxPoint(0,0),
                             size,
                             style,
                             canUseShift,
                             popup, 
                             orientation);
   mLWSlider->mStepValue = stepValue;
   mLWSlider->SetId( id );
   SetName( name );

   mSliderIsFocused = false;

   mStyle = style;

#if wxUSE_ACCESSIBILITY
   SetAccessible( new ASliderAx( this ) );
#endif
}
Exemplo n.º 2
0
//
// Constructor
//
HtmlWindow::HtmlWindow(wxWindow *parent,
                       wxWindowID id,
                       const wxPoint& pos,
                       const wxSize& size,
                       long style,
                       const wxString& name)
: wxHtmlWindow(parent, id, pos, size, style, name)
{
#if wxUSE_ACCESSIBILITY
   SetAccessible( new HtmlWindowAx( this ) );
#endif
}
Exemplo n.º 3
0
// ============================================================================
// KeyView class
// ============================================================================
KeyView::KeyView(wxWindow *parent,
                 wxWindowID id,
                 const wxPoint & pos,
                 const wxSize & size)
: wxVListBox(parent, id, pos, size, wxBORDER_THEME),
  mOpen(NULL),
  mClosed(NULL),
  mScrollX(0),
  mWidth(0)
{
#if wxUSE_ACCESSIBILITY
   // Create and set accessibility object
   mAx = new KeyViewAx(this);
   SetAccessible(mAx);
#endif

   // Create the device context
   wxMemoryDC dc;

   // Create the open/expanded bitmap
   mOpen = new wxBitmap(16, 16);
   dc.SelectObject(*mOpen);

   dc.SetBrush(*wxWHITE_BRUSH);
   dc.SetPen(*wxWHITE_PEN);
   dc.DrawRectangle(0, 0, 16, 16);

   dc.SetPen(*wxBLACK_PEN);
   dc.DrawRectangle(3, 4, 9, 9);
   dc.DrawLine(5, 8, 10, 8);
   dc.SelectObject(wxNullBitmap);

   // Create the closed/collapsed bitmap
   mClosed = new wxBitmap(16, 16);
   dc.SelectObject(*mClosed);

   dc.SetBrush(*wxWHITE_BRUSH);
   dc.SetPen(*wxWHITE_PEN);
   dc.DrawRectangle(0, 0, 16, 16);

   dc.SetPen(*wxBLACK_PEN);
   dc.DrawRectangle(3, 4, 9, 9);
   dc.DrawLine(7, 6, 7, 11);
   dc.DrawLine(5, 8, 10, 8);
   dc.SelectObject(wxNullBitmap);

   // The default view
   mViewType = ViewByTree;
}
Exemplo n.º 4
0
void AButton::Init(wxWindow * parent,
                   wxWindowID id,
                   const wxPoint & pos,
                   const wxSize & size,
                   ImageRoll up,
                   ImageRoll over,
                   ImageRoll down,
                   ImageRoll overDown,
                   ImageRoll dis,
                   bool toggle)
{
   // Bug in wxWidgets 2.8.12: by default pressing Enter on an AButton is interpreted as
   // a navigation event - move to next control. As a workaround, the style wxWANTS_CHARS
   // results in all characters being available in the OnKeyDown function below. Note
   // that OnKeyDown now has to handle navigation.
   Create(parent, id, pos, size, wxWANTS_CHARS);

   mWasShiftDown = false;
   mWasControlDown = false;
   mButtonIsDown = false;
   mIsClicking = false;
   mEnabled = true;
   mCursorIsInWindow = false;
   mToggle = toggle;
   mUseDisabledAsDownHiliteImage = false;

   mImages.resize(1);
   mImages[0].mArr[0] = up;
   mImages[0].mArr[1] = over;
   mImages[0].mArr[2] = down;
   mImages[0].mArr[3] = overDown;
   mImages[0].mArr[4] = dis;

   mAlternateIdx = 0;

   mFocusRect = GetClientRect().Deflate( 3, 3 );
   mForceFocusRect = false;

   SetSizeHints(mImages[0].mArr[0].GetMinSize(),
                mImages[0].mArr[0].GetMaxSize());

#if wxUSE_ACCESSIBILITY
   SetName( wxT("") );
   SetAccessible(safenew AButtonAx(this));
#endif
}
Exemplo n.º 5
0
bool CProjectListCtrl::Create( wxWindow* parent )
{
////@begin CProjectListCtrl member initialisation
////@end CProjectListCtrl member initialisation

////@begin CProjectListCtrl creation
    wxHtmlListBox::Create( parent, ID_PROJECTLISTCTRL, wxDefaultPosition, wxDefaultSize,
        wxSUNKEN_BORDER | wxTAB_TRAVERSAL );

#if wxUSE_ACCESSIBILITY
    SetAccessible(new CProjectListCtrlAccessible(this));
#endif
#ifdef __WXMAC__
    m_accessible = new CProjectListCtrlAccessible(this);
#endif

    wxMemoryFSHandler::AddFile(wxT("webexternallink.xpm"), wxBitmap(externalweblink_xpm), wxBITMAP_TYPE_XPM);
    wxMemoryFSHandler::AddFile(wxT("nvidiaicon.xpm"), wxBitmap(nvidiaicon_xpm), wxBITMAP_TYPE_XPM);
    wxMemoryFSHandler::AddFile(wxT("atiicon.xpm"), wxBitmap(atiicon_xpm), wxBITMAP_TYPE_XPM);
////@end CProjectListCtrl creation

    return TRUE;
}
Exemplo n.º 6
0
TimeTextCtrl::TimeTextCtrl(wxWindow *parent,
                           wxWindowID id,
                           wxString formatString,
                           double timeValue,
                           double sampleRate,
                           const wxPoint &pos,
                           const wxSize &size,
                           bool autoPos):
   wxControl(parent, id, pos, size, wxSUNKEN_BORDER | wxWANTS_CHARS),
   mTimeValue(timeValue),
   mSampleRate(sampleRate),
   mFormatString(formatString),
   mBackgroundBitmap(NULL),
   mDigitFont(NULL),
   mLabelFont(NULL),
   mFocusedDigit(0),
   mLastField(1),
   mAutoPos(autoPos)
{
   /* i18n-hint: Name of time display format that shows time in seconds */
   BuiltinFormatStrings[0].name = _("seconds");
   /* i18n-hint: Format string for displaying time in seconds. Change the comma
    * in the middle to the 1000s separator for your locale, and the 'seconds'
    * on the end to the word for seconds. Don't change the numbers. */
   BuiltinFormatStrings[0].formatStr = _("01000,01000 seconds");
   /* i18n-hint: Name of time display format that shows time in hours, minutes
    * and seconds */
   BuiltinFormatStrings[1].name = _("hh:mm:ss");
   /* i18n-hint: Format string for displaying time in hours, minutes and
    * seconds. Change the 'h' to the abbreviation for hours, 'm' to the
    * abbreviation for minutes and 's' to the abbreviation for seconds. Don't
    * change the numbers unless there aren't 60 seconds in a minute in your
    * locale */
   BuiltinFormatStrings[1].formatStr = _("0100 h 060 m 060 s");
   /* i18n-hint: Name of time display format that shows time in days, hours,
    * minutes and seconds */
   BuiltinFormatStrings[2].name = _("dd:hh:mm:ss");
   /* i18n-hint: Format string for displaying time in days, hours, minutes and
    * seconds. Change the 'days' to the word for days, 'h' to the abbreviation
    * for hours, 'm' to the abbreviation for minutes and 's' to the
    * abbreviation for seconds. Don't change the numbers unless there aren't
    * 24 hours in a day in your locale */
   BuiltinFormatStrings[2].formatStr = _("0100 days 024 h 060 m 060 s");
   /* i18n-hint: Name of time display format that shows time in hours,
    * minutes, seconds and hundredths of a second (1/100 second) */
   BuiltinFormatStrings[3].name = _("hh:mm:ss + hundredths");
   /* i18n-hint: Format string for displaying time in hours, minutes, seconds
    * and hundredths of a second. Change the 'h' to the abbreviation for hours,
    * 'm' to the abbreviation for minutes and 's' to the abbreviation for seconds (the
    * hundredths are shown as decimal seconds) . Don't change the numbers
    * unless there aren't 60 minutes in an hour in your locale */
   BuiltinFormatStrings[3].formatStr =_("0100 h 060 m 060.0100 s");
   /* i18n-hint: Name of time display format that shows time in hours,
    * minutes, seconds and milliseconds (1/1000 second) */
   BuiltinFormatStrings[4].name = _("hh:mm:ss + milliseconds");
   /* i18n-hint: Format string for displaying time in hours, minutes, seconds
    * and milliseconds. Change the 'h' to the abbreviation for hours, 'm' to the
    * abbreviation for minutes and 's' to the abbreviation for seconds (the
    * milliseconds are shown as decimal seconds) . Don't change the numbers
    * unless there aren't 60 minutes in an hour in your locale */
   BuiltinFormatStrings[4].formatStr =_("0100 h 060 m 060.01000 s");
   /* i18n-hint: Name of time display format that shows time in hours,
    * minutes, seconds and samples (at the current project sample rate) */
   BuiltinFormatStrings[5].name = _("hh:mm:ss + samples");
   /* i18n-hint: Format string for displaying time in hours, minutes, seconds
    * and samples. Change the 'h' to the abbreviation for hours, 'm' to the
    * abbreviation for minutes, 's' to the abbreviation for seconds and
    * translate samples . Don't change the numbers
    * unless there aren't 60 seconds in a minute in your locale */
   BuiltinFormatStrings[5].formatStr = _("0100 h 060 m 060 s+.# samples");
   /* i18n-hint: Name of time display format that shows time in samples (at the
    * current project sample rate) */
   BuiltinFormatStrings[6].name = _("samples");
   /* i18n-hint: Format string for displaying time in samples (lots of samples).
    * Change the ',' to the 1000s separator for your locale, and translate
    * samples. If 1000s aren't a base multiple for your number system, then you
    * can change the numbers to an appropriate one, and put a 0 on the front */
   BuiltinFormatStrings[6].formatStr = _("01000,01000,01000 samples|#");
   /* i18n-hint: Name of time display format that shows time in hours, minutes,
    * seconds and frames at 24 frames per second (commonly used for films) */
   BuiltinFormatStrings[7].name = _("hh:mm:ss + film frames (24 fps)");
   /* i18n-hint: Format string for displaying time in hours, minutes, seconds
    * and frames at 24 frames per second. Change the 'h' to the abbreviation
    * for hours, 'm' to the abbreviation for minutes, 's' to the abbreviation
    * for seconds and translate 'frames' . Don't change the numbers
    * unless there aren't 60 seconds in a minute in your locale */
   BuiltinFormatStrings[7].formatStr = _("0100 h 060 m 060 s+.24 frames");
   /* i18n-hint: Name of time display format that shows time in frames (lots of
    * frames) at 24 frames per second (commonly used for films) */
   BuiltinFormatStrings[8].name = _("film frames (24 fps)");
   /* i18n-hint: Format string for displaying time in frames at 24 frames per
    * second. Translate 'frames' and leave the rest alone */
   BuiltinFormatStrings[8].formatStr = _("01000,01000 frames|24");
   /* i18n-hint: Name of time display format that shows time in hours, minutes,
    * seconds and frames at NTSC TV drop-frame rate (used for American /
    * Japanese TV, and very odd) */
   BuiltinFormatStrings[9].name = _("hh:mm:ss + NTSC drop frames");
   /* i18n-hint: Format string for displaying time in hours, minutes, seconds
    * and frames with NTSC drop frames. Change the 'h' to the abbreviation
    * for hours, 'm' to the abbreviation for minutes, 's' to the abbreviation
    * for seconds and translate 'frames'. Leave the |N alone, it's important! */
   BuiltinFormatStrings[9].formatStr = _("0100 h 060 m 060 s+.30 frames|N");
   /* i18n-hint: Name of time display format that shows time in hours, minutes,
    * seconds and frames at NTSC TV non-drop-frame rate (used for American /
    * Japanese TV, and doesn't quite match wall time */
   BuiltinFormatStrings[10].name = _("hh:mm:ss + NTSC non-drop frames");
   /* i18n-hint: Format string for displaying time in hours, minutes, seconds
    * and frames with NTSC drop frames. Change the 'h' to the abbreviation
    * for hours, 'm' to the abbreviation for minutes, 's' to the abbreviation
    * for seconds and translate 'frames'. Leave the | .999000999 alone, 
    * the whole things really is slightly off-speed! */
   BuiltinFormatStrings[10].formatStr = _("0100 h 060 m 060 s+.030 frames| .999000999");
   /* i18n-hint: Name of time display format that shows time in frames at NTSC
    * TV frame rate (used for American / Japanese TV */
   BuiltinFormatStrings[11].name = _("NTSC frames");
   /* i18n-hint: Format string for displaying time in frames with NTSC frames.
    * Translate 'frames' and leave the rest alone. That really is the frame
    * rate! */
   BuiltinFormatStrings[11].formatStr = _("01000,01000 frames|29.97002997");
   /* i18n-hint: Name of time display format that shows time in hours, minutes,
    * seconds and frames at PAL TV frame rate (used for European TV) */
   BuiltinFormatStrings[12].name = _("hh:mm:ss + PAL frames (25 fps)");
   /* i18n-hint: Format string for displaying time in hours, minutes, seconds
    * and frames with PAL TV frames. Change the 'h' to the abbreviation
    * for hours, 'm' to the abbreviation for minutes, 's' to the abbreviation
    * for seconds and translate 'frames'. Nice simple time code! */
   BuiltinFormatStrings[12].formatStr = _("0100 h 060 m 060 s+.25 frames");
   /* i18n-hint: Name of time display format that shows time in frames at PAL
    * TV frame rate (used for European TV */
   BuiltinFormatStrings[13].name = _("PAL frames (25 fps)");
   /* i18n-hint: Format string for displaying time in frames with NTSC frames.
    * Translate 'frames' and leave the rest alone. */
   BuiltinFormatStrings[13].formatStr = _("01000,01000 frames|25");
   /* i18n-hint: Name of time display format that shows time in hours, minutes,
    * seconds and frames at CD Audio frame rate (75 frames per second) */
   BuiltinFormatStrings[14].name = _("hh:mm:ss + CDDA frames (75 fps)");
   /* i18n-hint: Format string for displaying time in hours, minutes, seconds
    * and frames with CD Audio frames. Change the 'h' to the abbreviation
    * for hours, 'm' to the abbreviation for minutes, 's' to the abbreviation
    * for seconds and translate 'frames'. */
   BuiltinFormatStrings[14].formatStr = _("0100 h 060 m 060 s+.75 frames");
   /* i18n-hint: Name of time display format that shows time in frames at CD
    * Audio frame rate (75 frames per second) */
   BuiltinFormatStrings[15].name = _("CDDA frames (75 fps)");
   /* i18n-hint: Format string for displaying time in frames with CD Audio
    * frames. Translate 'frames' and leave the rest alone */
   BuiltinFormatStrings[15].formatStr = _("01000,01000 frames|75");

   mDigitBoxW = 10;
   mDigitBoxH = 16;

   mMenuEnabled = true;
   mButtonWidth = 9;

   ParseFormatString();
   Layout();
   Fit();
   ValueToControls();
   //mchinen - aug 15 09 - this seems to put the mTimeValue back to zero, and do nothing else.
   //ControlsToValue(); 

#if wxUSE_ACCESSIBILITY
   SetLabel(wxT(""));
   SetName(wxT(""));
   SetAccessible(new TimeTextCtrlAx(this));
#endif
}
Exemplo n.º 7
0
// frame constructor
MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size, long style)
       : wxFrame(NULL, wxID_ANY, title, pos, size, style)
{
    m_textCtrl = NULL;

    SetAccessible(new FrameAccessible(this));

    // set the frame icon
    SetIcon(wxICON(sample));

#if wxUSE_MENUS
    // create a menu bar
    wxMenu *menuFile = new wxMenu;

    // the "About" item should be in the help menu
    wxMenu *helpMenu = new wxMenu;
    helpMenu->Append(AccessTest_About, wxT("&About"), wxT("Show about dialog"));

    menuFile->Append(AccessTest_Query, wxT("Query"), wxT("Query the window hierarchy"));
    menuFile->AppendSeparator();
    menuFile->Append(AccessTest_Quit, wxT("E&xit\tAlt-X"), wxT("Quit this program"));

    // now append the freshly created menu to the menu bar...
    wxMenuBar *menuBar = new wxMenuBar();
    menuBar->Append(menuFile, wxT("&File"));
    menuBar->Append(helpMenu, wxT("&Help"));

    // ... and attach this menu bar to the frame
    SetMenuBar(menuBar);
#endif // wxUSE_MENUS

#if 0 // wxUSE_STATUSBAR
    // create a status bar just for fun (by default with 1 pane only)
    CreateStatusBar(2);
    SetStatusText(wxT("Welcome to wxWidgets!"));
#endif // wxUSE_STATUSBAR


    wxSplitterWindow* splitter = new wxSplitterWindow(this, wxID_ANY);
    splitter->SetAccessible(new SplitterWindowAccessible(splitter));

    wxListBox* listBox = new wxListBox(splitter, wxID_ANY);
    listBox->Append(wxT("Cabbages"));
    listBox->Append(wxT("Kings"));
    listBox->Append(wxT("Sealing wax"));
    listBox->Append(wxT("Strings"));
    listBox->CreateAccessible();
    listBox->SetHelpText(wxT("This is a sample wxWidgets listbox, with a number of items in it."));

    m_textCtrl = new wxTextCtrl(splitter, wxID_ANY, wxT(""), wxDefaultPosition,
        wxDefaultSize, wxTE_MULTILINE);
    m_textCtrl->CreateAccessible();
    m_textCtrl->SetHelpText(wxT("This is a sample wxWidgets multiline text control."));

    splitter->SplitHorizontally(listBox, m_textCtrl, 150);

#if 0
    wxScrolledWindow* scrolledWindow = new wxScrolledWindow(this, wxID_ANY);
    scrolledWindow->SetAccessible(new ScrolledWindowAccessible(scrolledWindow));
#endif
}