コード例 #1
0
WXFORMPTR wxControl::GetObjectFormIndex(uint16_t& index) const
{
    FormType* form = (FormType* )GetParentForm();
    if(form!=NULL)
        index = FrmGetObjectIndex(form, GetId());
    else
        index = frmInvalidObjectId;
    return form;
}
コード例 #2
0
bool wxControl::GetBoolValue() const
{
    FormType* form = (FormType*)GetParentForm();
    if(form==NULL)
        return false;
    uint16_t index = FrmGetObjectIndex(form, GetId());
    if(index==frmInvalidObjectId)
        return false;
    return ( FrmGetControlValue(form, index) == 1 );
}
コード例 #3
0
void wxControl::SetIntValue(int val)
{
    FormType* form = (FormType*)GetParentForm();
    if(form==NULL)
        return;
    uint16_t index = FrmGetObjectIndex(form, GetId());
    if(index==frmInvalidObjectId)
        return;
    FrmSetControlValue(form, index, val);
}
コード例 #4
0
ファイル: control.cpp プロジェクト: gitrider/wxsj2
void wxControl::DoSetBounds( RectangleType &rect )
{
    FormType* form = GetParentForm();
    if(form==NULL)
        return;
    uint16_t index = FrmGetObjectIndex(form,GetId());
    if(index==frmInvalidObjectId)
        return;
    FrmSetObjectBounds(form,index,&rect);
}
コード例 #5
0
void wxControl::DoSetBounds( WXRECTANGLEPTR rect )
{
    if(rect==NULL)
        return;
    FormType* form = (FormType*)GetParentForm();
    if(form==NULL)
        return;
    uint16_t index = FrmGetObjectIndex(form,GetId());
    if(index==frmInvalidObjectId)
        return;
    FrmSetObjectBounds(form,index,(RectangleType*)rect);
}
コード例 #6
0
bool wxControl::Show( bool show )
{
    FormType* form = (FormType*)GetParentForm();
    if(form==NULL)
        return false;
    uint16_t index = FrmGetObjectIndex(form,GetId());
    if(index==frmInvalidObjectId)
        return false;
    if(show)
        FrmShowObject(form,index);
    else
        FrmHideObject(form,index);
    return true;
}
コード例 #7
0
bool wxControl::PalmCreateField(const wxString& label,
                                const wxPoint& pos,
                                const wxSize& size,
                                bool editable,
                                bool underlined,
                                int justification)
{
    FormType* form = (FormType*)GetParentForm();
    if(form==NULL)
        return false;

    m_label = label;

    wxCoord x = pos.x == wxDefaultCoord ? 0 : pos.x,
            y = pos.y == wxDefaultCoord ? 0 : pos.y,
            w = size.x == wxDefaultCoord ? 1 : size.x,
            h = size.y == wxDefaultCoord ? 1 : size.y;

    AdjustForParentClientOrigin(x, y);

    FieldType *field = FldNewField(
                           (void **)&form,
                           GetId(),
                           x,
                           y,
                           w,
                           h,
                           stdFont,
                           10,
                           editable,
                           underlined,
                           false,
                           false,
                           (JustificationType)justification,
                           false,
                           false,
                           false
                       );

    if(field==NULL)
        return false;

    m_palmField = true;

    SetInitialBestSize(size);
    SetLabel(label);
    Show();
    return true;
}
コード例 #8
0
bool wxControl::PalmCreateControl(int style,
                                  const wxString& label,
                                  const wxPoint& pos,
                                  const wxSize& size,
                                  uint8_t groupID)
{
    FormType* form = (FormType*)GetParentForm();
    if(form==NULL)
        return false;


    wxCoord x = pos.x == wxDefaultCoord ? 0 : pos.x,
            y = pos.y == wxDefaultCoord ? 0 : pos.y,
            w = size.x == wxDefaultCoord ? 1 : size.x,
            h = size.y == wxDefaultCoord ? 1 : size.y;

    wxWindow *win = this;
    while(win->GetParent())
    {
        win = win->GetParent();
        wxPoint pt(win->GetClientAreaOrigin());
        x += pt.x;
        y += pt.y;
    }

    ControlType *control = CtlNewControl(
                               (void **)&form,
                               GetId(),
                               (ControlStyleType)style,
                               wxEmptyString,
                               x,
                               y,
                               w,
                               h,
                               stdFont,
                               groupID,
                               true
                           );

    if(control==NULL)
        return false;

    m_palmControl = true;

    SetInitialBestSize(size);
    SetLabel(label);
    Show();
    return true;
}
コード例 #9
0
ファイル: Rights.cpp プロジェクト: mpmartin8080/winscp
//---------------------------------------------------------------------------
void __fastcall TRightsFrame::DropDown()
{
  TCustomForm * Form = GetParentForm(this);
  // due to lack of better idea, we clear "default" and "cancel" flags of respective
  // form buttons to prevent them to handle ESC/ENTER keys.
  for (int Index = 0; Index < Form->ControlCount; Index++)
  {
    TButton * Button = dynamic_cast<TButton *>(Form->Controls[Index]);
    if (Button != NULL)
    {
      if (Button->Default)
      {
        assert(FDefaultButton == NULL);
        FDefaultButton = Button;
        Button->Default = false;
      }

      if (Button->Cancel)
      {
        assert(FCancelButton == NULL);
        FCancelButton = Button;
        Button->Cancel = false;
      }
    }
  }

  TPoint Origin(PopupParent->Left, PopupParent->Top + PopupParent->Height);
  Origin = Parent->ScreenToClient(PopupParent->Parent->ClientToScreen(Origin));
  if (Origin.x + Width > Parent->ClientWidth)
  {
    Origin.x += PopupParent->Width - Width;
  }
  Left = Origin.x;
  Top = Origin.y;
  Show();
  SetFocus();
}
コード例 #10
0
ファイル: slider.cpp プロジェクト: esrrhs/fuck-music-player
bool wxSlider::Create(wxWindow *parent, wxWindowID id,
           int value, int minValue, int maxValue,
           const wxPoint& pos,
           const wxSize& size, long style,
           const wxValidator& validator,
           const wxString& name)
{
    // wxSL_AUTOTICKS is ignored - always on
    // wxSL_LABELS is ignored - always off
    // wxSL_LEFT is ignored - always off
    // wxSL_RIGHT is ignored - always off
    // wxSL_TOP is ignored - always off
    // wxSL_SELRANGE is ignored - always off
    // wxSL_VERTICAL is impossible in native form
    wxCHECK_MSG(!(style & wxSL_VERTICAL), false, wxT("non vertical slider on PalmOS"));

    if(!wxControl::Create(parent, id, pos, size, style, validator, name))
        return false;

    FormType* form = (FormType*)GetParentForm();
    if(form==NULL)
        return false;

    m_oldValue = m_oldPos = value;

    wxCoord x = pos.x == wxDefaultCoord ? 0 : pos.x,
            y = pos.y == wxDefaultCoord ? 0 : pos.y,
            w = size.x == wxDefaultCoord ? 1 : size.x,
            h = size.y == wxDefaultCoord ? 1 : size.y;

    AdjustForParentClientOrigin(x, y);

#ifdef __WXPALMOS6__
    SliderControlType *slider = CtlNewSliderControl (
                                   (void **)&form,
                                   GetId(),
                                   feedbackSliderCtl,
                                   NULL,
                                   0,
                                   0,
                                   x,
                                   y,
                                   w,
                                   h,
                                   minValue,
                                   maxValue,
                                   1,
                                   value
                              );
#else // __WXPALMOS5__
    //SliderControlType *CtlNewSliderControl (void **formPP, UInt16 ID, ControlStyleType style, DmResID thumbID,
    //    DmResID backgroundID, Coord x, Coord y, Coord width, Coord height, UInt16 minValue, UInt16 maxValue,
    //    UInt16 pageSize, UInt16 value);
    SliderControlType *slider =  CtlNewSliderControl ((void **)&form,
             GetId(),
             feedbackSliderCtl,//style
             0,//thumbID
             0,//backgroundid
             x, y, w, h, minValue, maxValue, 1, value);
#endif // __WXPALMOS6__/__WXPALMOS5__

    if(slider==NULL)
        return false;

    SetInitialSize(size);
    Show();
    return true;
}
void __fastcall TDesignTimeOptions::Button3Click(TObject *Sender)
{
  TChartMultiLanguage::ChangeLanguage(TeeLanguageRegistry());
  CreateNewSeriesGallery(GetParentForm(this), Chart1);
}