Initial commit.

This commit is contained in:
Saleem Edah-Tally
2025-06-28 17:40:42 +02:00
commit ef6f25ef27
52 changed files with 8156 additions and 0 deletions

View File

@@ -0,0 +1,180 @@
/////////////////////////////////////////////////////////////////////////////
// Name: InsaneWidgetcpp.cpp
// Purpose:
// Author: Saleem EDAH-TALLY
// Modified by:
// Created: dim. 15 juin 2025 19:37:17
// RCS-ID:
// Copyright: Copyright Saleem EDAH-TALLY. All rights reserved.
// Licence: CeCILL-C
/////////////////////////////////////////////////////////////////////////////
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
////@begin includes
////@end includes
#include "InsaneWidget.h"
////@begin XPM images
////@end XPM images
/*
* InsaneWidget type definition
*/
IMPLEMENT_DYNAMIC_CLASS( InsaneWidget, wxPanel )
/*
* InsaneWidget event table definition
*/
BEGIN_EVENT_TABLE( InsaneWidget, wxPanel )
////@begin InsaneWidget event table entries
////@end InsaneWidget event table entries
END_EVENT_TABLE()
/*
* InsaneWidget constructors
*/
InsaneWidget::InsaneWidget()
{
Init();
}
InsaneWidget::InsaneWidget( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
{
Init();
Create(parent, id, pos, size, style);
}
/*
* InsaneWidget creator
*/
bool InsaneWidget::Create( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
{
////@begin InsaneWidget creation
SetExtraStyle(wxWS_EX_VALIDATE_RECURSIVELY);
wxPanel::Create( parent, id, pos, size, style );
CreateControls();
if (GetSizer())
{
GetSizer()->SetSizeHints(this);
}
Centre();
////@end InsaneWidget creation
return true;
}
/*
* InsaneWidget destructor
*/
InsaneWidget::~InsaneWidget()
{
////@begin InsaneWidget destruction
////@end InsaneWidget destruction
}
/*
* Member initialisation
*/
void InsaneWidget::Init()
{
////@begin InsaneWidget member initialisation
lblNewDoc = NULL;
txtNewDoc = NULL;
btnScan = NULL;
////@end InsaneWidget member initialisation
}
/*
* Control creation for InsaneWidget
*/
void InsaneWidget::CreateControls()
{
////@begin InsaneWidget content construction
InsaneWidget* itemPanel1 = this;
wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
itemPanel1->SetSizer(itemBoxSizer2);
wxBoxSizer* itemBoxSizer1 = new wxBoxSizer(wxHORIZONTAL);
itemBoxSizer2->Add(itemBoxSizer1, 0, wxGROW|wxALL, 5);
lblNewDoc = new wxStaticText( itemPanel1, ID_NewDoc_LBL, _("New"), wxDefaultPosition, wxDefaultSize, 0 );
if (InsaneWidget::ShowToolTips())
lblNewDoc->SetToolTip(_("'Right' click to define a scan project."));
itemBoxSizer1->Add(lblNewDoc, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
txtNewDoc = new wxTextCtrl( itemPanel1, ID_NewDoc_TXT, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY );
if (InsaneWidget::ShowToolTips())
txtNewDoc->SetToolTip(_("Full path to destination file without the extension; it is determined by the output type."));
itemBoxSizer1->Add(txtNewDoc, 1, wxGROW|wxALL, 5);
btnScan = new wxButton( itemPanel1, ID_Scan_BTN, _("Scan"), wxDefaultPosition, wxDefaultSize, 0 );
if (InsaneWidget::ShowToolTips())
btnScan->SetToolTip(_("'Left click' to start the scan project.\n'Right click' to show the scanner widget."));
itemBoxSizer1->Add(btnScan, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
////@end InsaneWidget content construction
}
/*
* Should we show tooltips?
*/
bool InsaneWidget::ShowToolTips()
{
return true;
}
/*
* Get bitmap resources
*/
wxBitmap InsaneWidget::GetBitmapResource( const wxString& name )
{
// Bitmap retrieval
////@begin InsaneWidget bitmap retrieval
wxUnusedVar(name);
return wxNullBitmap;
////@end InsaneWidget bitmap retrieval
}
/*
* Get icon resources
*/
wxIcon InsaneWidget::GetIconResource( const wxString& name )
{
// Icon retrieval
////@begin InsaneWidget icon retrieval
wxUnusedVar(name);
return wxNullIcon;
////@end InsaneWidget icon retrieval
}

View File

@@ -0,0 +1,97 @@
/////////////////////////////////////////////////////////////////////////////
// Name: InsaneWidget.h
// Purpose:
// Author: Saleem EDAH-TALLY
// Modified by:
// Created: dim. 15 juin 2025 19:37:17
// RCS-ID:
// Copyright: Copyright Saleem EDAH-TALLY. All rights reserved.
// Licence: CeCILL-C
/////////////////////////////////////////////////////////////////////////////
#ifndef _INSANEWIDGET_H_
#define _INSANEWIDGET_H_
/*!
* Includes
*/
////@begin includes
////@end includes
/*!
* Forward declarations
*/
////@begin forward declarations
////@end forward declarations
/*!
* Control identifiers
*/
////@begin control identifiers
#define ID_INSANEWIDGET 10000
#define ID_NewDoc_LBL 10014
#define ID_NewDoc_TXT 10005
#define ID_Scan_BTN 10006
#define SYMBOL_INSANEWIDGET_STYLE wxTAB_TRAVERSAL
#define SYMBOL_INSANEWIDGET_TITLE _("InsaneWidget")
#define SYMBOL_INSANEWIDGET_IDNAME ID_INSANEWIDGET
#define SYMBOL_INSANEWIDGET_SIZE wxSize(400, 300)
#define SYMBOL_INSANEWIDGET_POSITION wxDefaultPosition
////@end control identifiers
/*!
* InsaneWidget class declaration
*/
class InsaneWidget: public wxPanel
{
DECLARE_DYNAMIC_CLASS( InsaneWidget )
DECLARE_EVENT_TABLE()
public:
/// Constructors
InsaneWidget();
InsaneWidget( wxWindow* parent, wxWindowID id = SYMBOL_INSANEWIDGET_IDNAME, const wxPoint& pos = SYMBOL_INSANEWIDGET_POSITION, const wxSize& size = SYMBOL_INSANEWIDGET_SIZE, long style = SYMBOL_INSANEWIDGET_STYLE );
/// Creation
bool Create( wxWindow* parent, wxWindowID id = SYMBOL_INSANEWIDGET_IDNAME, const wxPoint& pos = SYMBOL_INSANEWIDGET_POSITION, const wxSize& size = SYMBOL_INSANEWIDGET_SIZE, long style = SYMBOL_INSANEWIDGET_STYLE );
/// Destructor
~InsaneWidget();
/// Initialises member variables
void Init();
/// Creates the controls and sizers
void CreateControls();
////@begin InsaneWidget event handler declarations
////@end InsaneWidget event handler declarations
////@begin InsaneWidget member function declarations
/// Retrieves bitmap resources
wxBitmap GetBitmapResource( const wxString& name );
/// Retrieves icon resources
wxIcon GetIconResource( const wxString& name );
////@end InsaneWidget member function declarations
/// Should we show tooltips?
static bool ShowToolTips();
////@begin InsaneWidget member variables
wxStaticText* lblNewDoc;
wxTextCtrl* txtNewDoc;
wxButton* btnScan;
////@end InsaneWidget member variables
};
#endif
// _INSANEWIDGET_H_

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1 @@
#include "wx/msw/wx.rc"

View File

@@ -0,0 +1,237 @@
/////////////////////////////////////////////////////////////////////////////
// Name: ScannerWidget.cpp
// Purpose:
// Author: Saleem EDAH-TALLY
// Modified by:
// Created: dim. 15 juin 2025 19:39:52
// RCS-ID:
// Copyright: Copyright Saleem EDAH-TALLY. All rights reserved.
// Licence: CeCILL-C
/////////////////////////////////////////////////////////////////////////////
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
////@begin includes
////@end includes
#include "ScannerWidget.h"
////@begin XPM images
////@end XPM images
/*
* ScannerWidget type definition
*/
IMPLEMENT_DYNAMIC_CLASS( ScannerWidget, wxPanel )
/*
* ScannerWidget event table definition
*/
BEGIN_EVENT_TABLE( ScannerWidget, wxPanel )
////@begin ScannerWidget event table entries
////@end ScannerWidget event table entries
END_EVENT_TABLE()
/*
* ScannerWidget constructors
*/
ScannerWidget::ScannerWidget()
{
Init();
}
ScannerWidget::ScannerWidget( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
{
Init();
Create(parent, id, pos, size, style);
}
/*
* ScannerWidget creator
*/
bool ScannerWidget::Create( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
{
////@begin ScannerWidget creation
SetExtraStyle(wxWS_EX_VALIDATE_RECURSIVELY);
wxPanel::Create( parent, id, pos, size, style );
CreateControls();
if (GetSizer())
{
GetSizer()->SetSizeHints(this);
}
Centre();
////@end ScannerWidget creation
return true;
}
/*
* ScannerWidget destructor
*/
ScannerWidget::~ScannerWidget()
{
////@begin ScannerWidget destruction
////@end ScannerWidget destruction
}
/*
* Member initialisation
*/
void ScannerWidget::Init()
{
////@begin ScannerWidget member initialisation
lblImageType = NULL;
cmbOutputType = NULL;
btnRefreshDevices = NULL;
lblDevices = NULL;
cmbDevices = NULL;
lblSource = NULL;
cmbSource = NULL;
lblMode = NULL;
cmbMode = NULL;
lblResolution = NULL;
cmbResolution = NULL;
lblPaperSize = NULL;
cmbPaperSize = NULL;
////@end ScannerWidget member initialisation
}
/*
* Control creation for ScannerWidget
*/
void ScannerWidget::CreateControls()
{
////@begin ScannerWidget content construction
ScannerWidget* itemPanel1 = this;
wxBoxSizer* itemBoxSizer1 = new wxBoxSizer(wxVERTICAL);
itemPanel1->SetSizer(itemBoxSizer1);
wxFlexGridSizer* itemFlexGridSizer2 = new wxFlexGridSizer(0, 2, 0, 0);
itemBoxSizer1->Add(itemFlexGridSizer2, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
lblImageType = new wxStaticText( itemPanel1, wxID_STATIC_IMAGE_TYPE, _("Format:"), wxDefaultPosition, wxDefaultSize, 0 );
itemFlexGridSizer2->Add(lblImageType, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxArrayString cmbOutputTypeStrings;
cmbOutputType = new wxComboBox( itemPanel1, ID_COMBOBOX_IMAGE_TYPE, wxEmptyString, wxDefaultPosition, wxDefaultSize, cmbOutputTypeStrings, wxCB_READONLY );
if (ScannerWidget::ShowToolTips())
cmbOutputType->SetToolTip(_("Output document format"));
itemFlexGridSizer2->Add(cmbOutputType, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxHORIZONTAL);
itemFlexGridSizer2->Add(itemBoxSizer5, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
btnRefreshDevices = new wxButton( itemPanel1, ID_BUTTON_REFRESH_DEVICES, wxGetTranslation(wxString() + (wxChar) 0x21BB), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT );
if (ScannerWidget::ShowToolTips())
btnRefreshDevices->SetToolTip(_("Refresh available devices"));
itemBoxSizer5->Add(btnRefreshDevices, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
lblDevices = new wxStaticText( itemPanel1, wxID_STATIC_DEVICES, _("Devices:"), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer5->Add(lblDevices, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxArrayString cmbDevicesStrings;
cmbDevices = new wxComboBox( itemPanel1, ID_COMBOBOX_Devices, wxEmptyString, wxDefaultPosition, wxDefaultSize, cmbDevicesStrings, wxCB_READONLY );
if (ScannerWidget::ShowToolTips())
cmbDevices->SetToolTip(_("Available devices"));
itemFlexGridSizer2->Add(cmbDevices, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);
lblSource = new wxStaticText( itemPanel1, wxID_STATIC_SOURCE, _("Source:"), wxDefaultPosition, wxDefaultSize, 0 );
itemFlexGridSizer2->Add(lblSource, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxArrayString cmbSourceStrings;
cmbSource = new wxComboBox( itemPanel1, ID_COMBOBOX_SOURCE, wxEmptyString, wxDefaultPosition, wxDefaultSize, cmbSourceStrings, wxCB_READONLY );
if (ScannerWidget::ShowToolTips())
cmbSource->SetToolTip(_("Scan source"));
itemFlexGridSizer2->Add(cmbSource, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);
lblMode = new wxStaticText( itemPanel1, wxID_STATIC_MODE, _("Mode:"), wxDefaultPosition, wxDefaultSize, 0 );
itemFlexGridSizer2->Add(lblMode, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxArrayString cmbModeStrings;
cmbMode = new wxComboBox( itemPanel1, ID_COMBOBOX_MODE, wxEmptyString, wxDefaultPosition, wxDefaultSize, cmbModeStrings, wxCB_READONLY );
if (ScannerWidget::ShowToolTips())
cmbMode->SetToolTip(_("Scan mode"));
itemFlexGridSizer2->Add(cmbMode, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);
lblResolution = new wxStaticText( itemPanel1, wxID_STATIC_RESOLUTION, _("Resolution:"), wxDefaultPosition, wxDefaultSize, 0 );
itemFlexGridSizer2->Add(lblResolution, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxArrayString cmbResolutionStrings;
cmbResolution = new wxComboBox( itemPanel1, ID_COMBOBOX_RESOLUTION, wxEmptyString, wxDefaultPosition, wxDefaultSize, cmbResolutionStrings, wxCB_READONLY );
if (ScannerWidget::ShowToolTips())
cmbResolution->SetToolTip(_("Scan resolution"));
itemFlexGridSizer2->Add(cmbResolution, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
lblPaperSize = new wxStaticText( itemPanel1, wxID_STATIC, _("Paper size:"), wxDefaultPosition, wxDefaultSize, 0 );
itemFlexGridSizer2->Add(lblPaperSize, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxArrayString cmbPaperSizeStrings;
cmbPaperSize = new wxComboBox( itemPanel1, ID_COMBOBOX, wxEmptyString, wxDefaultPosition, wxDefaultSize, cmbPaperSizeStrings, wxCB_READONLY );
itemFlexGridSizer2->Add(cmbPaperSize, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
itemFlexGridSizer2->AddGrowableCol(1);
////@end ScannerWidget content construction
}
/*
* Should we show tooltips?
*/
bool ScannerWidget::ShowToolTips()
{
return true;
}
/*
* Get bitmap resources
*/
wxBitmap ScannerWidget::GetBitmapResource( const wxString& name )
{
// Bitmap retrieval
////@begin ScannerWidget bitmap retrieval
wxUnusedVar(name);
return wxNullBitmap;
////@end ScannerWidget bitmap retrieval
}
/*
* Get icon resources
*/
wxIcon ScannerWidget::GetIconResource( const wxString& name )
{
// Icon retrieval
////@begin ScannerWidget icon retrieval
wxUnusedVar(name);
return wxNullIcon;
////@end ScannerWidget icon retrieval
}

View File

@@ -0,0 +1,116 @@
/////////////////////////////////////////////////////////////////////////////
// Name: ScannerWidget.h
// Purpose:
// Author: Saleem EDAH-TALLY
// Modified by:
// Created: dim. 15 juin 2025 19:39:52
// RCS-ID:
// Copyright: Copyright Saleem EDAH-TALLY. All rights reserved.
// Licence: CeCILL-C
/////////////////////////////////////////////////////////////////////////////
#ifndef _SCANNERWIDGET_H_
#define _SCANNERWIDGET_H_
/*!
* Includes
*/
////@begin includes
////@end includes
/*!
* Forward declarations
*/
////@begin forward declarations
////@end forward declarations
/*!
* Control identifiers
*/
////@begin control identifiers
#define ID_SCANNERWIDGET 10000
#define wxID_STATIC_IMAGE_TYPE 10031
#define ID_COMBOBOX_IMAGE_TYPE 10007
#define ID_BUTTON_REFRESH_DEVICES 10006
#define wxID_STATIC_DEVICES 10029
#define ID_COMBOBOX_Devices 10001
#define wxID_STATIC_SOURCE 10028
#define ID_COMBOBOX_SOURCE 10002
#define wxID_STATIC_MODE 10027
#define ID_COMBOBOX_MODE 10003
#define wxID_STATIC_RESOLUTION 10030
#define ID_COMBOBOX_RESOLUTION 10004
#define ID_COMBOBOX 10005
#define SYMBOL_SCANNERWIDGET_STYLE wxTAB_TRAVERSAL
#define SYMBOL_SCANNERWIDGET_TITLE _("ScannerWidget")
#define SYMBOL_SCANNERWIDGET_IDNAME ID_SCANNERWIDGET
#define SYMBOL_SCANNERWIDGET_SIZE wxSize(400, 300)
#define SYMBOL_SCANNERWIDGET_POSITION wxDefaultPosition
////@end control identifiers
/*!
* ScannerWidget class declaration
*/
class ScannerWidget: public wxPanel
{
DECLARE_DYNAMIC_CLASS( ScannerWidget )
DECLARE_EVENT_TABLE()
public:
/// Constructors
ScannerWidget();
ScannerWidget( wxWindow* parent, wxWindowID id = SYMBOL_SCANNERWIDGET_IDNAME, const wxPoint& pos = SYMBOL_SCANNERWIDGET_POSITION, const wxSize& size = SYMBOL_SCANNERWIDGET_SIZE, long style = SYMBOL_SCANNERWIDGET_STYLE );
/// Creation
bool Create( wxWindow* parent, wxWindowID id = SYMBOL_SCANNERWIDGET_IDNAME, const wxPoint& pos = SYMBOL_SCANNERWIDGET_POSITION, const wxSize& size = SYMBOL_SCANNERWIDGET_SIZE, long style = SYMBOL_SCANNERWIDGET_STYLE );
/// Destructor
~ScannerWidget();
/// Initialises member variables
void Init();
/// Creates the controls and sizers
void CreateControls();
////@begin ScannerWidget event handler declarations
////@end ScannerWidget event handler declarations
////@begin ScannerWidget member function declarations
/// Retrieves bitmap resources
wxBitmap GetBitmapResource( const wxString& name );
/// Retrieves icon resources
wxIcon GetIconResource( const wxString& name );
////@end ScannerWidget member function declarations
/// Should we show tooltips?
static bool ShowToolTips();
////@begin ScannerWidget member variables
wxStaticText* lblImageType;
wxComboBox* cmbOutputType;
wxButton* btnRefreshDevices;
wxStaticText* lblDevices;
wxComboBox* cmbDevices;
wxStaticText* lblSource;
wxComboBox* cmbSource;
wxStaticText* lblMode;
wxComboBox* cmbMode;
wxStaticText* lblResolution;
wxComboBox* cmbResolution;
wxStaticText* lblPaperSize;
wxComboBox* cmbPaperSize;
////@end ScannerWidget member variables
};
#endif
// _SCANNERWIDGET_H_