3 DUNWindow - DialUp Networking BWindow
5 Authors: Sikosis (phil@sikosis.com)
6 Misza (misza@ihug.com.au)
8 (C) 2002-2004 OpenBeOS under MIT license
11 /*-----WARNING MESSY CODE AHEAD :-)------*/
14 #include "DUNWindow.h"
15 #include "NewConnectionWindow.h"
18 // Add these to Constants file
19 const int DUN_WINDOW_STATE_DEFAULT
= 0; // default - closed
20 const int DUN_WINDOW_STATE_ONE
= 1; // 1st only
21 const int DUN_WINDOW_STATE_TWO
= 2; // 2nd only
22 const int DUN_WINDOW_STATE_THREE
= 3; // both
25 int DUNLastWindowState
;
27 float ModemFormTopDefault
= 150;
28 float ModemFormLeftDefault
= 150;
29 float ModemFormWidthDefault
= 281;
30 float ModemFormHeightDefault
= 324;
31 BRect
windowRectModem(ModemFormTopDefault
,ModemFormLeftDefault
,ModemFormLeftDefault
+ModemFormWidthDefault
,ModemFormTopDefault
+ModemFormHeightDefault
);
33 // DUNWindow -- constructor for DUNWindow Class
34 DUNWindow::DUNWindow(BRect frame
) : BWindow (frame
, "OBOS Dial-up Networking", B_TITLED_WINDOW
,
35 B_NOT_RESIZABLE
|B_NOT_ZOOMABLE
, 0)
40 // ------------------------------------------------------------------------------- //
43 // DUNWindow::InitWindow -- Initialization Commands here
44 void DUNWindow::InitWindow() {
46 //SetStatus(0,0);//none active at beginning
50 // Add the Drawing View
51 aDUNview
= new DUNView(r
);
52 aDUNview
->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR
));
57 float ButtonTop
= 217;
58 float ButtonWidth
= 24;
60 BRect
btn1(10,ButtonTop
,83,ButtonTop
+ButtonWidth
);
61 modembutton
= new BButton(btn1
,"Modem","Modem" B_UTF8_ELLIPSIS
, new BMessage(BTN_MODEM
), B_FOLLOW_BOTTOM
, B_WILL_DRAW
| B_NAVIGABLE
);
62 BRect
btn2(143,ButtonTop
,218,ButtonTop
+ButtonWidth
);
63 disconnectbutton
= new BButton(btn2
,"Disconnect","Disconnect", new BMessage(BTN_DISCONNECT
), B_FOLLOW_BOTTOM
, B_WILL_DRAW
| B_NAVIGABLE
);
64 BRect
btn3(230,ButtonTop
,302,ButtonTop
+ButtonWidth
);
65 connectbutton
= new BButton(btn3
,"Connect","Connect", new BMessage(BTN_CONNECT
), B_FOLLOW_BOTTOM
, B_WILL_DRAW
| B_NAVIGABLE
);
67 connectbutton
->MakeDefault(true);
68 disconnectbutton
->SetEnabled(false);
70 aDUNview
->AddChild(modembutton
);
71 aDUNview
->AddChild(disconnectbutton
);
72 aDUNview
->AddChild(connectbutton
);
74 // Connection MenuField
75 BRect
mfld1(17,8,175,31);
76 BMenuItem
*menuconnew
;
77 BMenuItem
*menucondelete
;
79 top_frame_label
= new BView(mfld1
,"top_frame_label",B_FOLLOW_NONE
,B_WILL_DRAW
|B_NAVIGABLE
);
80 top_frame_label
->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR
));
82 conmenufield
= new BMenu("Click to add");
83 //conmenufield = new BPopUpMenu("Click to add");
84 conmenufield
->AddSeparatorItem();
85 conmenufield
->AddItem(menuconnew
= new BMenuItem("New" B_UTF8_ELLIPSIS
, new BMessage(MENU_CON_NEW
)));
86 //menuconnew->SetTarget(be_app);
87 conmenufield
->AddItem(menucondelete
= new BMenuItem("Delete Current", new BMessage(MENU_CON_DELETE_CURRENT
)));
88 menucondelete
->SetEnabled(false);
89 //menucondelete->SetTarget(be_app);
91 connectionmenufield
= new BMenuField(top_frame_label
->Bounds(),"connection_menu","Connect to:",conmenufield
,B_FOLLOW_LEFT
| B_FOLLOW_TOP
, B_WILL_DRAW
| B_NAVIGABLE
);
92 connectionmenufield
->SetDivider(77);
93 connectionmenufield
->SetFont(be_bold_font
);
94 connectionmenufield
->SetLowColor(ui_color(B_PANEL_BACKGROUND_COLOR
));
97 BRect
mfld2(17,75,205,99);//60 for small
98 BRect middle_rect_drp
= mfld2
;
100 BMenuItem
*menulochome
;
101 BMenuItem
*menulocwork
;
102 BMenuItem
*menulocnew
;
103 BMenuItem
*menulocdelete
;
105 middle_frame_label
= new BView(middle_rect_drp
,"middle_frame_label",B_FOLLOW_NONE
,B_WILL_DRAW
|B_NAVIGABLE
);
106 middle_frame_label
->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR
));
108 locmenufield
= new BPopUpMenu("Home ");
109 locmenufield
->AddItem(menulochome
= new BMenuItem("Home", new BMessage(MENU_LOC_HOME
)));
110 //menulochome->SetTarget(be_app);
111 menulochome
->SetMarked(true);
113 locmenufield
->AddItem(menulocwork
= new BMenuItem("Work", new BMessage(MENU_LOC_WORK
)));
114 //menulocwork->SetTarget(be_app);
115 locmenufield
->AddSeparatorItem();
117 locmenufield
->AddItem(menulocnew
= new BMenuItem("New" B_UTF8_ELLIPSIS
, new BMessage(MENU_LOC_NEW
)));
118 //menulocnew->SetTarget(be_app);
120 locmenufield
->AddItem(menulocdelete
= new BMenuItem("Delete Current", new BMessage(MENU_LOC_DELETE_CURRENT
)));
121 //menulocdelete->SetTarget(be_app);
123 locationmenufield
= new BMenuField(middle_frame_label
->Bounds(),"location_menu","From location:",locmenufield
,B_FOLLOW_LEFT
| B_FOLLOW_TOP
, B_WILL_DRAW
| B_NAVIGABLE
);
124 locationmenufield
->SetDivider(92);
125 locationmenufield
->SetFont(be_bold_font
);
126 locationmenufield
->SetLowColor(ui_color(B_PANEL_BACKGROUND_COLOR
));
129 BRect
tf(10,8,302,67);
130 topframe
= new BBox(tf
,"Connect to:",B_FOLLOW_NONE
| B_WILL_DRAW
| B_NAVIGABLE_JUMP
, B_FANCY_BORDER
);
131 topframe
->SetLabel(top_frame_label
);
132 top_frame_label
->AddChild(connectionmenufield
);
134 passmeon
= new BStringView(BRect(24,31,284,49),"tvConnectionProfile", "<Create a connection profile to continue.>");
135 passmeon
->SetViewColor(255,0,0);
138 passmeon2
= new DetailsView();
140 //***********INTEGRAL TO GETTING SET STATE READY
142 topframe
->AddChild(passmeon2
);
143 topframe
->AddChild(passmeon
);
146 BRect THESPOT
= BRect(10,37,19,45);
148 trvconnect
= new TreeView(THESPOT
);
149 trvconnect
->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR
));
150 topframe
->AddChild(trvconnect
);
152 aDUNview
->AddChild(topframe
);
155 BRect
mf(10,76,302,139);
156 middleframe
= new BBox(mf
,"From Location:",B_FOLLOW_NONE
| B_WILL_DRAW
| B_NAVIGABLE_JUMP
, B_FANCY_BORDER
);
158 middleframe
->SetLabel(middle_frame_label
);
159 middle_frame_label
->AddChild(locationmenufield
);
161 passmeon4
= new BStringView(BRect(25,31+4,284,49+4),"tvCallWaiting","Call waiting may be enabled.");
162 passmeon3
= new LocationView();
163 //***********INTEGRAL TO GETTING SET STATE READY
166 middleframe
->AddChild(passmeon3
);
167 middleframe
->AddChild(passmeon4
);
169 BRect THESPOT2
= BRect(10,37+4,19,45+4);
170 trvlocation
= new TreeView(THESPOT2
);
171 trvlocation
->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR
));
173 middleframe
->AddChild(trvlocation
);
174 aDUNview
->AddChild(middleframe
);
177 BRect
bf(10,149,302,208);
178 bottomframe
= new BBox(bf
,"Connection",B_FOLLOW_BOTTOM
| B_WILL_DRAW
| B_NAVIGABLE_JUMP
, B_FANCY_BORDER
);
179 bottomframe
->SetLabel("Connection");
181 // Displays - No Connection
182 BRect
NCLocation(10,18,80,30);
183 svNoConnect
= new BStringView(NCLocation
,"svNoConnect","No Connection");
185 // Displays - Text Label of Local IP address
186 BRect
LocalIPAddressLocation(NCLocation
.left
,35,100,47);
187 svLocalIPAddress
= new BStringView(LocalIPAddressLocation
,"svLocalIPAddress","Local IP address:");
189 // Display - Time Online ie. 00:00:00
190 BRect
TOLocation(238,NCLocation
.top
,288,NCLocation
.bottom
);
191 svTimeOnline
= new BStringView(TOLocation
,"svTimeOnline","00:00:00");
193 // Display - Local IP address ie. None -- might find some code to get the current ip address and
194 // put that in here instead ... hrmmm ;)
195 BRect
LIPLocation (253,LocalIPAddressLocation
.top
,283,LocalIPAddressLocation
.bottom
);
196 svLIP
= new BStringView(LIPLocation
,"svLIP","None");
198 // Add to Bottom Frame
199 bottomframe
->AddChild(svNoConnect
);
200 bottomframe
->AddChild(svLocalIPAddress
);
201 bottomframe
->AddChild(svTimeOnline
);
202 bottomframe
->AddChild(svLIP
);
204 aDUNview
->AddChild(bottomframe
);
206 // Load User Settings
208 find_directory(B_USER_SETTINGS_DIRECTORY
,&path
);
209 path
.Append("DUN/OBOS_DUN_settings",true);
210 BFile
file(path
.Path(),B_READ_ONLY
);
212 msg
.Unflatten(&file
);
215 // ------------------------------------------------------------------------------- //
218 // DUNWindow::~DUNWindow -- destructor
219 DUNWindow::~DUNWindow()
223 // ------------------------------------------------------------------------------- //
226 void DUNWindow::DUNResizeHandler()
227 { //post: window has been set to last state :-)
228 switch (DUNWindowState
)
230 case DUN_WINDOW_STATE_DEFAULT
:
233 trvconnect
->SetTreeViewStatus(false);
234 trvlocation
->SetTreeViewStatus(false);
241 case DUN_WINDOW_STATE_ONE
:
245 trvconnect
->SetTreeViewStatus(true);
246 trvlocation
->SetTreeViewStatus(false);
250 case DUN_WINDOW_STATE_TWO
:
254 trvconnect
->SetTreeViewStatus(false);
255 trvlocation
->SetTreeViewStatus(true);
258 case DUN_WINDOW_STATE_THREE
:
262 trvconnect
->SetTreeViewStatus(true);
263 trvlocation
->SetTreeViewStatus(true);
268 //------------------------------------------------------//
271 // DUNWindow::LoadSettings -- Loads your current DUN settings
272 void DUNWindow::LoadSettings(BMessage
*msg
)
275 int16 LoadedWindowState
;
276 int16 LoadedLastWindowState
;
278 // Load and Set Window Position and Size
279 if (B_OK
== msg
->FindRect("windowframe",&frame
))
281 MoveTo(frame
.left
,frame
.top
);
282 ResizeTo(frame
.right
-frame
.left
,frame
.bottom
-frame
.top
);
285 // Load LastWindowState (to prevent cumulative resizing)
286 if (B_OK
== msg
->FindInt16("lastwindowstate",&LoadedLastWindowState
))
288 DUNLastWindowState
= LoadedLastWindowState
;
289 //cout << "From Settings: " << DUNLastWindowState << endl;
291 DUNLastWindowState
= DUN_WINDOW_STATE_DEFAULT
;
294 // Load and Set WindowState
295 if (B_OK
== msg
->FindInt16("windowstate",&LoadedWindowState
)) {
296 DUNWindowState
= LoadedWindowState
;
297 //cout << "From Settings: " << DUNWindowState << endl;
300 DUNWindowState
= DUN_WINDOW_STATE_DEFAULT
;//setup window state as def
304 // ------------------------------------------------------------------------------- //
306 // DUNWindow::SaveSettings -- Saves the Users DUN settings
307 void DUNWindow::SaveSettings()
311 // Current Window Position
312 msg
.AddRect("windowframe",Frame());
314 // Current WindowState
315 msg
.AddInt16("windowstate",DUNWindowState
);
316 DUNLastWindowState
= DUNWindowState
;
318 msg
.AddInt16("lastwindowstate",DUNLastWindowState
);
320 // Current Connection - doesnt work :(
321 msg
.AddString("currentconnection","");
323 // Current Location - doesnt work :(
324 msg
.AddString("currentlocation","");
329 status_t result
= find_directory(B_USER_SETTINGS_DIRECTORY
,&path
);
332 path
.Append("DUN/OBOS_DUN_settings",true);
333 BFile
file(path
.Path(),B_READ_WRITE
| B_CREATE_FILE
| B_ERASE_FILE
);
337 // ------------------------------------------------------------------------------- //
340 // DUNWindow::QuitRequested -- Post a message to the app to quit
341 bool DUNWindow::QuitRequested() {
343 be_app
->PostMessage(B_QUIT_REQUESTED
);
346 // ------------------------------------------------------------------------------- //
349 // DUNWindow::MessageReceived -- receives messages
350 void DUNWindow::MessageReceived (BMessage
*message
)
352 switch(message
->what
)
356 disconnectbutton
->SetEnabled(true);
357 connectbutton
->SetEnabled(false);
359 BAlert
*errormsg
= new BAlert("errormsg", "The hidden wispy bush\nOver the green flower\nThe sea and connection have stopped.", " Haiku Error ;) " , NULL
, NULL
, B_WIDTH_FROM_WIDEST
, B_IDEA_ALERT
);
360 errormsg
->SetFlags(errormsg
->Flags() | B_CLOSE_ON_ESCAPE
);
367 disconnectbutton
->SetEnabled(false);
368 connectbutton
->SetEnabled(true);
369 BAlert
*errormsg
= new BAlert("errormsg", "A late long rain\nOver an icy meadow\nBroken connection and dreams.", " Haiku Error ;) ", NULL
, NULL
, B_WIDTH_FROM_WIDEST
, B_IDEA_ALERT
);
370 errormsg
->SetFlags(errormsg
->Flags() | B_CLOSE_ON_ESCAPE
);
375 case MENU_LOC_DELETE_CURRENT
:
378 BAlert
*errormsg
= new BAlert("errormsg", "Hark! Something is wrong.\nFor this is not what I asked.\n\nMy life is somewhat ... Incomplete.\n", " Haiku Error ;) " , NULL
, NULL
, B_WIDTH_FROM_WIDEST
, B_IDEA_ALERT
);
379 errormsg
->SetFlags(errormsg
->Flags() | B_CLOSE_ON_ESCAPE
);
387 BAlert
*errormsg
= new BAlert("errormsg", "Lost Clouds.\nDisappear behind the mountains.\n\nFor an eternity must I wait ?\n", " Haiku Error ;) " , NULL
, NULL
, B_WIDTH_FROM_WIDEST
, B_IDEA_ALERT
);
388 errormsg
->SetFlags(errormsg
->Flags() | B_CLOSE_ON_ESCAPE
);
395 // Set the Text for the Work Profile
396 passmeon4
->SetText("Call waiting maybe enabled.");
402 // Set the Text for the Work Profile
403 passmeon4
->SetText("Using dial out prefix of '9,'.");
409 // open new connection window
410 ptrNewConnectionWindow
= new NewConnectionWindow(BRect(0,0,260,73));
417 modemWindow
= new ModemWindow(windowRectModem
);
423 // open settings window
424 settingsWindow
= new SettingsWindow(BRect(367.0, 268.0, 657.0, 500.0));
428 case ADD_NEW_CONNECTION
:
430 // add and set our new connection
431 BString fConnectionName
;
432 message
->FindString("ConnectionName", &fConnectionName
);
433 printf("ConnectionName = %s\n",fConnectionName
.String());
435 // set as current item with tick
440 BWindow::MessageReceived(message
);
445 // ------------------------------------------------------------------------------- //
448 // DUNWindow::InvalidateAll
449 void DUNWindow::InvalidateAll()
450 { //redraws the top and middle BBoxen, so that DoResizeMagic()
451 //(InvalidateAll() is called by DoResizeMagic()) works smoothly :D
452 topframe
->Invalidate();
453 middleframe
->Invalidate();
455 // ------------------------------------------------------------------------------- //
458 // DUNWindow::DoResizeMagic -- this magical function handles the resizing of the main window,
459 // NOTE: it is quite messy & confusing only the brave may try to understand this code
460 void DUNWindow::DoResizeMagic()
462 if(trvconnect
->TreeViewStatus() == 1 && trvlocation
->TreeViewStatus() == 1)
464 if(last
.x
== 1 && last
.y
== 0)
467 topframe
->SetResizingMode(B_FOLLOW_TOP
);
468 middleframe
->SetResizingMode(B_FOLLOW_TOP_BOTTOM
);
469 middle_frame_label
->SetResizingMode(B_FOLLOW_TOP
);
471 if(!(passmeon
->IsHidden())) passmeon
->Hide();
472 if(!(passmeon4
->IsHidden()))passmeon4
->Hide();
473 if((passmeon2
->IsHidden()))passmeon2
->Show();
474 if((passmeon3
->IsHidden()))passmeon3
->Show();
476 passmeon
->SetResizingMode(B_FOLLOW_TOP
);
477 passmeon4
->SetResizingMode(B_FOLLOW_TOP
);
478 passmeon2
->SetResizingMode(B_FOLLOW_TOP
);
479 passmeon3
->SetResizingMode(B_FOLLOW_TOP
);
484 if(last
.x
== 0 && last
.y
== 1)
487 topframe
->SetResizingMode(B_FOLLOW_TOP_BOTTOM
);
488 middleframe
->SetResizingMode(B_FOLLOW_BOTTOM
);
489 middle_frame_label
->SetResizingMode(B_FOLLOW_BOTTOM
);
491 if(!(passmeon
->IsHidden())) passmeon
->Hide();
492 if(!(passmeon4
->IsHidden()))passmeon4
->Hide();
493 if((passmeon2
->IsHidden()))passmeon2
->Show();
494 if((passmeon3
->IsHidden()))passmeon3
->Show();
496 passmeon
->SetResizingMode(B_FOLLOW_TOP
);
497 passmeon4
->SetResizingMode(B_FOLLOW_TOP
);
498 passmeon2
->SetResizingMode(B_FOLLOW_TOP
);
499 passmeon3
->SetResizingMode(B_FOLLOW_TOP
);
503 if(last
.x
== 0 && last
.y
== 0)
504 { //if loading from settings 3
507 topframe
->SetResizingMode(B_FOLLOW_TOP
);
508 middleframe
->SetResizingMode(B_FOLLOW_TOP_BOTTOM
);
509 middle_frame_label
->SetResizingMode(B_FOLLOW_TOP
);
512 passmeon
->SetResizingMode(B_FOLLOW_TOP
);
513 passmeon4
->SetResizingMode(B_FOLLOW_TOP
);
514 passmeon2
->SetResizingMode(B_FOLLOW_TOP
);
515 passmeon3
->SetResizingMode(B_FOLLOW_TOP
);
519 topframe
->SetResizingMode(B_FOLLOW_TOP_BOTTOM
);
520 middleframe
->SetResizingMode(B_FOLLOW_BOTTOM
);
521 middle_frame_label
->SetResizingMode(B_FOLLOW_BOTTOM
);
523 passmeon
->SetResizingMode(B_FOLLOW_TOP
);
524 passmeon4
->SetResizingMode(B_FOLLOW_TOP
);
525 passmeon2
->SetResizingMode(B_FOLLOW_TOP
);
526 passmeon3
->SetResizingMode(B_FOLLOW_TOP
);
531 DUNLastWindowState
= 4;//so we don't keep doing this :P
533 DUNWindowState
= DUN_WINDOW_STATE_THREE
;
538 else if(trvconnect
->TreeViewStatus() == 0 && trvlocation
->TreeViewStatus() == 0)
541 if(last
.x
== 1 && last
.y
== 0)
545 topframe
->SetResizingMode(B_FOLLOW_TOP_BOTTOM
);
546 middleframe
->SetResizingMode(B_FOLLOW_BOTTOM
);
547 middle_frame_label
->SetResizingMode(B_FOLLOW_BOTTOM
);
549 if(!(passmeon3
->IsHidden())) passmeon3
->Hide();
550 if(!(passmeon2
->IsHidden())) passmeon2
->Hide();
551 if((passmeon
->IsHidden()))passmeon
->Show();
552 if((passmeon4
->IsHidden()))passmeon4
->Show();
554 passmeon
->SetResizingMode(B_FOLLOW_TOP
);
555 passmeon4
->SetResizingMode(B_FOLLOW_TOP
);
556 passmeon2
->SetResizingMode(B_FOLLOW_TOP
);
557 passmeon3
->SetResizingMode(B_FOLLOW_TOP
);
562 if(last
.x
== 0 && last
.y
== 1)
565 topframe
->SetResizingMode(B_FOLLOW_TOP
);
566 middleframe
->SetResizingMode(B_FOLLOW_TOP_BOTTOM
);
567 middle_frame_label
->SetResizingMode(B_FOLLOW_TOP
);
569 if(!(passmeon3
->IsHidden()))passmeon3
->Hide();
570 if(!(passmeon2
->IsHidden()))passmeon2
->Hide();
571 if((passmeon
->IsHidden()))passmeon
->Show();
572 if((passmeon4
->IsHidden()))passmeon4
->Show();
574 passmeon
->SetResizingMode(B_FOLLOW_TOP
);
575 passmeon4
->SetResizingMode(B_FOLLOW_TOP
);
576 passmeon2
->SetResizingMode(B_FOLLOW_TOP
);
577 passmeon3
->SetResizingMode(B_FOLLOW_TOP
);
582 DUNWindowState
= DUN_WINDOW_STATE_DEFAULT
;
587 else if(trvconnect
->TreeViewStatus() == 1 && trvlocation
->TreeViewStatus() == 0)
589 if(last
.x
== 0 && last
.y
== 0)
592 topframe
->SetResizingMode(B_FOLLOW_TOP_BOTTOM
);
593 middleframe
->SetResizingMode(B_FOLLOW_BOTTOM
);
594 middle_frame_label
->SetResizingMode(B_FOLLOW_BOTTOM
);
596 if(DUNLastWindowState
== DUN_WINDOW_STATE_ONE
)
600 DUNLastWindowState
= 4;//so we don't keep doing this :P
604 if(!(passmeon
->IsHidden())) passmeon
->Hide();
605 if(!(passmeon3
->IsHidden()))passmeon3
->Hide();
606 if((passmeon2
->IsHidden()))passmeon2
->Show();
607 if((passmeon4
->IsHidden()))passmeon4
->Show();
609 passmeon
->SetResizingMode(B_FOLLOW_TOP
);
610 passmeon4
->SetResizingMode(B_FOLLOW_TOP
);
611 passmeon2
->SetResizingMode(B_FOLLOW_TOP
);
612 passmeon3
->SetResizingMode(B_FOLLOW_TOP
);
617 if(last
.x
== 1 && last
.y
== 1)
620 topframe
->SetResizingMode(B_FOLLOW_TOP
);
621 middleframe
->SetResizingMode(B_FOLLOW_TOP_BOTTOM
);
622 middle_frame_label
->SetResizingMode(B_FOLLOW_TOP
);
624 if(!(passmeon
->IsHidden())) passmeon
->Hide();
625 if(!(passmeon3
->IsHidden()))passmeon3
->Hide();
626 if((passmeon2
->IsHidden()))passmeon2
->Show();
627 if((passmeon4
->IsHidden()))passmeon4
->Show();
629 passmeon
->SetResizingMode(B_FOLLOW_TOP
);
630 passmeon4
->SetResizingMode(B_FOLLOW_TOP
);
631 passmeon2
->SetResizingMode(B_FOLLOW_TOP
);
632 passmeon3
->SetResizingMode(B_FOLLOW_TOP
);
638 DUNWindowState
= DUN_WINDOW_STATE_ONE
;
642 else if(trvconnect
->TreeViewStatus() == 0 && trvlocation
->TreeViewStatus() == 1)
645 if(last
.x
== 0 && last
.y
== 0)
648 topframe
->SetResizingMode(B_FOLLOW_TOP
);
649 middleframe
->SetResizingMode(B_FOLLOW_TOP_BOTTOM
);
650 middle_frame_label
->SetResizingMode(B_FOLLOW_TOP
);
652 if(DUNLastWindowState
== DUN_WINDOW_STATE_TWO
)
656 DUNLastWindowState
= 4;//so we don't keep doing this :P
660 if(!(passmeon4
->IsHidden())) passmeon4
->Hide();
661 if(!(passmeon2
->IsHidden()))passmeon2
->Hide();
662 if((passmeon3
->IsHidden()))passmeon3
->Show();
663 if((passmeon
->IsHidden()))passmeon
->Show();
666 passmeon
->SetResizingMode(B_FOLLOW_TOP
);
667 passmeon4
->SetResizingMode(B_FOLLOW_TOP
);
668 passmeon2
->SetResizingMode(B_FOLLOW_TOP
);
669 passmeon3
->SetResizingMode(B_FOLLOW_TOP
);
674 if(last
.x
== 1 && last
.y
== 1)
677 topframe
->SetResizingMode(B_FOLLOW_TOP_BOTTOM
);
678 middleframe
->SetResizingMode(B_FOLLOW_BOTTOM
);
679 middle_frame_label
->SetResizingMode(B_FOLLOW_BOTTOM
);
681 if(!(passmeon4
->IsHidden()))passmeon4
->Hide();
682 if(!(passmeon2
->IsHidden()))passmeon2
->Hide();
683 if((passmeon3
->IsHidden()))passmeon3
->Show();
684 if((passmeon
->IsHidden()))passmeon
->Show();
685 passmeon
->SetResizingMode(B_FOLLOW_TOP
);
686 passmeon4
->SetResizingMode(B_FOLLOW_TOP
);
687 passmeon2
->SetResizingMode(B_FOLLOW_TOP
);
688 passmeon3
->SetResizingMode(B_FOLLOW_TOP
);
694 DUNWindowState
= DUN_WINDOW_STATE_TWO
;
699 // ------------------------------------------------------------------------------- //
700 // DUNWindow::SetStatus -- Integral to how DoResizeMagic Works! :-)
701 void DUNWindow::SetStatus(int m
,int n
)
706 // ------------------------------------------------------------------------------- //