Skip to content

Commit 6dcbffe

Browse files
author
Roberto De Ioris
committed
fixed subclassing api
1 parent a639bd4 commit 6dcbffe

File tree

4 files changed

+490
-561
lines changed

4 files changed

+490
-561
lines changed

Source/PythonConsole/Private/PythonConsoleModule.cpp

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -93,71 +93,4 @@ TSharedRef< SWidget > FPythonConsoleModule::MakeConsoleInputBox( TSharedPtr< SEd
9393
TSharedRef< SPythonConsoleInputBox > NewConsoleInputBox = SNew( SPythonConsoleInputBox );
9494
OutExposedEditableTextBox = NewConsoleInputBox->GetEditableTextBox();
9595
return NewConsoleInputBox;
96-
}
97-
98-
99-
void FPythonConsoleModule::TogglePythonConsoleForWindow( const TSharedRef< SWindow >& Window, const EPythonConsoleStyle::Type InStyle, const FPythonConsoleDelegates& PythonConsoleDelegates )
100-
{
101-
bool bShouldOpen = true;
102-
// Close an existing console box, if there is one
103-
TSharedPtr< SWidget > PinnedPythonConsole( PythonConsole.Pin() );
104-
if( PinnedPythonConsole.IsValid() )
105-
{
106-
// If the console is already open close it unless it is in a different window. In that case reopen it on that window
107-
bShouldOpen = false;
108-
TSharedPtr< SWindow > WindowForExistingConsole = FSlateApplication::Get().FindWidgetWindow(PinnedPythonConsole.ToSharedRef());
109-
if (WindowForExistingConsole.IsValid())
110-
{
111-
WindowForExistingConsole->RemoveOverlaySlot(PinnedPythonConsole.ToSharedRef());
112-
PythonConsole.Reset();
113-
}
114-
115-
if( WindowForExistingConsole != Window )
116-
{
117-
// Console is being opened on another window
118-
bShouldOpen = true;
119-
}
120-
}
121-
122-
TSharedPtr<SDockTab> ActiveTab = FGlobalTabmanager::Get()->GetActiveTab();
123-
if (ActiveTab.IsValid() && ActiveTab->GetLayoutIdentifier() == FTabId(PythonConsoleModule::PythonLogTabName))
124-
{
125-
FGlobalTabmanager::Get()->DrawAttention(ActiveTab.ToSharedRef());
126-
bShouldOpen = false;
127-
}
128-
129-
if( bShouldOpen )
130-
{
131-
const EPythonConsoleStyle::Type PythonConsoleStyle = InStyle;
132-
TSharedRef< SPythonConsole > PythonConsoleRef = SNew( SPythonConsole, PythonConsoleStyle, this, &PythonConsoleDelegates );
133-
PythonConsole = PythonConsoleRef;
134-
135-
const int32 MaximumZOrder = MAX_int32;
136-
Window->AddOverlaySlot( MaximumZOrder )
137-
.VAlign(VAlign_Bottom)
138-
.HAlign(HAlign_Center)
139-
.Padding( 10.0f )
140-
[
141-
PythonConsoleRef
142-
];
143-
144-
// Force keyboard focus
145-
PythonConsoleRef->SetFocusToEditableText();
146-
}
147-
}
148-
149-
150-
void FPythonConsoleModule::ClosePythonConsole()
151-
{
152-
TSharedPtr< SWidget > PinnedPythonConsole( PythonConsole.Pin() );
153-
154-
if( PinnedPythonConsole.IsValid() )
155-
{
156-
TSharedPtr< SWindow > WindowForExistingConsole = FSlateApplication::Get().FindWidgetWindow(PinnedPythonConsole.ToSharedRef());
157-
if (WindowForExistingConsole.IsValid())
158-
{
159-
WindowForExistingConsole->RemoveOverlaySlot( PinnedPythonConsole.ToSharedRef() );
160-
PythonConsole.Reset();
161-
}
162-
}
16396
}

Source/PythonConsole/Public/PythonConsoleModule.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
1+
// Copyright 1998-2018 20Tab S.r.l. All Rights Reserved.
22

33
#pragma once
44

@@ -33,12 +33,6 @@ class FPythonConsoleModule : public IModuleInterface
3333
output log DLL is unloaded on the fly. */
3434
virtual TSharedRef< SWidget > MakeConsoleInputBox( TSharedPtr< SEditableTextBox >& OutExposedEditableTextBox ) const;
3535

36-
/** Opens a debug console in the specified window, if not already open */
37-
virtual void TogglePythonConsoleForWindow( const TSharedRef< SWindow >& Window, const EPythonConsoleStyle::Type InStyle, const FPythonConsoleDelegates& PythonConsoleDelegates );
38-
39-
/** Closes the debug console for the specified window */
40-
virtual void ClosePythonConsole();
41-
4236

4337
private:
4438

0 commit comments

Comments
 (0)