Skip to content

ClassicPad is a lightweight, classic Notepad-inspired text editor written in C# WinForms. It recreates the familiar Windows Notepad workflow menus, dialogs, shortcuts, and printing while targeting modern .NET runtimes.

License

Notifications You must be signed in to change notification settings

swigerb/classicpad

ClassicPad

ClassicPad is a lightweight, classic Notepad-inspired text editor written in C# WinForms. It recreates the familiar Windows Notepad workflowβ€”menus, dialogs, shortcuts, and printingβ€”while targeting modern .NET runtimes. The project is intentionally split into focused source files so each component stays easy to navigate and maintain.

Highlights

  • πŸ“ Full Notepad-style menu surface (File, Edit, Format, View, Help) with working verbs and keyboard accelerators.
  • πŸ” Modeless Find/Replace, Find Next/Previous, and Go To line navigation with wrap-around search.
  • πŸ“„ Drag-and-drop loading, multi-instance launch, rich clipboard integration, and automatic dirty tracking.
  • πŸ”‘ Word Wrap, custom fonts, and zoom controls (including Ctrl+Plus/Minus/0 shortcuts) plus optional status bar.
  • πŸ–¨οΈ Page setup, printing, and a bundled classic notepad-style application icon (Assets/classicpad.ico).
  • πŸ› οΈ Clean architecture using WinForms partial classes (MainWindow.*) and focused services (printing, dialogs, search).

Requirements

  • Windows 10 version 19041 or later.
  • .NET 8 SDK (Desktop workload).
  • Visual Studio 2022, VS Code, or any editor that can build .NET desktop projects.

Building & Running

# Clone your repo, then:
cd classicpad
dotnet build         # Produces bin/Debug/.../classicpad.exe
dotnet run           # Launches ClassicPad directly

The compiled binary lives at ClassicPad/bin/<Configuration>/net8.0-windows10.0.19041.0/classicpad.exe. Copy the entire folder (the EXE plus dependencies) to redistribute.

Project Layout

ClassicPad/
β”œβ”€β”€ App/                # Application bootstrap and session state
β”œβ”€β”€ Assets/             # classicpad.ico
β”œβ”€β”€ Dialogs/            # Find, Replace, Go To modal forms
β”œβ”€β”€ Printing/           # TextPrintDocument for paginated output
β”œβ”€β”€ Services/           # Search contracts + Find/Replace orchestration
β”œβ”€β”€ UI/
β”‚   β”œβ”€β”€ MainWindow.Core.cs            # Shell, menus, status bar, drag/drop, shortcuts
β”‚   β”œβ”€β”€ MainWindow.FileCommands.cs    # File/open/save/print logic
β”‚   └── MainWindow.EditViewHelpCommands.cs # Edit/View/Help verbs and search helpers
└── classicpad.cs       # Entry point (STA)

Each file stays under ~500 LOC and includes sparse, high-signal comments when additional context helps future contributors.

Keyboard & Menu Tips

Command Shortcut(s)
New / Open / Save Ctrl+N, Ctrl+O, Ctrl+S
Find / Replace Ctrl+F, Ctrl+H
Find Next / Previous F3, Shift+F3
Go To Line Ctrl+G (disabled when Word Wrap)
Time/Date stamp F5
Zoom In / Out / Reset Ctrl++, Ctrl+-, Ctrl+0
Toggle Word Wrap Format β†’ Word Wrap
Toggle Status Bar View β†’ Status Bar (wrap off only)

Tests

dotnet test

This command runs two suites:

  • ClassicPad.Tests exercises logic-only components such as DocumentSession.
  • ClassicPad.UITests is an STA-aware WinForms harness that instantiates dialogs/forms to verify layout guarantees (e.g., editor placement and button sizing) without needing external automation drivers.

Creating an MSI installer

ClassicPad ships with a WiX-based packaging script so you can generate a Windows Installer MSI without leaving the repo:

  1. Install the WiX CLI once per machine: dotnet tool install --global wix.

  2. Run the helper script (PowerShell):

    pwsh ./scripts/build-installer.ps1 -Version "1.0.0"

The script publishes the WinForms app to artifacts/publish/<RID> and then calls WiX to emit artifacts/installer/ClassicPad-<version>-<rid>.msi. Additional parameters let you override configuration, runtime identifier, product name, and manufacturer if needed (pwsh ./scripts/build-installer.ps1 -? shows the defaults).

Contributing

Contributions are welcome! See CONTRIBUTING.md for branching, coding-style, and testing guidance. Please review the Code of Conduct before participating.

License

ClassicPad is licensed under the MIT License.

About

ClassicPad is a lightweight, classic Notepad-inspired text editor written in C# WinForms. It recreates the familiar Windows Notepad workflow menus, dialogs, shortcuts, and printing while targeting modern .NET runtimes.

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks