Created: 2014-05-19 15:03
Updated: 2018-07-13 06:53
License: zlib
c++

README.md

bubble

  • Bubble is a simple and lightweight C++11 dialog library.
  • Bubble creates dialogs boxes, progress bars and radio buttons.
  • Bubble replaces MessageBox() and notify dialogs with ease.
  • Bubble provides callbacks to update dialogs.
  • Bubble has an expressive API based on strings.
  • Bubble has no external dependencies. Only native OS calls are used.
  • Bubble is zlib/libpng licensed.

Samples

#include "bubble.hpp"

int main() {
    bubble::show(
        "title.text=About;"
        "body.icon=14;"
        "body.text=Your app name here;"
        "progress=0;"
        "footer.icon=-3;"
        "footer.text=Made with Bubble dialog library (built " __DATE__ ")",
        []( bubble::vars &ui ) {
            ui["progress"] = ui["progress"] + 10;
        } );

    bubble::notify("notify dialog, using icon #19", "hello world", 19);
}

Possible output

image

image

More samples

Check sample.cc for a few examples

image

image

image

Cons

  • Windows only (for now).

API

  • int bubble::show( string options, [callback] )
  • int bubble::show( map<string,string> options, [callback] )

Variables

  • timeout (int ms) in milliseconds; [0] to stay forever
  • progress (int pct) [0..100] range; [-1] creates an infinite marquee
  • title.text (string)
  • head.text (string)
  • body.icon (int) see note below
  • body.text (string)
  • footer.icon (int) see note below
  • footer.text (string)
  • style.minimizable (bool)
  • style.command_links (bool)
  • style.skippable (bool)
  • style.minimized (bool)
  • style.ontop (bool)
  • exit (int) to close dialog and return exit code from callback
  • [number].text (string)
  • [number].icon (int) see note below

Win32 icons

  • valid icons are in range {-1 = information, -2 = warning, -3 = error, -4 = admin/shield }
  • also in range [1..255] which maps to icons in imageres.dll, as follows:

image

Changelog

  • v1.1.0 (2015/09/25)
    • Add notify / taskbar dialogs
  • v1.0.0 (2015/06/12)
    • Diverse enhancements and clean ups
  • v0.0.0 (2014/xx/xx)
    • Initial commit
Cookies help us deliver our services. By using our services, you agree to our use of cookies Learn more