Flesh out the source list a bit.

This commit is contained in:
dg
2023-04-02 21:34:02 +00:00
parent 5b627bd2b1
commit 137658d1d6
11 changed files with 47 additions and 19 deletions

BIN
extras/fluxfile.piko Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
extras/fluxfile.png Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 365 B

BIN
extras/hardware.piko Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
extras/hardware.png Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 428 B

BIN
extras/imagefile.piko Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
extras/imagefile.png Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 327 B

View File

@@ -18,6 +18,11 @@ FLUXENGINE_GUI_SRCS = \
src/gui/textviewerwindow.cc \
src/gui/visualisationcontrol.cc \
src/gui/idlepanel.cc: \
$(OBJDIR)/extras/hardware.h \
$(OBJDIR)/extras/fluxfile.h \
$(OBJDIR)/extras/imagefile.h
FLUXENGINE_GUI_OBJS = \
$(patsubst %.cpp, $(OBJDIR)/%.o, \
$(patsubst %.cc, $(OBJDIR)/%.o, $(FLUXENGINE_GUI_SRCS)) \
@@ -45,6 +50,11 @@ fluxengine-gui$(EXT): $(FLUXENGINE_GUI_BIN)
@echo CP $@
@cp $< $@
$(OBJDIR)/%.h: %.png
@echo ENCODE $@
@mkdir -p $(dir $@)
@xxd -i $^ > $@
ifeq ($(PLATFORM),OSX)
binaries: FluxEngine.pkg

View File

@@ -12,6 +12,12 @@
#include "layout.h"
#include "texteditorwindow.h"
#include <wx/config.h>
#include <wx/mstream.h>
#include <wx/image.h>
#include <wx/bitmap.h>
#include ".obj/extras/hardware.h"
#include ".obj/extras/fluxfile.h"
#include ".obj/extras/imagefile.h"
extern const std::map<std::string, std::string> formats;
@@ -32,6 +38,13 @@ const std::string DEFAULT_EXTRA_CONFIGURATION =
"# or the name of a built-in configuration, or the filename\n"
"# of a text proto file. Or a comment, of course.\n\n";
static wxBitmap createBitmap(const uint8_t* data, size_t length)
{
wxMemoryInputStream stream(data, length);
wxImage image(stream, wxBITMAP_TYPE_PNG);
return wxBitmap(image);
}
class IdlePanelImpl : public IdlePanelGen, public IdlePanel
{
enum
@@ -45,6 +58,7 @@ public:
IdlePanelImpl(MainWindow* mainWindow, wxSimplebook* parent):
IdlePanelGen(parent),
IdlePanel(mainWindow),
_imageList(48, 48, true, 0),
_config("FluxEngine")
{
int defaultFormat = 0;
@@ -75,16 +89,19 @@ public:
parent->AddPage(this, "idle");
wxImageList* imageList = new wxImageList();
imageList->Add(GetBitmap());
m_listbook2->AssignImageList(imageList);
auto* sourceList = sourceListBook->GetListView();
sourceList->SetFont(sourceList->GetFont().MakeSmaller().MakeSmaller().MakeSmaller());
for (int i=0; i<4; i++)
_imageList.Add(createBitmap(extras_hardware_png, sizeof(extras_hardware_png)));
_imageList.Add(createBitmap(extras_fluxfile_png, sizeof(extras_fluxfile_png)));
_imageList.Add(createBitmap(extras_imagefile_png, sizeof(extras_imagefile_png)));
sourceListBook->SetImageList(&_imageList);
for (int i=0; i<3; i++)
{
auto* panel = new wxPanel(m_listbook2);
m_listbook2->AddPage(panel, fmt::format("page {}", i),
false);
m_listbook2->SetPageImage(i, 0);
auto* panel = new wxPanel(sourceListBook);
sourceListBook->AddPage(panel, fmt::format("page {}\nmultiline", i),
false, i);
new wxButton(panel, wxID_ANY, "button");
@@ -564,6 +581,7 @@ private:
private:
wxConfig _config;
wxImageList _imageList;
std::vector<std::string> _formatNames;
std::vector<std::unique_ptr<const CandidateDevice>> _devices;
int _selectedSource;

View File

@@ -520,15 +520,15 @@ IdlePanelGen::IdlePanelGen( wxWindow* parent, wxWindowID id, const wxPoint& pos,
m_staticText61->Wrap( -1 );
fgSizer8->Add( m_staticText61, 0, wxALIGN_CENTER|wxALL, 5 );
m_listbook2 = new wxListbook( m_scrolledWindow1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLB_DEFAULT|wxLB_TOP );
wxSize m_listbook2ImageSize = wxSize( 48,48 );
int m_listbook2Index = 0;
wxImageList* m_listbook2Images = new wxImageList( m_listbook2ImageSize.GetWidth(), m_listbook2ImageSize.GetHeight() );
m_listbook2->AssignImageList( m_listbook2Images );
wxBitmap m_listbook2Bitmap;
wxImage m_listbook2Image;
sourceListBook = new wxListbook( m_scrolledWindow1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLB_DEFAULT|wxLB_TOP|wxBORDER_THEME );
wxSize sourceListBookImageSize = wxSize( 48,48 );
int sourceListBookIndex = 0;
wxImageList* sourceListBookImages = new wxImageList( sourceListBookImageSize.GetWidth(), sourceListBookImageSize.GetHeight() );
sourceListBook->AssignImageList( sourceListBookImages );
wxBitmap sourceListBookBitmap;
wxImage sourceListBookImage;
fgSizer8->Add( m_listbook2, 1, wxEXPAND | wxALL, 5 );
fgSizer8->Add( sourceListBook, 1, wxEXPAND | wxALL, 5 );
realDiskRadioButton = new wxRadioButton( m_scrolledWindow1, wxID_ANY, wxT("Real disk"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
realDiskRadioButton->SetToolTip( wxT("You want to use a real floppy drive attached to real hardware.") );

View File

@@ -3012,7 +3012,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_listbook2</property>
<property name="name">sourceListBook</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@@ -3028,7 +3028,7 @@
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="window_style">wxBORDER_THEME</property>
</object>
</object>
<object class="sizeritem" expanded="0">

View File

@@ -316,7 +316,7 @@ class IdlePanelGen : public wxPanel
wxScrolledWindow* m_scrolledWindow1;
wxStaticBitmap* applicationBitmap;
wxStaticText* m_staticText61;
wxListbook* m_listbook2;
wxListbook* sourceListBook;
wxRadioButton* realDiskRadioButton;
wxPanel* realDiskRadioButtonPanel;
wxComboBox* deviceCombo;