Blame view

GUI/SW2/SRC/src/utility/PnlLblCho.cpp 4.3 KB
886c558b   Steve Greedy   SACAMOS Public Re...
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
//**************************************************************************************************
//                                         PnlLblCho.cpp                                           *
//                                        ---------------                                          *
// Started     : 2014-02-20                                                                        *
// Last Update : 2015-01-26                                                                        *
// Copyright   : (C) 2014-2016 MSWaters                                                            *
//**************************************************************************************************

//**************************************************************************************************
//                                                                                                 *
//      This program is free software; you can redistribute it and/or modify it under the          *
//      terms of the GNU General Public License as published by the Free Software Foundation;      *
//      either version 3 of the License, or (at your option) any later version.                    *
//                                                                                                 *
//**************************************************************************************************

#include "PnlLblCho.hpp"

//**************************************************************************************************
// Implement an event table.

//wxBEGIN_EVENT_TABLE( PnlLblCho, wxPanel )

//  EVT_CHOICE( ID_CHOICE, PnlLblCho::OnChoice )

//wxEND_EVENT_TABLE( )

//**************************************************************************************************
// Constructor.

PnlLblCho::PnlLblCho( void ) : wxPanel( )
{
}

//**************************************************************************************************
// Destructor.

PnlLblCho::~PnlLblCho( )
{
}

//**************************************************************************************************
// Layout the display objects.

void  PnlLblCho::DoLayout( void )
{
  wxBoxSizer * poSzr;
  wxSizerFlags  oFlags;

  poSzr = new wxBoxSizer( wxHORIZONTAL );

  oFlags.Proportion( 1 );
  oFlags.Border( wxTOP, 5 );
  poSzr->Add( &m_oLblName, oFlags );

  oFlags.Proportion( 0 );
  oFlags.Border( wxTOP, 0 );
  poSzr->Add( &m_oChoice , oFlags );

  // Set the panel sizer and the min. & init. sizes as calculated by the sizer
  SetSizer( poSzr );
  poSzr->SetSizeHints( this );
}

//**************************************************************************************************
// Create an instance of this object.
//
// Argument List :
//   poWin     - The parent window
//   oWinID    - The window identifier
//   iNameWd   - The width of the name label     in pixels
//   iChoiceWd - The width of the choice control in pixels
//   roPosn    - The position
//
// Return Values :
//   true  - Success
//   false - Failure

bool  PnlLblCho::bCreate( wxWindow * poWin, wxWindowID oWinID, int iNameWd, int iChoiceWd,
                          const wxPoint & roPosn )
{
  if( bIsCreated( ) )                              return( true );

  // Create the base class (wxPanel)
  if( ! wxPanel::Create( poWin, oWinID, roPosn, wxSize( -1, GUI_CTRL_HT ) ) ) return( false );

  // Create the variable name label
  m_oLblName.Create( this, ID_UNUSED, wxT("Unknown"), wxDefaultPosition,
                     wxSize( iNameWd  , GUI_CTRL_HT ), wxALIGN_LEFT );

  // Create the choice control
  m_oChoice .Create( this, ID_CHOICE,                 wxDefaultPosition,
                     wxSize( iChoiceWd, GUI_CTRL_HT ) );

  // Layout the display objects
  DoLayout( );

  return( true );
}

//**************************************************************************************************
//                                         Event Handlers                                          *
//**************************************************************************************************
// Choice control an item on the list is selected event handler.
//
// Argument List :
//   roEvtCmd - An object holding information about the event
/*
void  PnlLblCho::OnChoice( wxCommandEvent & roEvtCmd )
{
}
*/
//**************************************************************************************************