__int64 FilePanels::VMProcess(int OpCode,void *vParam,__int64 iParam) { if (OpCode == MCODE_F_KEYBAR_SHOW) { int PrevMode=Opt.ShowKeyBar?2:1; switch (iParam) { case 0: break; case 1: Opt.ShowKeyBar=1; MainKeyBar.Show(); KeyBarVisible = Opt.ShowKeyBar; SetScreenPosition(); FrameManager->RefreshFrame(); break; case 2: Opt.ShowKeyBar=0; MainKeyBar.Hide(); KeyBarVisible = Opt.ShowKeyBar; SetScreenPosition(); FrameManager->RefreshFrame(); break; case 3: ProcessKey(KEY_CTRLB); break; default: PrevMode=0; break; } return PrevMode; } return ActivePanel->VMProcess(OpCode,vParam,iParam); }
void FilePanels::ResizeConsole() { Frame::ResizeConsole(); CtrlObject->CmdLine->ResizeConsole(); MainKeyBar.ResizeConsole(); TopMenuBar.ResizeConsole(); SetScreenPosition(); _OT(SysLog(L"[%p] FilePanels::ResizeConsole() {%d, %d - %d, %d}", this,X1,Y1,X2,Y2)); }
void UVaQuoleHUDComponent::InitializeComponent() { Super::InitializeComponent(); SetScreenPosition(0.f, 0.f); SetScreenSize(Width, Height); // Register page with Viewport Client to receive input if (GEngine && GEngine->GameViewport) { UVaQuoleUIViewportClient* ViewportClient = Cast<UVaQuoleUIViewportClient>(GEngine->GameViewport); if (ViewportClient) { ViewportClient->RegisterHudUI(this); } } }
int FilePanels::ChangePanelViewMode(Panel *Current,int Mode,BOOL RefreshFrame) { if (Current && Mode >= VIEW_0 && Mode <= VIEW_9) { Current->SetViewMode(Mode); Current=ChangePanelToFilled(Current,FILE_PANEL); Current->SetViewMode(Mode); // ВНИМАНИЕ! Костыль! Но Работает! SetScreenPosition(); if (RefreshFrame) FrameManager->RefreshFrame(); return TRUE; } return FALSE; }
int FilePanels::SwapPanels() { int Ret=FALSE; // это значит ни одна из панелей не видна if (LeftPanel->IsVisible() || RightPanel->IsVisible()) { int XL1,YL1,XL2,YL2; int XR1,YR1,XR2,YR2; LeftPanel->GetPosition(XL1,YL1,XL2,YL2); RightPanel->GetPosition(XR1,YR1,XR2,YR2); if (!LeftPanel->IsFullScreen() || !RightPanel->IsFullScreen()) { Opt.WidthDecrement=-Opt.WidthDecrement; Opt.LeftHeightDecrement^=Opt.RightHeightDecrement; Opt.RightHeightDecrement=Opt.LeftHeightDecrement^Opt.RightHeightDecrement; Opt.LeftHeightDecrement^=Opt.RightHeightDecrement; } Panel *Swap; int SwapType; Swap=LeftPanel; LeftPanel=RightPanel; RightPanel=Swap; Swap=LastLeftFilePanel; LastLeftFilePanel=LastRightFilePanel; LastRightFilePanel=Swap; SwapType=LastLeftType; LastLeftType=LastRightType; LastRightType=SwapType; FileFilter::SwapFilter(); Ret=TRUE; } SetScreenPosition(); FrameManager->RefreshFrame(); return Ret; }
int FilePanels::ProcessKey(int Key) { if (!Key) return TRUE; if ((Key==KEY_CTRLLEFT || Key==KEY_CTRLRIGHT || Key==KEY_CTRLNUMPAD4 || Key==KEY_CTRLNUMPAD6 || Key==KEY_RCTRLLEFT || Key==KEY_RCTRLRIGHT || Key==KEY_RCTRLNUMPAD4 || Key==KEY_RCTRLNUMPAD6 /* || Key==KEY_CTRLUP || Key==KEY_CTRLDOWN || Key==KEY_CTRLNUMPAD8 || Key==KEY_CTRLNUMPAD2 */) && (CtrlObject->CmdLine->GetLength()>0 || (!LeftPanel->IsVisible() && !RightPanel->IsVisible()))) { CtrlObject->CmdLine->ProcessKey(Key); return TRUE; } switch (Key) { case KEY_F1: { if (!ActivePanel->ProcessKey(KEY_F1)) { Help Hlp(L"Contents"); } return TRUE; } case KEY_TAB: { SetAnhoterPanelFocus(); break; } case KEY_CTRLF1: case KEY_RCTRLF1: { if (LeftPanel->IsVisible()) { LeftPanel->Hide(); if (RightPanel->IsVisible()) RightPanel->SetFocus(); } else { if (!RightPanel->IsVisible()) LeftPanel->SetFocus(); LeftPanel->Show(); } Redraw(); break; } case KEY_CTRLF2: case KEY_RCTRLF2: { if (RightPanel->IsVisible()) { RightPanel->Hide(); if (LeftPanel->IsVisible()) LeftPanel->SetFocus(); } else { if (!LeftPanel->IsVisible()) RightPanel->SetFocus(); RightPanel->Show(); } Redraw(); break; } case KEY_CTRLB: case KEY_RCTRLB: { Opt.ShowKeyBar=!Opt.ShowKeyBar; KeyBarVisible = Opt.ShowKeyBar; if (!KeyBarVisible) MainKeyBar.Hide(); SetScreenPosition(); FrameManager->RefreshFrame(); break; } case KEY_CTRLL: case KEY_RCTRLL: case KEY_CTRLQ: case KEY_RCTRLQ: case KEY_CTRLT: case KEY_RCTRLT: { if (ActivePanel->IsVisible()) { Panel *AnotherPanel=GetAnotherPanel(ActivePanel); int NewType; if (Key==KEY_CTRLL || Key==KEY_RCTRLL) NewType=INFO_PANEL; else if (Key==KEY_CTRLQ || Key==KEY_RCTRLQ) NewType=QVIEW_PANEL; else NewType=TREE_PANEL; if (ActivePanel->GetType()==NewType) AnotherPanel=ActivePanel; if (!AnotherPanel->ProcessPluginEvent(FE_CLOSE,nullptr)) { if (AnotherPanel->GetType()==NewType) /* $ 19.09.2000 IS Повторное нажатие на ctrl-l|q|t всегда включает файловую панель */ AnotherPanel=ChangePanel(AnotherPanel,FILE_PANEL,FALSE,FALSE); else AnotherPanel=ChangePanel(AnotherPanel,NewType,FALSE,FALSE); /* $ 07.09.2001 VVM ! При возврате из CTRL+Q, CTRL+L восстановим каталог, если активная панель - дерево. */ if (ActivePanel->GetType() == TREE_PANEL) { string strCurDir; ActivePanel->GetCurDir(strCurDir); AnotherPanel->SetCurDir(strCurDir, TRUE); AnotherPanel->Update(0); } else AnotherPanel->Update(UPDATE_KEEP_SELECTION); AnotherPanel->Show(); } ActivePanel->SetFocus(); } break; } case KEY_CTRLO: case KEY_RCTRLO: { { int LeftVisible=LeftPanel->IsVisible(); int RightVisible=RightPanel->IsVisible(); int HideState=!LeftVisible && !RightVisible; if (!HideState) { LeftStateBeforeHide=LeftVisible; RightStateBeforeHide=RightVisible; LeftPanel->Hide(); RightPanel->Hide(); FrameManager->RefreshFrame(); } else { if (!LeftStateBeforeHide && !RightStateBeforeHide) LeftStateBeforeHide=RightStateBeforeHide=TRUE; if (LeftStateBeforeHide) LeftPanel->Show(); if (RightStateBeforeHide) RightPanel->Show(); if (!ActivePanel->IsVisible()) { if (ActivePanel == RightPanel) LeftPanel->SetFocus(); else RightPanel->SetFocus(); } } } break; } case KEY_CTRLP: case KEY_RCTRLP: { if (ActivePanel->IsVisible()) { Panel *AnotherPanel=GetAnotherPanel(ActivePanel); if (AnotherPanel->IsVisible()) AnotherPanel->Hide(); else AnotherPanel->Show(); CtrlObject->CmdLine->Redraw(); } FrameManager->RefreshFrame(); break; } case KEY_CTRLI: case KEY_RCTRLI: { ActivePanel->EditFilter(); return TRUE; } case KEY_CTRLU: case KEY_RCTRLU: { if (!LeftPanel->IsVisible() && !RightPanel->IsVisible()) CtrlObject->CmdLine->ProcessKey(Key); else SwapPanels(); break; } /* $ 08.04.2002 IS При смене диска установим принудительно текущий каталог на активной панели, т.к. система не знает ничего о том, что у Фара две панели, и текущим для системы после смены диска может быть каталог и на пассивной панели */ case KEY_ALTF1: case KEY_RALTF1: { LeftPanel->ChangeDisk(); if (ActivePanel!=LeftPanel) ActivePanel->SetCurPath(); break; } case KEY_ALTF2: case KEY_RALTF2: { RightPanel->ChangeDisk(); if (ActivePanel!=RightPanel) ActivePanel->SetCurPath(); break; } case KEY_ALTF7: case KEY_RALTF7: { { FindFiles FindFiles; } break; } case KEY_CTRLUP: case KEY_CTRLNUMPAD8: case KEY_RCTRLUP: case KEY_RCTRLNUMPAD8: { bool Set=false; if (Opt.LeftHeightDecrement<ScrY-7) { Opt.LeftHeightDecrement++; Set=true; } if (Opt.RightHeightDecrement<ScrY-7) { Opt.RightHeightDecrement++; Set=true; } if(Set) { SetScreenPosition(); FrameManager->RefreshFrame(); } break; } case KEY_CTRLDOWN: case KEY_CTRLNUMPAD2: case KEY_RCTRLDOWN: case KEY_RCTRLNUMPAD2: { bool Set=false; if (Opt.LeftHeightDecrement>0) { Opt.LeftHeightDecrement--; Set=true; } if (Opt.RightHeightDecrement>0) { Opt.RightHeightDecrement--; Set=true; } if(Set) { SetScreenPosition(); FrameManager->RefreshFrame(); } break; } case KEY_CTRLSHIFTUP: case KEY_CTRLSHIFTNUMPAD8: case KEY_RCTRLSHIFTUP: case KEY_RCTRLSHIFTNUMPAD8: { IntOption& HeightDecrement=(ActivePanel==LeftPanel)?Opt.LeftHeightDecrement:Opt.RightHeightDecrement; if (HeightDecrement<ScrY-7) { HeightDecrement++; SetScreenPosition(); FrameManager->RefreshFrame(); } break; } case KEY_CTRLSHIFTDOWN: case KEY_CTRLSHIFTNUMPAD2: case KEY_RCTRLSHIFTDOWN: case KEY_RCTRLSHIFTNUMPAD2: { IntOption& HeightDecrement=(ActivePanel==LeftPanel)?Opt.LeftHeightDecrement:Opt.RightHeightDecrement; if (HeightDecrement>0) { HeightDecrement--; SetScreenPosition(); FrameManager->RefreshFrame(); } break; } case KEY_CTRLLEFT: case KEY_CTRLNUMPAD4: case KEY_RCTRLLEFT: case KEY_RCTRLNUMPAD4: { if (Opt.WidthDecrement<ScrX/2-10) { Opt.WidthDecrement++; SetScreenPosition(); FrameManager->RefreshFrame(); } break; } case KEY_CTRLRIGHT: case KEY_CTRLNUMPAD6: case KEY_RCTRLRIGHT: case KEY_RCTRLNUMPAD6: { if (Opt.WidthDecrement>-(ScrX/2-10)) { Opt.WidthDecrement--; SetScreenPosition(); FrameManager->RefreshFrame(); } break; } case KEY_CTRLCLEAR: case KEY_RCTRLCLEAR: { if (Opt.WidthDecrement) { Opt.WidthDecrement=0; SetScreenPosition(); FrameManager->RefreshFrame(); } break; } case KEY_CTRLALTCLEAR: case KEY_RCTRLRALTCLEAR: case KEY_CTRLRALTCLEAR: case KEY_RCTRLALTCLEAR: { bool Set=false; if (Opt.LeftHeightDecrement) { Opt.LeftHeightDecrement=0; Set=true; } if (Opt.RightHeightDecrement) { Opt.RightHeightDecrement=0; Set=true; } if(Set) { SetScreenPosition(); FrameManager->RefreshFrame(); } break; } case KEY_F9: { ShellOptions(0,nullptr); return TRUE; } case KEY_SHIFTF10: { ShellOptions(1,nullptr); return TRUE; } default: { if (Key >= KEY_CTRL0 && Key <= KEY_CTRL9) ChangePanelViewMode(ActivePanel,Key-KEY_CTRL0,TRUE); if (!ActivePanel->ProcessKey(Key)) CtrlObject->CmdLine->ProcessKey(Key); break; } } return TRUE; }