Skip to content

Instantly share code, notes, and snippets.

View vadz's full-sized avatar

VZ vadz

View GitHub Profile
@vadz
vadz / transparent_textctrl.cpp
Created April 6, 2024 23:22
Example of a "transparent" wxTextCtrl under Windows
#include <wx/app.h>
#include <wx/artprov.h>
#include <wx/custombgwin.h>
#include <wx/dcclient.h>
#include <wx/frame.h>
#include <wx/sizer.h>
#include <wx/textctrl.h>
#include <wx/msw/private.h>
@vadz
vadz / build-glibc.yml
Created March 20, 2024 00:08
Workflow to build glibc-2.28 under Ubuntu 18.04
# Build glibc 2.28 under Ubuntu 18.04 to be able to use it with node 20.
name: Build glibc 2.28 under Ubuntu 18.04
on:
push:
jobs:
test:
runs-on: ubuntu-latest
container: ubuntu:18.04
@vadz
vadz / splitter.cpp
Created March 19, 2024 16:46
Example of using `wxSplitterWindow`
#include <wx/app.h>
#include <wx/frame.h>
#include <wx/splitter.h>
#include <wx/textctrl.h>
class TextCtrlShowingSize : public wxTextCtrl {
public:
explicit TextCtrlShowingSize(wxWindow* parent) : wxTextCtrl(parent, wxID_ANY, {}) {
Bind(wxEVT_SIZE, [this](wxSizeEvent& event) {
auto size = event.GetSize();
@vadz
vadz / aui-tabart.cpp
Created March 16, 2024 17:24
Example of using custom tab art with wxAUI
#include <wx/app.h>
#include <wx/dc.h>
#include <wx/frame.h>
#include <wx/panel.h>
#include <wx/sizer.h>
#include <wx/textctrl.h>
#include <wx/aui/aui.h>
class TestDockArt : public wxAuiDefaultDockArt {
@vadz
vadz / aui-dockart.cpp
Created March 16, 2024 17:18
Example of defining a custom dock art provider
#include <wx/app.h>
#include <wx/dc.h>
#include <wx/frame.h>
#include <wx/panel.h>
#include <wx/sizer.h>
#include <wx/textctrl.h>
#include <wx/aui/aui.h>
class TestDockArt : public wxAuiDefaultDockArt {
@vadz
vadz / aui-panel.cpp
Created March 16, 2024 17:10
Example of using AUI with a panel (and not a frame)
#include <wx/app.h>
#include <wx/frame.h>
#include <wx/panel.h>
#include <wx/sizer.h>
#include <wx/textctrl.h>
#include <wx/aui/aui.h>
class TestPanel : public wxPanel {
public:
@vadz
vadz / tst.cpp
Created March 16, 2024 16:54
Example of using layered window with wxWidgets
// This is a simple example of a wxWidgets application using window without the
// standard "chrome", i.e. title bar and borders.
//
// With MSVS you can use the provided solution file to build it. With other
// compilers, remmeber to link against dwmapi.lib in addition to all the rest.
#include "wx/app.h"
#include "wx/button.h"
#include "wx/dcclient.h"
#include "wx/frame.h"
#include "wx/graphics.h"
@vadz
vadz / fix_wl_display_flush.c
Created October 3, 2023 22:50
LD-preloadable library preventing GTK from killing applications using it under Wayland
/*
Build with
$ cc -Wall -O2 -fPIC -shared -o libfix_wl_display_flush.so fix_wl_display_flush.c
Use as
$ LD_PRELOAD=libfix_wl_display_flush.so ./app
*/
#define _GNU_SOURCE
@vadz
vadz / winloc.cpp
Created June 10, 2021 18:34
Show value of some, or all, MSW locale settings
#define UNICODE
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <strsafe.h>
#include <stdio.h>
#include <string.h>
#include <wchar.h>
struct LocaleOption
@vadz
vadz / metrics.md
Last active March 28, 2021 12:31
Some MSW System Metrics
Metric Win 7 Win 10 Win 10 125% Win 10 150% Win 10 175% Win 10 200%
SM_CXBORDER 1 1 1 1 1 1
SM_CXHTHUMB 17 17 21 26 30 34
SM_CXHSCROLL 17 17 21 26 30 34
SM_CXICONSPACING 75 75 94 113 131 150
SM_CXEDGE 2 2 2 2 2 2
SM_CXMENUCHECK 15 15 19 25 29 31
SM_CXFOCUSBORDER 1 1 1 1 1 1
SM_CXPADDEDBORDER 1 4 5 6 7 8