Merge pull request #2212 from unxed/ctrl_yo
[far2l.git] / far2l / src / rdrwdsk.cpp
blob4b38e6248d700fd23105abe95a54597c3f02983c
1 /*
2 rdrwdsk.cpp
4 class RedrawDesktop
5 */
6 /*
7 Copyright (c) 1996 Eugene Roshal
8 Copyright (c) 2000 Far Group
9 All rights reserved.
11 Redistribution and use in source and binary forms, with or without
12 modification, are permitted provided that the following conditions
13 are met:
14 1. Redistributions of source code must retain the above copyright
15 notice, this list of conditions and the following disclaimer.
16 2. Redistributions in binary form must reproduce the above copyright
17 notice, this list of conditions and the following disclaimer in the
18 documentation and/or other materials provided with the distribution.
19 3. The name of the authors may not be used to endorse or promote products
20 derived from this software without specific prior written permission.
22 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
23 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
24 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25 IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
26 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 #include "headers.hpp"
36 #include "manager.hpp"
37 #include "keys.hpp"
38 #include "rdrwdsk.hpp"
39 #include "filepanels.hpp"
40 #include "panel.hpp"
41 #include "cmdline.hpp"
42 #include "ctrlobj.hpp"
43 #include "config.hpp"
45 RedrawDesktop::RedrawDesktop(BOOL IsHidden)
47 LeftVisible(CtrlObject->Cp()->LeftPanel->IsVisible()),
48 RightVisible(CtrlObject->Cp()->RightPanel->IsVisible()),
49 ClockVisible(Opt.Clock != 0)
51 CtrlObject->CmdLine->ShowBackground();
52 CtrlObject->CmdLine->Show();
54 if (IsHidden) {
55 CtrlObject->Cp()->LeftPanel->CloseFile();
56 CtrlObject->Cp()->RightPanel->CloseFile();
58 // ВНИМАНИЕ! КОСТЫЛЬ!
59 // соблюдем очередность, в зависимости от!
60 if (CtrlObject->Cp()->ActivePanel == CtrlObject->Cp()->LeftPanel) {
61 CtrlObject->Cp()->LeftPanel->Hide();
62 CtrlObject->Cp()->RightPanel->Hide();
63 } else {
64 CtrlObject->Cp()->RightPanel->Hide();
65 CtrlObject->Cp()->LeftPanel->Hide();
67 Opt.Clock = FALSE;
68 CtrlObject->MainKeyBar->Hide();
69 CtrlObject->TopMenuBar->Hide();
73 RedrawDesktop::~RedrawDesktop()
75 CtrlObject->CmdLine->SaveBackground();
76 CtrlObject->CmdLine->Show();
78 CtrlObject->MainKeyBar->Refresh(Opt.ShowKeyBar);
80 Opt.Clock = ClockVisible;
82 if (Opt.ShowMenuBar)
83 CtrlObject->TopMenuBar->Show();
85 int RightType = CtrlObject->Cp()->RightPanel->GetType();
87 if (RightVisible && RightType != QVIEW_PANEL)
88 // CtrlObject->Cp()->RightPanel->Show();
89 CtrlObject->Cp()->RightPanel->SetVisible(TRUE);
91 if (LeftVisible)
92 // CtrlObject->Cp()->LeftPanel->Show();
93 CtrlObject->Cp()->LeftPanel->SetVisible(TRUE);
95 if (RightVisible && RightType == QVIEW_PANEL)
96 // CtrlObject->Cp()->RightPanel->Show();
97 CtrlObject->Cp()->RightPanel->SetVisible(TRUE);
99 // Временное решение!
100 // Иначе траблы при пересчете...
101 FrameManager->ProcessKey(KEY_CONSOLE_BUFFER_RESIZE);