mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-13 17:53:11 +02:00
Update template selector to modern webview
Allow more attractive templates. Start of building singular template+new project layout Fixes https://gitlab.com/kicad/code/kicad/-/issues/15987
This commit is contained in:
parent
dd889ddac9
commit
416e54f0d5
@ -1032,7 +1032,7 @@ endif()
|
||||
# See line 49 of cmake/FindwxWidgets.cmake
|
||||
set( wxWidgets_CONFIG_OPTIONS ${wxWidgets_CONFIG_OPTIONS} --static=no )
|
||||
|
||||
find_package( wxWidgets ${wxWidgets_REQ_VERSION} COMPONENTS gl aui adv html core net base propgrid xml stc richtext REQUIRED )
|
||||
find_package( wxWidgets ${wxWidgets_REQ_VERSION} COMPONENTS gl aui adv html core net base propgrid xml stc richtext webview REQUIRED )
|
||||
|
||||
# Include wxWidgets macros.
|
||||
include( ${wxWidgets_USE_FILE} )
|
||||
|
@ -6,12 +6,19 @@
|
||||
#include <wx/utils.h>
|
||||
#include <wx/log.h>
|
||||
|
||||
WEBVIEW_PANEL::WEBVIEW_PANEL( wxWindow* parent ) :
|
||||
wxPanel( parent ),
|
||||
m_browser( wxWebView::New() )
|
||||
WEBVIEW_PANEL::WEBVIEW_PANEL( wxWindow* aParent, wxWindowID aId, const wxPoint& aPos,
|
||||
const wxSize& aSize, const int aStyle )
|
||||
: wxPanel( aParent, aId, aPos, aSize, aStyle ),
|
||||
m_initialized( false ),
|
||||
m_browser( wxWebView::New() )
|
||||
{
|
||||
wxBoxSizer* sizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
if( !wxGetEnv( wxT( "WEBKIT_DISABLE_COMPOSITING_MODE" ), nullptr ) )
|
||||
{
|
||||
wxSetEnv( wxT( "WEBKIT_DISABLE_COMPOSITING_MODE" ), wxT( "1" ) );
|
||||
}
|
||||
|
||||
#ifdef __WXMAC__
|
||||
m_browser->RegisterHandler( wxSharedPtr<wxWebViewHandler>( new wxWebViewArchiveHandler( "wxfs" ) ) );
|
||||
m_browser->RegisterHandler( wxSharedPtr<wxWebViewHandler>( new wxWebViewFSHandler( "memory" ) ) );
|
||||
@ -38,14 +45,32 @@ WEBVIEW_PANEL::~WEBVIEW_PANEL()
|
||||
{
|
||||
}
|
||||
|
||||
void WEBVIEW_PANEL::LoadURL( const wxString& url )
|
||||
void WEBVIEW_PANEL::LoadURL( const wxString& aURL )
|
||||
{
|
||||
m_browser->LoadURL( url );
|
||||
if( aURL.starts_with( "file:/" ) && !aURL.starts_with( "file:///" ) )
|
||||
{
|
||||
wxString new_url = wxString( "file:///" ) + aURL.AfterFirst( '/' );
|
||||
m_browser->LoadURL( new_url );
|
||||
return;
|
||||
}
|
||||
|
||||
if( !aURL.StartsWith( "http://" ) && !aURL.StartsWith( "https://" ) && !aURL.StartsWith( "file://" ) )
|
||||
{
|
||||
wxLogError( "Invalid URL: %s", aURL );
|
||||
return;
|
||||
}
|
||||
|
||||
m_browser->LoadURL( aURL );
|
||||
}
|
||||
|
||||
bool WEBVIEW_PANEL::AddMessageHandler( const wxString& name, MESSAGE_HANDLER handler )
|
||||
void WEBVIEW_PANEL::SetPage( const wxString& aHtmlContent )
|
||||
{
|
||||
m_msgHandlers.emplace( name, std::move(handler) );
|
||||
m_browser->SetPage( aHtmlContent, "file://" );
|
||||
}
|
||||
|
||||
bool WEBVIEW_PANEL::AddMessageHandler( const wxString& aName, MESSAGE_HANDLER aHandler )
|
||||
{
|
||||
m_msgHandlers.emplace( aName, std::move(aHandler) );
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -54,18 +79,18 @@ void WEBVIEW_PANEL::ClearMessageHandlers()
|
||||
m_msgHandlers.clear();
|
||||
}
|
||||
|
||||
void WEBVIEW_PANEL::OnNavigationRequest( wxWebViewEvent& evt )
|
||||
void WEBVIEW_PANEL::OnNavigationRequest( wxWebViewEvent& aEvt )
|
||||
{
|
||||
// Default behavior: open external links in the system browser
|
||||
if( !evt.GetURL().StartsWith( "file:" ) && !evt.GetURL().StartsWith( "wxfs:" )
|
||||
&& !evt.GetURL().StartsWith( "memory:" ) )
|
||||
bool isExternal = aEvt.GetURL().StartsWith( "http://" ) || aEvt.GetURL().StartsWith( "https://" );
|
||||
if( isExternal )
|
||||
{
|
||||
wxLaunchDefaultBrowser( evt.GetURL() );
|
||||
evt.Veto();
|
||||
wxLaunchDefaultBrowser( aEvt.GetURL() );
|
||||
aEvt.Veto();
|
||||
}
|
||||
}
|
||||
|
||||
void WEBVIEW_PANEL::OnWebViewLoaded( wxWebViewEvent& evt )
|
||||
void WEBVIEW_PANEL::OnWebViewLoaded( wxWebViewEvent& aEvt )
|
||||
{
|
||||
if( !m_initialized )
|
||||
{
|
||||
@ -116,45 +141,45 @@ void WEBVIEW_PANEL::OnWebViewLoaded( wxWebViewEvent& evt )
|
||||
}
|
||||
}
|
||||
|
||||
void WEBVIEW_PANEL::OnNewWindow( wxWebViewEvent& evt )
|
||||
void WEBVIEW_PANEL::OnNewWindow( wxWebViewEvent& aEvt )
|
||||
{
|
||||
m_browser->LoadURL( evt.GetURL() );
|
||||
evt.Veto(); // Prevent default behavior of opening a new window
|
||||
wxLogTrace( "webview", "New window requested for URL: %s", evt.GetURL() );
|
||||
wxLogTrace( "webview", "Target: %s", evt.GetTarget() );
|
||||
wxLogTrace( "webview", "Action flags: %d", static_cast<int>(evt.GetNavigationAction()) );
|
||||
wxLogTrace( "webview", "Message handler: %s", evt.GetMessageHandler() );
|
||||
m_browser->LoadURL( aEvt.GetURL() );
|
||||
aEvt.Veto(); // Prevent default behavior of opening a new window
|
||||
wxLogTrace( "webview", "New window requested for URL: %s", aEvt.GetURL() );
|
||||
wxLogTrace( "webview", "Target: %s", aEvt.GetTarget() );
|
||||
wxLogTrace( "webview", "Action flags: %d", static_cast<int>(aEvt.GetNavigationAction()) );
|
||||
wxLogTrace( "webview", "Message handler: %s", aEvt.GetMessageHandler() );
|
||||
}
|
||||
|
||||
void WEBVIEW_PANEL::OnScriptMessage( wxWebViewEvent& evt )
|
||||
void WEBVIEW_PANEL::OnScriptMessage( wxWebViewEvent& aEvt )
|
||||
{
|
||||
wxLogTrace( "webview", "Script message received: %s for handler %s", evt.GetString(), evt.GetMessageHandler() );
|
||||
wxLogTrace( "webview", "Script message received: %s for handler %s", aEvt.GetString(), aEvt.GetMessageHandler() );
|
||||
|
||||
if( evt.GetMessageHandler().IsEmpty() )
|
||||
if( aEvt.GetMessageHandler().IsEmpty() )
|
||||
{
|
||||
wxLogDebug( "No message handler specified for script message: %s", evt.GetString() );
|
||||
wxLogDebug( "No message handler specified for script message: %s", aEvt.GetString() );
|
||||
return;
|
||||
}
|
||||
|
||||
auto it = m_msgHandlers.find( evt.GetMessageHandler() );
|
||||
auto it = m_msgHandlers.find( aEvt.GetMessageHandler() );
|
||||
if( it == m_msgHandlers.end() )
|
||||
{
|
||||
wxLogDebug( "No handler registered for message: %s", evt.GetMessageHandler() );
|
||||
wxLogDebug( "No handler registered for message: %s", aEvt.GetMessageHandler() );
|
||||
return;
|
||||
}
|
||||
|
||||
// Call the registered handler with the message
|
||||
wxLogTrace( "webview", "Calling handler for message: %s", evt.GetMessageHandler() );
|
||||
it->second( evt.GetString() );
|
||||
wxLogTrace( "webview", "Calling handler for message: %s", aEvt.GetMessageHandler() );
|
||||
it->second( aEvt.GetString() );
|
||||
}
|
||||
|
||||
void WEBVIEW_PANEL::OnScriptResult( wxWebViewEvent& evt )
|
||||
void WEBVIEW_PANEL::OnScriptResult( wxWebViewEvent& aEvt )
|
||||
{
|
||||
if( evt.IsError() )
|
||||
wxLogDebug( "Async script execution failed: %s", evt.GetString() );
|
||||
if( aEvt.IsError() )
|
||||
wxLogDebug( "Async script execution failed: %s", aEvt.GetString() );
|
||||
}
|
||||
|
||||
void WEBVIEW_PANEL::OnError( wxWebViewEvent& evt )
|
||||
void WEBVIEW_PANEL::OnError( wxWebViewEvent& aEvt )
|
||||
{
|
||||
wxLogDebug( "WebView error: %s", evt.GetString() );
|
||||
wxLogDebug( "WebView error: %s", aEvt.GetString() );
|
||||
}
|
||||
|
@ -11,12 +11,15 @@ class WEBVIEW_PANEL : public wxPanel
|
||||
public:
|
||||
using MESSAGE_HANDLER = std::function<void( const wxString& )>;
|
||||
|
||||
explicit WEBVIEW_PANEL( wxWindow* parent );
|
||||
explicit WEBVIEW_PANEL( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, const int style = 0 );
|
||||
~WEBVIEW_PANEL() override;
|
||||
|
||||
wxWebView* GetWebView() const { return m_browser; }
|
||||
|
||||
void LoadURL( const wxString& url );
|
||||
void SetPage( const wxString& htmlContent );
|
||||
|
||||
bool AddMessageHandler( const wxString& name, MESSAGE_HANDLER handler );
|
||||
void ClearMessageHandlers();
|
||||
|
||||
|
@ -31,6 +31,89 @@
|
||||
#include <wx/dirdlg.h>
|
||||
#include <wx/settings.h>
|
||||
|
||||
static const wxString GetWelcomeHtml()
|
||||
{
|
||||
return wxString(
|
||||
"<!DOCTYPE html>"
|
||||
"<html lang=\"en\">"
|
||||
"<head>"
|
||||
"<meta charset=\"UTF-8\">"
|
||||
"<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">"
|
||||
"<title>KiCad Project Template Selector</title>"
|
||||
"<style>"
|
||||
"body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif; margin: 0; padding: 20px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #333; min-height: 100vh; box-sizing: border-box; }"
|
||||
".container { max-width: 800px; margin: 0 auto; background: rgba(255, 255, 255, 0.95); border-radius: 12px; padding: 30px; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1); backdrop-filter: blur(10px); }"
|
||||
".header { text-align: center; margin-bottom: 30px; }"
|
||||
".logo { font-size: 2.5rem; font-weight: bold; color: #4a5568; margin-bottom: 10px; text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1); }"
|
||||
".subtitle { font-size: 1.2rem; color: #666; margin-bottom: 20px; }"
|
||||
".welcome-card { background: linear-gradient(135deg, #4299e1, #3182ce); color: white; padding: 25px; border-radius: 10px; margin-bottom: 25px; box-shadow: 0 4px 15px rgba(66, 153, 225, 0.3); }"
|
||||
".welcome-card h2 { margin-top: 0; font-size: 1.8rem; margin-bottom: 15px; }"
|
||||
".instructions { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-bottom: 25px; }"
|
||||
".instruction-card { background: #f7fafc; border: 2px solid #e2e8f0; border-radius: 8px; padding: 20px; transition: all 0.3s ease; position: relative; overflow: hidden; }"
|
||||
".instruction-card:hover { transform: translateY(-2px); box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1); border-color: #4299e1; }"
|
||||
".instruction-card::before { content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%; background: linear-gradient(135deg, #4299e1, #3182ce); }"
|
||||
".instruction-card h3 { color: #2d3748; margin-top: 0; margin-bottom: 10px; font-size: 1.3rem; }"
|
||||
".instruction-card p { color: #4a5568; line-height: 1.6; margin: 0; }"
|
||||
".features { background: #f0fff4; border: 2px solid #9ae6b4; border-radius: 8px; padding: 20px; margin-bottom: 25px; }"
|
||||
".features h3 { color: #22543d; margin-top: 0; margin-bottom: 15px; font-size: 1.4rem; }"
|
||||
".features ul { color: #2f855a; line-height: 1.8; margin: 0; padding-left: 20px; }"
|
||||
".features li { margin-bottom: 8px; }"
|
||||
".tips { background: #fffaf0; border: 2px solid #fbd38d; border-radius: 8px; padding: 20px; }"
|
||||
".tips h3 { color: #c05621; margin-top: 0; margin-bottom: 15px; font-size: 1.4rem; }"
|
||||
".tips p { color: #c05621; line-height: 1.6; margin: 0 0 10px 0; }"
|
||||
".highlight { background: linear-gradient(120deg, #a8edea 0%, #fed6e3 100%); padding: 2px 6px; border-radius: 4px; font-weight: 600; }"
|
||||
"</style>"
|
||||
"</head>"
|
||||
"<body>"
|
||||
"<div class=\"container\">"
|
||||
"<div class=\"header\">"
|
||||
"<div class=\"logo\">KiCad 📑</div>"
|
||||
"<div class=\"subtitle\">" + _( "Project Template Selector" ) + "</div>"
|
||||
"</div>"
|
||||
"<div class=\"welcome-card\">"
|
||||
"<h2>" + _( "Welcome to Template Selection!" ) + "</h2>"
|
||||
"<p>" + _( "Choose from a variety of pre-configured project templates to jumpstart your PCB design. Templates provide ready-to-use project structures with common components, libraries, and design rules." ) + "</p>"
|
||||
"</div>"
|
||||
"<div class=\"instructions\">"
|
||||
"<div class=\"instruction-card\">"
|
||||
"<h3>→ " + _( "Browse Templates" ) + "</h3>"
|
||||
"<p>" + _( "Navigate through the template tabs above to explore different categories of project templates. Each tab contains templates organized by type or complexity." ) + "</p>"
|
||||
"</div>"
|
||||
"<div class=\"instruction-card\">"
|
||||
"<h3>→ " + _( "Select a Template" ) + "</h3>"
|
||||
"<p>" + _( "Click on any template in the list to " ) + "<span class=\"highlight\">" + _( "preview its details" ) + "</span>. " + _( "The template information will appear in this panel, showing descriptions, included components, and project structure." ) + "</p>"
|
||||
"</div>"
|
||||
"<div class=\"instruction-card\">"
|
||||
"<h3>→ " + _( "Customize Path" ) + "</h3>"
|
||||
"<p>" + _( "Use the " ) + "<span class=\"highlight\">" + _( "folder path field" ) + "</span> " + _( "above to browse custom template directories. Click the folder icon to browse, or the refresh icon to reload templates." ) + "</p>"
|
||||
"</div>"
|
||||
"<div class=\"instruction-card\">"
|
||||
"<h3>→ " + _( "Create Project" ) + "</h3>"
|
||||
"<p>" + _( "Once you've found the right template, click " ) + "<span class=\"highlight\">" + _( "OK" ) + "</span> " + _( "to create a new project based on the selected template. Your project will inherit all template settings and files." ) + "</p>"
|
||||
"</div>"
|
||||
"</div>"
|
||||
"<div class=\"features\">"
|
||||
"<h3>" + _( "What You Get with Templates" ) + "</h3>"
|
||||
"<ul>"
|
||||
"<li><strong>" + _( "Pre-configured libraries" ) + "</strong> " + _( "- Common components and footprints already linked" ) + "</li>"
|
||||
"<li><strong>" + _( "Design rules" ) + "</strong> " + _( "- Appropriate electrical and mechanical constraints" ) + "</li>"
|
||||
"<li><strong>" + _( "Layer stackups" ) + "</strong> " + _( "- Optimized for the intended application" ) + "</li>"
|
||||
"<li><strong>" + _( "Component placement" ) + "</strong> " + _( "- Basic layout and routing guidelines" ) + "</li>"
|
||||
"<li><strong>" + _( "Documentation" ) + "</strong> " + _( "- README files and design notes" ) + "</li>"
|
||||
"<li><strong>" + _( "Manufacturing files" ) + "</strong> " + _( "- Gerber and drill file configurations" ) + "</li>"
|
||||
"</ul>"
|
||||
"</div>"
|
||||
"<div class=\"tips\">"
|
||||
"<h3>" + _( "Pro Tips" ) + "</h3>"
|
||||
"<p><strong>" + _( "Start Simple:" ) + "</strong> " + _( "Begin with basic templates and add more elements as you go." ) + "</p>"
|
||||
"<p><strong>" + _( "Customize Later:" ) + "</strong> " + _( "Templates are starting points - you can modify libraries, rules, and layouts after project creation." ) + "</p>"
|
||||
"<p><strong>" + _( "Save Your Own:" ) + "</strong> " + _( "Once you develop preferred settings, create a custom template for future projects." ) + "</p>"
|
||||
"</div>"
|
||||
"</div>"
|
||||
"</body>"
|
||||
"</html>"
|
||||
);
|
||||
}
|
||||
|
||||
TEMPLATE_SELECTION_PANEL::TEMPLATE_SELECTION_PANEL( wxNotebookPage* aParent,
|
||||
const wxString& aPath ) :
|
||||
@ -107,10 +190,32 @@ void TEMPLATE_WIDGET::OnMouse( wxMouseEvent& event )
|
||||
|
||||
void DIALOG_TEMPLATE_SELECTOR::OnPageChange( wxNotebookEvent& event )
|
||||
{
|
||||
int page = event.GetSelection();
|
||||
int newPage = event.GetSelection();
|
||||
int oldPage = event.GetOldSelection();
|
||||
|
||||
if( page != wxNOT_FOUND && (unsigned)page < m_panels.size() )
|
||||
m_tcTemplatePath->SetValue( m_panels[page]->GetPath() );
|
||||
// Move webview panel from old page to new page
|
||||
if( oldPage != wxNOT_FOUND && (unsigned)oldPage < m_panels.size() )
|
||||
{
|
||||
// Detach webview from old panel
|
||||
m_panels[oldPage]->m_SizerBase->Detach( m_webviewPanel );
|
||||
m_panels[oldPage]->Layout();
|
||||
}
|
||||
|
||||
if( newPage != wxNOT_FOUND && (unsigned)newPage < m_panels.size() )
|
||||
{
|
||||
// Reparent the webview to the new panel
|
||||
m_webviewPanel->Reparent( m_panels[newPage] );
|
||||
|
||||
// Attach webview to new panel
|
||||
m_panels[newPage]->m_SizerBase->Add( m_webviewPanel, 1, wxEXPAND | wxALL, 5 );
|
||||
m_panels[newPage]->Layout();
|
||||
|
||||
// Update template path
|
||||
m_tcTemplatePath->SetValue( m_panels[newPage]->GetPath() );
|
||||
|
||||
// Reset to welcome page when switching tabs if no template selected
|
||||
m_webviewPanel->SetPage( GetWelcomeHtml() );
|
||||
}
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
@ -125,7 +230,6 @@ DIALOG_TEMPLATE_SELECTOR::DIALOG_TEMPLATE_SELECTOR( wxWindow* aParent, const wxP
|
||||
m_browseButton->SetBitmap( KiBitmapBundle( BITMAPS::small_folder ) );
|
||||
m_reloadButton->SetBitmap( KiBitmapBundle( BITMAPS::small_refresh ) );
|
||||
|
||||
m_htmlWin->SetPage( _( "<h1>Template Selector</h1>" ) );
|
||||
m_selectedWidget = nullptr;
|
||||
|
||||
for( auto& [title, pathFname] : aTitleDirMap )
|
||||
@ -144,6 +248,29 @@ DIALOG_TEMPLATE_SELECTOR::DIALOG_TEMPLATE_SELECTOR( wxWindow* aParent, const wxP
|
||||
buildPageContent( path, m_notebook->GetPageCount() - 1 );
|
||||
}
|
||||
|
||||
// Move webview panel from dialog to first template selection panel
|
||||
if( !m_panels.empty() )
|
||||
{
|
||||
// Find the sizer containing the webview and detach it
|
||||
wxSizer* parentSizer = m_webviewPanel->GetContainingSizer();
|
||||
if( parentSizer )
|
||||
{
|
||||
parentSizer->Detach( m_webviewPanel );
|
||||
}
|
||||
|
||||
// Reparent the webview to the first panel
|
||||
m_webviewPanel->Reparent( m_panels[0] );
|
||||
|
||||
// Add webview to first panel
|
||||
m_panels[0]->m_SizerBase->Add( m_webviewPanel, 1, wxEXPAND | wxALL, 5 );
|
||||
m_panels[0]->Layout();
|
||||
}
|
||||
|
||||
// Set welcome HTML after dialog is fully constructed
|
||||
CallAfter( [this]() {
|
||||
m_webviewPanel->SetPage( GetWelcomeHtml() );
|
||||
});
|
||||
|
||||
// When all widgets have the size fixed, call finishDialogSettings to update sizers
|
||||
finishDialogSettings();
|
||||
}
|
||||
@ -155,7 +282,30 @@ void DIALOG_TEMPLATE_SELECTOR::SetWidget( TEMPLATE_WIDGET* aWidget )
|
||||
m_selectedWidget->Unselect();
|
||||
|
||||
m_selectedWidget = aWidget;
|
||||
SetHtml( m_selectedWidget->GetTemplate()->GetHtmlFile() );
|
||||
wxFileName htmlFile = aWidget->GetTemplate()->GetHtmlFile();
|
||||
|
||||
if( htmlFile.FileExists() && htmlFile.IsFileReadable() )
|
||||
{
|
||||
m_webviewPanel->LoadURL( wxFileName::FileNameToURL( htmlFile ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
// Fallback to a simple template info page if no HTML file exists
|
||||
wxString templateHtml = wxString::Format(
|
||||
"<!DOCTYPE html>"
|
||||
"<html><head><meta charset='UTF-8'><style>"
|
||||
"body { font-family: Arial, sans-serif; margin: 20px; }"
|
||||
".template-info { background: #f0f8ff; padding: 20px; border-radius: 8px; }"
|
||||
"h1 { color: #333; margin-top: 0; }"
|
||||
"</style></head><body>"
|
||||
"<div class='template-info'>"
|
||||
"<h1>%s</h1>"
|
||||
"<p>Template selected. Click OK to create a new project based on this template.</p>"
|
||||
"</div></body></html>",
|
||||
*aWidget->GetTemplate()->GetTitle()
|
||||
);
|
||||
m_webviewPanel->SetPage( templateHtml );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -267,22 +417,28 @@ void DIALOG_TEMPLATE_SELECTOR::replaceCurrentPage()
|
||||
wxString title = m_notebook->GetPageText( page );
|
||||
wxString currPath = m_tcTemplatePath->GetValue();
|
||||
|
||||
// Detach webview from current panel before deleting it
|
||||
if( (unsigned)page < m_panels.size() )
|
||||
{
|
||||
m_panels[page]->m_SizerBase->Detach( m_webviewPanel );
|
||||
}
|
||||
|
||||
m_notebook->DeletePage( page );
|
||||
|
||||
TEMPLATE_SELECTION_PANEL* tpanel = new TEMPLATE_SELECTION_PANEL( m_notebook, currPath );
|
||||
m_panels[page] = tpanel;
|
||||
m_notebook->InsertPage( page, tpanel, title, true );
|
||||
|
||||
// Reparent and add webview back to the new panel
|
||||
m_webviewPanel->Reparent( tpanel );
|
||||
tpanel->m_SizerBase->Add( m_webviewPanel, 1, wxEXPAND | wxALL, 5 );
|
||||
|
||||
buildPageContent( m_tcTemplatePath->GetValue(), page );
|
||||
|
||||
m_selectedWidget = nullptr;
|
||||
|
||||
// Reset to welcome page after rebuilding
|
||||
m_webviewPanel->SetPage( GetWelcomeHtml() );
|
||||
|
||||
Layout();
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_TEMPLATE_SELECTOR::OnHtmlLinkActivated( wxHtmlLinkEvent& event )
|
||||
{
|
||||
wxString url = event.GetLinkInfo().GetHref();
|
||||
wxLaunchDefaultBrowser( url );
|
||||
}
|
||||
}
|
@ -26,6 +26,7 @@
|
||||
#define PROJECT_TEMPLATE_SELECTOR_H
|
||||
|
||||
#include <dialogs/dialog_template_selector_base.h>
|
||||
#include <widgets/webview_panel.h>
|
||||
#include "project_template.h"
|
||||
|
||||
#include <map>
|
||||
@ -104,7 +105,7 @@ protected:
|
||||
private:
|
||||
void SetHtml( const wxFileName& aFilename )
|
||||
{
|
||||
m_htmlWin->LoadPage( aFilename.GetFullPath() );
|
||||
m_webviewPanel->LoadURL( aFilename.GetFullPath() );
|
||||
}
|
||||
|
||||
private:
|
||||
@ -114,7 +115,6 @@ private:
|
||||
void OnPageChange( wxNotebookEvent& event ) override;
|
||||
void onDirectoryBrowseClicked( wxCommandEvent& event ) override;
|
||||
void onReload( wxCommandEvent& event ) override;
|
||||
void OnHtmlLinkActivated( wxHtmlLinkEvent& event ) override;
|
||||
|
||||
protected:
|
||||
std::vector<TEMPLATE_SELECTION_PANEL*> m_panels;
|
||||
|
@ -1,11 +1,12 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
|
||||
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6a-dirty)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "widgets/std_bitmap_button.h"
|
||||
#include "widgets/webview_panel.h"
|
||||
|
||||
#include "dialog_template_selector_base.h"
|
||||
|
||||
@ -37,14 +38,20 @@ DIALOG_TEMPLATE_SELECTOR_BASE::DIALOG_TEMPLATE_SELECTOR_BASE( wxWindow* parent,
|
||||
|
||||
bmainSizer->Add( bsizerTemplateSelector, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 );
|
||||
|
||||
wxBoxSizer* bSizer6;
|
||||
bSizer6 = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_notebook = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
|
||||
bmainSizer->Add( m_notebook, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
|
||||
bSizer6->Add( m_notebook, 1, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
m_htmlWin = new HTML_WINDOW( this, wxID_ANY, wxDefaultPosition, wxSize( -1,-1 ), wxHW_SCROLLBAR_AUTO );
|
||||
m_htmlWin->SetMinSize( wxSize( 700,300 ) );
|
||||
m_webviewPanel = new WEBVIEW_PANEL( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
|
||||
m_webviewPanel->SetMinSize( wxSize( 700,300 ) );
|
||||
|
||||
bmainSizer->Add( m_htmlWin, 1, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
|
||||
bSizer6->Add( m_webviewPanel, 1, wxEXPAND | wxALL, 5 );
|
||||
|
||||
|
||||
bmainSizer->Add( bSizer6, 1, wxEXPAND, 5 );
|
||||
|
||||
m_sdbSizer = new wxStdDialogButtonSizer();
|
||||
m_sdbSizerOK = new wxButton( this, wxID_OK );
|
||||
@ -66,7 +73,6 @@ DIALOG_TEMPLATE_SELECTOR_BASE::DIALOG_TEMPLATE_SELECTOR_BASE( wxWindow* parent,
|
||||
m_browseButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_TEMPLATE_SELECTOR_BASE::onDirectoryBrowseClicked ), NULL, this );
|
||||
m_reloadButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_TEMPLATE_SELECTOR_BASE::onReload ), NULL, this );
|
||||
m_notebook->Connect( wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, wxNotebookEventHandler( DIALOG_TEMPLATE_SELECTOR_BASE::OnPageChange ), NULL, this );
|
||||
m_htmlWin->Connect( wxEVT_COMMAND_HTML_LINK_CLICKED, wxHtmlLinkEventHandler( DIALOG_TEMPLATE_SELECTOR_BASE::OnHtmlLinkActivated ), NULL, this );
|
||||
}
|
||||
|
||||
DIALOG_TEMPLATE_SELECTOR_BASE::~DIALOG_TEMPLATE_SELECTOR_BASE()
|
||||
@ -75,7 +81,6 @@ DIALOG_TEMPLATE_SELECTOR_BASE::~DIALOG_TEMPLATE_SELECTOR_BASE()
|
||||
m_browseButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_TEMPLATE_SELECTOR_BASE::onDirectoryBrowseClicked ), NULL, this );
|
||||
m_reloadButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_TEMPLATE_SELECTOR_BASE::onReload ), NULL, this );
|
||||
m_notebook->Disconnect( wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, wxNotebookEventHandler( DIALOG_TEMPLATE_SELECTOR_BASE::OnPageChange ), NULL, this );
|
||||
m_htmlWin->Disconnect( wxEVT_COMMAND_HTML_LINK_CLICKED, wxHtmlLinkEventHandler( DIALOG_TEMPLATE_SELECTOR_BASE::OnHtmlLinkActivated ), NULL, this );
|
||||
|
||||
}
|
||||
|
||||
@ -83,19 +88,19 @@ TEMPLATE_SELECTION_PANEL_BASE::TEMPLATE_SELECTION_PANEL_BASE( wxWindow* parent,
|
||||
{
|
||||
this->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) );
|
||||
|
||||
m_SizerBase = new wxBoxSizer( wxVERTICAL );
|
||||
m_SizerBase = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
m_scrolledWindow = new wxScrolledWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxALWAYS_SHOW_SB|wxHSCROLL );
|
||||
m_scrolledWindow->SetScrollRate( 25, 0 );
|
||||
m_scrolledWindow = new wxScrolledWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxALWAYS_SHOW_SB|wxVSCROLL );
|
||||
m_scrolledWindow->SetScrollRate( 0, 25 );
|
||||
m_scrolledWindow->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) );
|
||||
|
||||
m_SizerChoice = new wxBoxSizer( wxHORIZONTAL );
|
||||
m_SizerChoice = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
|
||||
m_scrolledWindow->SetSizer( m_SizerChoice );
|
||||
m_scrolledWindow->Layout();
|
||||
m_SizerChoice->Fit( m_scrolledWindow );
|
||||
m_SizerBase->Add( m_scrolledWindow, 1, wxEXPAND, 10 );
|
||||
m_SizerBase->Add( m_scrolledWindow, 0, wxEXPAND, 10 );
|
||||
|
||||
|
||||
this->SetSizer( m_SizerBase );
|
||||
@ -113,17 +118,17 @@ TEMPLATE_WIDGET_BASE::TEMPLATE_WIDGET_BASE( wxWindow* parent, wxWindowID id, con
|
||||
this->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) );
|
||||
|
||||
wxBoxSizer* bSizerMain;
|
||||
bSizerMain = new wxBoxSizer( wxVERTICAL );
|
||||
bSizerMain = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
m_bitmapIcon = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 64,64 ), 0 );
|
||||
m_bitmapIcon->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) );
|
||||
m_bitmapIcon->SetMinSize( wxSize( 64,64 ) );
|
||||
|
||||
bSizerMain->Add( m_bitmapIcon, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
|
||||
bSizerMain->Add( m_bitmapIcon, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
|
||||
|
||||
m_staticTitle = new wxStaticText( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER_HORIZONTAL );
|
||||
m_staticTitle->Wrap( 100 );
|
||||
bSizerMain->Add( m_staticTitle, 1, wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT, 2 );
|
||||
bSizerMain->Add( m_staticTitle, 1, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxLEFT|wxRIGHT, 2 );
|
||||
|
||||
|
||||
this->SetSizer( bSizerMain );
|
||||
|
@ -68,16 +68,16 @@
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT|wxTOP</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBoxSizer" expanded="true">
|
||||
<object class="wxBoxSizer" expanded="false">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bsizerTemplateSelector</property>
|
||||
<property name="orient">wxHORIZONTAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<object class="sizeritem" expanded="false">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="true">
|
||||
<object class="wxStaticText" expanded="false">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
@ -135,11 +135,11 @@
|
||||
<property name="wrap">-1</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<object class="sizeritem" expanded="false">
|
||||
<property name="border">2</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxTextCtrl" expanded="true">
|
||||
<object class="wxTextCtrl" expanded="false">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
@ -200,11 +200,11 @@
|
||||
<property name="window_style"></property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<object class="sizeritem" expanded="false">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxTOP|wxBOTTOM|wxRIGHT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBitmapButton" expanded="true">
|
||||
<object class="wxBitmapButton" expanded="false">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
@ -275,11 +275,11 @@
|
||||
<event name="OnButtonClick">onDirectoryBrowseClicked</event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<object class="sizeritem" expanded="false">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxBOTTOM|wxTOP</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBitmapButton" expanded="true">
|
||||
<object class="wxBitmapButton" expanded="false">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
@ -354,123 +354,132 @@
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxNotebook" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmapsize"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="drag_accept_files">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size">-1,-1</property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size">-1,-1</property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_notebook</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnNotebookPageChanged">OnPageChange</event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxHtmlWindow" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="drag_accept_files">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size">700,300</property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_htmlWin</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">public</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size">-1,-1</property>
|
||||
<property name="style">wxHW_SCROLLBAR_AUTO</property>
|
||||
<property name="subclass">HTML_WINDOW; widgets/html_window.h; </property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnHtmlLinkClicked">OnHtmlLinkActivated</event>
|
||||
<object class="wxBoxSizer" expanded="true">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bSizer6</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxNotebook" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmapsize"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="drag_accept_files">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size">-1,-1</property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size">-1,-1</property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_notebook</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnNotebookPageChanged">OnPageChange</event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND | wxALL</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxPanel" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="drag_accept_files">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size">700,300</property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_webviewPanel</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="subclass">WEBVIEW_PANEL; widgets/webview_panel.h; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style">wxTAB_TRAVERSAL</property>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
@ -520,12 +529,12 @@
|
||||
<object class="wxBoxSizer" expanded="true">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">m_SizerBase</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="orient">wxHORIZONTAL</property>
|
||||
<property name="permission">public</property>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">10</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">1</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxScrolledWindow" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
@ -570,8 +579,8 @@
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="scroll_rate_x">25</property>
|
||||
<property name="scroll_rate_y">0</property>
|
||||
<property name="scroll_rate_x">0</property>
|
||||
<property name="scroll_rate_y">25</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
@ -579,11 +588,11 @@
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style">wxALWAYS_SHOW_SB|wxHSCROLL</property>
|
||||
<object class="wxBoxSizer" expanded="true">
|
||||
<property name="window_style">wxALWAYS_SHOW_SB|wxVSCROLL</property>
|
||||
<object class="wxBoxSizer" expanded="false">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">m_SizerChoice</property>
|
||||
<property name="orient">wxHORIZONTAL</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">public</property>
|
||||
</object>
|
||||
</object>
|
||||
@ -617,11 +626,11 @@
|
||||
<object class="wxBoxSizer" expanded="true">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bSizerMain</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="orient">wxHORIZONTAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="false">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL|wxALIGN_CENTER_HORIZONTAL</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticBitmap" expanded="false">
|
||||
<property name="BottomDockable">1</property>
|
||||
@ -680,7 +689,7 @@
|
||||
</object>
|
||||
<object class="sizeritem" expanded="false">
|
||||
<property name="border">2</property>
|
||||
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxLEFT|wxRIGHT</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxStaticText" expanded="false">
|
||||
<property name="BottomDockable">1</property>
|
||||
|
@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
|
||||
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6a-dirty)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@ -11,8 +11,8 @@
|
||||
#include <wx/xrc/xmlres.h>
|
||||
#include <wx/intl.h>
|
||||
class STD_BITMAP_BUTTON;
|
||||
class WEBVIEW_PANEL;
|
||||
|
||||
#include "widgets/html_window.h"
|
||||
#include "dialog_shim.h"
|
||||
#include <wx/string.h>
|
||||
#include <wx/stattext.h>
|
||||
@ -28,10 +28,9 @@ class STD_BITMAP_BUTTON;
|
||||
#include <wx/button.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/notebook.h>
|
||||
#include <wx/html/htmlwin.h>
|
||||
#include <wx/panel.h>
|
||||
#include <wx/dialog.h>
|
||||
#include <wx/scrolwin.h>
|
||||
#include <wx/panel.h>
|
||||
#include <wx/statbmp.h>
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
@ -49,6 +48,7 @@ class DIALOG_TEMPLATE_SELECTOR_BASE : public DIALOG_SHIM
|
||||
STD_BITMAP_BUTTON* m_browseButton;
|
||||
STD_BITMAP_BUTTON* m_reloadButton;
|
||||
wxNotebook* m_notebook;
|
||||
WEBVIEW_PANEL* m_webviewPanel;
|
||||
wxStdDialogButtonSizer* m_sdbSizer;
|
||||
wxButton* m_sdbSizerOK;
|
||||
wxButton* m_sdbSizerCancel;
|
||||
@ -57,11 +57,9 @@ class DIALOG_TEMPLATE_SELECTOR_BASE : public DIALOG_SHIM
|
||||
virtual void onDirectoryBrowseClicked( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void onReload( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnPageChange( wxNotebookEvent& event ) { event.Skip(); }
|
||||
virtual void OnHtmlLinkActivated( wxHtmlLinkEvent& event ) { event.Skip(); }
|
||||
|
||||
|
||||
public:
|
||||
HTML_WINDOW* m_htmlWin;
|
||||
|
||||
DIALOG_TEMPLATE_SELECTOR_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Project Template Selector"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user