@@ -15,6 +15,7 @@ public partial class Form1 : Form
1515 // UserControl์ ์บ์ฑํด์ ์ํ ์ ์ง
1616 private WhereAmI whereAmIControl ;
1717 private SettingPage settingPageControl ;
18+ private ServerLocation serverLocationControl ;
1819
1920 public Form1 ( )
2021 {
@@ -31,20 +32,24 @@ public Form1()
3132
3233 private void InitializeScreens ( )
3334 {
34- // ํ๋ฉด 2๊ฐ ์์ฑ (๋ฑ 1๋ฒ๋ง)
35+ // ํ๋ฉด 3๊ฐ ์์ฑ (๋ฑ 1๋ฒ๋ง)
3536 whereAmIControl = new WhereAmI ( ) ;
3637 settingPageControl = new SettingPage ( ) ;
38+ serverLocationControl = new ServerLocation ( ) ;
3739
3840 // Panel์ ๋ฏธ๋ฆฌ ์ถ๊ฐ
3941 panel1 . Controls . Add ( whereAmIControl ) ;
4042 panel1 . Controls . Add ( settingPageControl ) ;
43+ panel1 . Controls . Add ( serverLocationControl ) ;
4144
4245 whereAmIControl . Dock = DockStyle . Fill ;
4346 settingPageControl . Dock = DockStyle . Fill ;
47+ serverLocationControl . Dock = DockStyle . Fill ;
4448
4549 // ์์ ํ๋ฉด ์ค์
4650 whereAmIControl . Visible = true ;
4751 settingPageControl . Visible = false ;
52+ serverLocationControl . Visible = false ;
4853 }
4954
5055 const int MAX_SLIDING_WIDTH = 200 ;
@@ -58,6 +63,8 @@ private void checkBoxHide_CheckedChanged(object sender, EventArgs e)
5863 {
5964 btnSetting . Text = "Setting Page" ;
6065 btnSetting . Image = null ;
66+ btnServerLocation . Text = "Server Location" ;
67+ btnServerLocation . Image = null ;
6168 btnWhereAmI . Text = "Where Am I" ;
6269 btnWhereAmI . Image = null ;
6370 checkBoxHide . Text = "<" ;
@@ -66,6 +73,8 @@ private void checkBoxHide_CheckedChanged(object sender, EventArgs e)
6673 {
6774 btnSetting . Text = "" ;
6875 btnSetting . Image = Image . FromFile ( @"assets\images\settings_icon2_resize.png" ) ;
76+ btnServerLocation . Text = "" ;
77+ btnServerLocation . Image = Image . FromFile ( @"assets\images\server.png" ) ;
6978 btnWhereAmI . Text = "" ;
7079 btnWhereAmI . Image = Image . FromFile ( @"assets\images\eft-where-am-i_icon_resize.png" ) ;
7180 checkBoxHide . Text = ">" ;
@@ -160,11 +169,21 @@ private void btnWhereAmI_Click(object sender, EventArgs e)
160169 }
161170 }
162171
172+ private void btnServerLocation_Click ( object sender , EventArgs e )
173+ {
174+ if ( currentScreen != "ServerLocation" )
175+ {
176+ SwitchUserControl ( serverLocationControl ) ;
177+ currentScreen = "ServerLocation" ;
178+ }
179+ }
180+
163181 private void SwitchUserControl ( UserControl control )
164182 {
165183 // ๋ชจ๋ ํ๋ฉด ์จ๊ธฐ๊ธฐ
166184 whereAmIControl . Visible = false ;
167185 settingPageControl . Visible = false ;
186+ serverLocationControl . Visible = false ;
168187
169188 // ์ ํ๋ฉด๋ง ๋ณด์ด๊ธฐ
170189 control . Visible = true ;
0 commit comments