File: ConnectDialog.cxx

package info (click to toggle)
pwlib 1.10.2-2%2Betch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 12,112 kB
  • ctags: 14,989
  • sloc: cpp: 109,883; ansic: 6,061; sh: 2,929; makefile: 1,054; yacc: 861; asm: 161
file content (157 lines) | stat: -rw-r--r-- 4,627 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
/////////////////////////////////////////////////////////////////////////////
// Name:        ConnectDialog.cxx
// Purpose:     
// Author:      Federico Pinna
// Modified by: 
// Created:     05/02/04 16:23:19
// RCS-ID:      
// Copyright:   (c) 2004 Reitek S.p.A.
// Licence:     
/////////////////////////////////////////////////////////////////////////////

#if defined(__GNUG__) && !defined(__APPLE__)
#pragma implementation "ConnectDialog.h"
#endif

// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"

#ifdef __BORLANDC__
#pragma hdrstop
#endif

#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif

#include "main.h"

////@begin includes
////@end includes

#include "ConnectDialog.h"

////@begin XPM images
////@end XPM images

/*!
 * _ConnectDialog type definition
 */

IMPLEMENT_CLASS( _ConnectDialog, wxDialog )

/*!
 * _ConnectDialog event table definition
 */

BEGIN_EVENT_TABLE( _ConnectDialog, wxDialog )

////@begin _ConnectDialog event table entries
////@end _ConnectDialog event table entries

END_EVENT_TABLE()

/*!
 * _ConnectDialog constructors
 */

_ConnectDialog::_ConnectDialog( )
{
}

_ConnectDialog::_ConnectDialog( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
    Create(parent, id, caption, pos, size, style);
}

/*!
 * ConnectDialog creator
 */

bool _ConnectDialog::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
////@begin _ConnectDialog member initialisation
    m_JID = NULL;
    m_Pwd = NULL;
    m_RememberPwd = NULL;
////@end _ConnectDialog member initialisation

////@begin _ConnectDialog creation
    SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
    wxDialog::Create( parent, id, caption, pos, size, style );

    CreateControls();
    GetSizer()->Fit(this);
    GetSizer()->SetSizeHints(this);
    Centre();
////@end _ConnectDialog creation
    return TRUE;
}

/*!
 * Control creation for ConnectDialog
 */

void _ConnectDialog::CreateControls()
{    
////@begin _ConnectDialog content construction

    _ConnectDialog* item1 = this;

    wxBoxSizer* item2 = new wxBoxSizer(wxVERTICAL);
    item1->SetSizer(item2);
    item1->SetAutoLayout(TRUE);

    wxFlexGridSizer* item3 = new wxFlexGridSizer(2, 2, 0, 0);
    item2->Add(item3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

    wxStaticText* item4 = new wxStaticText( item1, wxID_STATIC, _("User ID"), wxDefaultPosition, wxDefaultSize, 0 );
    item3->Add(item4, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5);

    wxTextCtrl* item5 = new wxTextCtrl( item1, ID_TEXTCTRL, _T(""), wxDefaultPosition, wxSize(150, -1), 0 );
    m_JID = item5;
    if (ShowToolTips())
        item5->SetToolTip(_("Enter your jabber user id"));
    item3->Add(item5, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxStaticText* item6 = new wxStaticText( item1, wxID_STATIC, _("Password"), wxDefaultPosition, wxDefaultSize, 0 );
    item3->Add(item6, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5);

    wxTextCtrl* item7 = new wxTextCtrl( item1, ID_TEXTCTRL1, _T(""), wxDefaultPosition, wxSize(150, -1), wxTE_PASSWORD );
    m_Pwd = item7;
    if (ShowToolTips())
        item7->SetToolTip(_("Enter your password"));
    item3->Add(item7, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxStaticText* item8 = new wxStaticText( item1, wxID_STATIC, _T(""), wxDefaultPosition, wxDefaultSize, 0 );
    item3->Add(item8, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5);

    wxCheckBox* item9 = new wxCheckBox( item1, ID_CHECKBOX, _("Remember password"), wxDefaultPosition, wxDefaultSize, 0 );
    m_RememberPwd = item9;
    item9->SetValue(FALSE);
    item9->SetHelpText(_("Check to save the password"));
    if (ShowToolTips())
        item9->SetToolTip(_("Check to save the password"));
    item3->Add(item9, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxBoxSizer* item10 = new wxBoxSizer(wxHORIZONTAL);
    item2->Add(item10, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

    wxButton* item11 = new wxButton( item1, wxID_OK, _("Ok"), wxDefaultPosition, wxDefaultSize, 0 );
    item11->SetDefault();
    item10->Add(item11, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxButton* item12 = new wxButton( item1, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
    item10->Add(item12, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

////@end _ConnectDialog content construction
}

/*!
 * Should we show tooltips?
 */

bool _ConnectDialog::ShowToolTips()
{
    return TRUE;
}