Commits on Oct 14, 2016
  1. pdNewOld: a new control for side-by-side comparisons...

    ...between any arbitrary "new" and "old" element.  (The elements
    themselves are owner-drawn.)
    At present, this control is used by the color selection dialog to
    present the original and newly selected colors side-by-side.  The color
    dialog does not yet color-manage these results.  (That's still "to-do".)
    Also included in this commit is an update for pdColorWheel, which
    improves responsiveness during user interaction or color change
    committed Oct 14, 2016
Commits on Oct 13, 2016
  1. Tooltips: final layer of visual polish

    - Animations are now implemented
    - Tooltips are now hidden on a slight delay, rather than "snapping" out
    of view
    - If the user moves the mouse over a control obscured by the current
    tooltip, the tooltip is immediately hidden
    - If a control changes tooltip text while a tooltip is already active
    (like the color palette control), we don't waste time on animations;
    instead, we immediately update the text and reposition the tip to match.
    - Minor refactoring and code cleanup of some old paths that are no
    longer relevant
    committed Oct 13, 2016
Commits on Oct 12, 2016
  1. Fix potential crash when many tooltips are raised in a session

    Compiled vs IDE behavior is notably different here.  Crashes should now
    be fixed for both versions.
    committed Oct 12, 2016
Commits on Sep 30, 2016
  1. Color selection dialog: overhaul HSV sliders

    The new HSV sliders are standard pdSlider controls, and the new
    owner-draw mode is used to render custom HSV gradients on-the-fly.  This
    means the color selection dialog is *finally* usable on a dark theme.
    Also, performance of the dialog is now much better, thanks to all the
    recent pdSlider improvements.
    Next up for this dialog?  A new custom-built control for the "recent
    colors" area.  Besides obeying the same UI behavior as everything else
    in the program, I want a control like this for use in other places, to
    make it easy to display an owner-drawn "history" of anything in the
    committed Sep 30, 2016
  2. pdSlider: implement owner-draw mode

    Also, additional optimizations to improve rendering performance.
    This is required for the HSV sliders on the color selection dialog.
    committed Sep 30, 2016
  3. pdDIB: heavily optimize alpha channel transfers

    For some UI elements (like pdSliders with color gradients in their
    tracks), we steal alpha values from a reference DIB and apply them
    on-the-fly to some other DIB.  This greatly simplifies rendering, as we
    only have to create the alpha mask once.
    The routine that handles the transfer has been heavily optimized, and if
    the reference alpha mask only deals in binary alpha channels (meaning
    fully opaque or fully transparent pixels only), it's *extra* fast.
    committed Sep 30, 2016
  4. Increase aggressiveness of freeing pdDIB objects from their DCs

    pdDIB will automatically select its underlying DIB into a DC as
    necessary (basically, whenever an outside caller attempts to perform
    something like BitBlt on it).  However, it can't auto-magically free its
    hDC, as it doesn't know when the caller is done with rendering.
    To help remedy this, I've added manual .FreeFromDC calls in a few more
    relevant places.  In particular, DIB resources (loaded from the .exe)
    are now returned without an active DC, which is great for things like
    cached UI elements, as their DC will no longer be created until they are
    actually rendered to screen.
    committed Sep 30, 2016
  5. pdSlider: finalize rendering of new visual style option

    Looks pretty good, I think!
    I debated separating this out into its own control, as I didn't want to
    clutter up pdSlider's code, but I think this was ultimately the right
    choice.  pdSlider's behavior has been fine-tuned very specifically, and
    this approach guarantees that color sliders behave identically.
    committed Sep 30, 2016
  6. pdSlider: new visual style property

    Sometimes, pdSlider is used to select a particular color from a given
    range of colors.  (Often, the range of colors is a smooth gradient, and
    the slider selects a point along that gradient.)  An automatic
    "gradient" visual property lets the caller render a background gradient,
    to make the control's purpose very clear.
    Unfortunately, the current visual design uses the slider knob to overlay
    the currently selected position, which obscures the color underneath.
    In most cases this isn't a big deal (as color specificity isn't really
    the point), but in the actual color selection dialog, it's a problem.
    Color specificity is the whole point!
    To that end, this commit adds a new visual style option for the slider,
    where instead of rendering the knob as a filled circle, the knob becomes
    a hollow rectangle.  This allows the currently selected position to be
    seen clearly.
    I want to do a bit more tweaking to the slider's background for this
    style, but this commit at least works (and the slider is still fully
    committed Sep 30, 2016
Commits on Sep 28, 2016
  1. Color selector: switch to pdColorWheel

    Eventually, the goal is to make both sides of this dialog user-swappable
    (with support for swatches and other color selection methods), but for
    now, I just want to migrate everything to a theme- and
    high-DPI-compatible implementation.
    Converting the left-hand side to an existing control is an easy way to
    jumpstart this.  Among other benefits, redraw speed is vastly improved
    over the old system.
    committed Sep 28, 2016
Commits on Sep 27, 2016
  1. Updated German language file

    c/o Roy K.  Thank you, Roy!
    committed Sep 27, 2016
  2. Minor bugfixes

    This commit fixes minor rendering issues of button tooltips (the font
    object needs to be manually reset to left-alignment), and the main
    canvas at program shut down (it was incorrectly suspending rendering at
    the wrong shutdown phase).
    Also, I've confirmed that the source of user object leaking at shutdown
    is the self-subclassing class.  I've been meaning to switch to the
    standard common-control-based subclasser, and this provides a good
    reason to do it sooner rather than later.
    Such a switch first requires a rewrite of the color selection dialog
    (which currently uses a bunch of outdated control approaches,
    incompatible with the new subclasser), but that's not a bad thing as I
    needed to redesign the color selector anyway to make it theme- and
    In the meantime, this commit makes some additional minor subclassing
    changes to prepare for the rewrite.
    committed Sep 27, 2016
  3. Fix color wheel rendering

    committed Sep 27, 2016
Commits on Sep 26, 2016
  1. Continue expanding pdDebug tracking capabilities

    Timers and hooks are now tracked internally, and a number of functions
    have been hardened against potential errors.
    committed Sep 26, 2016
  2. pdDebug: start implementing more detailed leak detection

    I'm detecting weird user object spikes at program shutdown, which is
    possibly indicative of a deeper problem.
    In this commit, I've increased tracking detail of program-created icons
    and API windows, both of which look good according to internal tracking.
    (This did turn up a minor leak with custom form icons, which has been
    I've also fixed some tracking issues with edit boxes created at
    run-time, and hardened a number of internal functions against possible
    IDE-related issues.  Still haven't found the source of the shutdown user
    object spikes, but I'll continue looking.
    committed Sep 26, 2016
Commits on Sep 25, 2016
  1. Fix tooltip parsing errors in lang file generator

    Using the word "tooltip" in an end-of-line comment was breaking the
    parser; oops!
    committed Sep 25, 2016
  2. Tooltips: improve positioning algorithm

    Tooltips are now correctly moved on-screen, as necessary, and their
    position is automatically placed as close to the mouse's hover position
    as physically possible.
    (Another UI project down!)
    committed Sep 25, 2016
  3. Master UI class: free DCs after controls raise a redraw request

    There's no penalty to doing this, as DCs are autogenerated as needed.
    There is a nice benefit, however, if a control requests a redraw, but
    the system doesn't generate an immediate paint event (because the
    control is hidden, for example).  This is particularly useful at startup
    time, as many controls are initialized, but not ultimately displayed
    On a cold start, this reduces GDI object count by 245.  The resulting
    count is less than not just PD 6.6, but PD 6.4 as well.
    committed Sep 25, 2016
  4. Tooltips: restore translation support

    Also, purge the old pdTooltip class, which is no longer needed as the
    master user control support class handles tooltips now.  (Windows system
    tooltip code is no longer required.)
    committed Sep 25, 2016
  5. Restore GDI DC tracking

    Not sure when this disappeared; now it's back, at least!
    committed Sep 25, 2016
Commits on Sep 23, 2016
  1. pdTooltip: implement rendering

    Tooltip positioning still needs to be optimized (for example, no checks
    are currently performed to prevent displaying off-screen), but tooltip
    window management and rendering are finally working well.  (Translations
    are not yet applied, but that's a quick fix.)
    Also note that so far I've only tested Win 10.  Things may be weird on
    XP and/or Vista; testing them is TODO.
    This was the single largest remaining item on the "reduce user and GDI
    object" checklist.  Standard Windows tooltips leak like a sieve when
    intermixed with self-subclassing VB methods (because tooltips also
    subclass their target objects, and their common-control-based
    subclassing does not play nicely with Paul Caton's approach).  Just the
    *assignment* of a tooltip resulted in the creation of a user object and
    two GDI objects, and those resources could potentially leak any time a
    tooltip was displayed or changed.  (As noted in previous commits,
    changes to the Title property of a tooltip would cause an additional
    *4-6* GDI objects to leak!)
    Thus, switching to a custom tooltip implementation is a big deal.  By my
    accounting, this cuts cold-start user objects by ~150 (662 to 514), and
    GDI objects by nearly ~200 (1278 to 1081).  This is a lower user object
    count than PD 6.6 (626) and a GDI count that is nearly *half* of what it
    was in 6.6 (1081 vs 1981).  And all this despite moving to a fully
    owner-drawn UI, with double-buffering for all display elements.
    committed Sep 23, 2016
Commits on Sep 22, 2016
  1. pdTooltip: get basic show/hide behavior working

    Any time we're forced to mess with window bits at runtime, the potential
    for crashing skyrockets.  AFAICT, this commit nails down the proper
    order and set of changes required to raise a tooltip-like window without
    stealing focus, screwing up z-order, or causing VB to throw a hissy fit.
    Next up is calculating ideal display position, based on the mouse
    position, underlying control, and actual tooltip text.
    committed Sep 22, 2016
Commits on Sep 20, 2016
  1. PD controls: implement mouse hover events

    These are required for a forthcoming custom-built tooltip solution.
    committed Sep 20, 2016
Commits on Sep 19, 2016
  1. Fix theme accent color caching

    Accent color is now remembered when switching between light and dark
    committed Sep 19, 2016
  2. Layer box UI: heavily optimize thumbnail caching

    Multi-layer images should now be much more responsive when making
    changes to a single layer.
    committed Sep 19, 2016
  3. Layer box UI: restore mousewheel support

    Also, some high-DPI fixes.
    Next up: optimizing layer thumbnail caching, so we don't have to update
    *all* layer thumbnails if only *one* layer changes.
    committed Sep 19, 2016
Commits on Sep 18, 2016
  1. Layer UI: reinstate scroll bar when many layers are present

    Additional note: this layer UI overhaul reduced cold-start GDI object
    count by another~20 objects.
    Still to-do is mousewheel support, but that's trivial now that a scroll
    bar is correctly integrated.
    committed Sep 18, 2016
  2. Language files: update against layer changes

    The recent layer UI improvements reduced a number of redundant
    translations, so that's always nice.
    Thank you as well to Roy K for supplying additional Google Translate
    language files for new languages!
    committed Sep 18, 2016
  3. Layer UI: overhaul completely

    Building off the last commit, there are now no hover-only elements in
    the layer list box.  This makes that area much more touch-friendly,
    while also reducing visual clutter.  (Note that the plan is to move the
    removed UI items to a right-click menu; that is still TODO.)
    The new layer box layout is much closer to the competition, with the
    visibility toggle moved next to the edit area, thumbnails slightly
    shrunk, and much more room for the layer name.  Clickable regions have
    been enlarged, and the visibility toggle in particular now received a
    hover border, to let users know that it's clickable (in keeping with all
    other clickable UI elements in the project).
    The last thing left to solve here is reinstating the scroll bar for
    images with many layers.
    committed Sep 18, 2016
Commits on Sep 17, 2016
  1. Start total overhaul of primary layer list UI

    This old hunk of junk has not yet been integrated into the new theming
    engine.  It is also not really high-DPI aware, it's drawn using a bunch
    of unsafe subclassing, and it uses things like hover elements which are
    not really ideal for our modern touch-centric world.
    So it's time for an overhaul.  Among other things, the goal is to make
    the layer list box:
    1) Themable
    2) High-DPI aware
    3) Touch-friendly
    4) Make better use of space
    5) Less crash-prone (there's a lot of unsafe subclassing going on now)
    6) Less resource-intensive (it uses a ton of custom graphics in dumb
    7) More responsive (*very* important for paint tools)
    A number of these items have already been accomplished in this initial
    commit.  The bulk of the control has been migrated to a new user
    control, rendering has been rewritten against PD's master user control
    support class, and theming has been enabled.
    Next up is restoring scroll behavior (there is no embedded scroll bar at
    present), and redesigning the individual layer blocks to not rely on
    hover behavior.
    committed Sep 17, 2016
Commits on Sep 10, 2016
  1. Overhaul Adjustments > Color > Temperature tool

    - A new "basic" method is available, which provides a generic
    temperature transform using an identical algorithm to the tint
    - The "exact"  method remains available, but it has been rewritten to
    use a new temperature transform, c/o
    committed Sep 10, 2016
  2. Fix the way metadata export preferences work

    Metadata export preferences now work the same way as all other export
    settings.  They are stored on a per-format basis, with last-used
    settings automatically saved/loaded on each invocation.
    This means there is now just one metadata export preference in the Tools
    > Options dialog: marking PD as the last-used software.  (Note that even
    if this setting is enabled, it will be ignored if the "anonymize
    metadata" setting is clicked at export time.)
    committed Sep 10, 2016
  3. Optimize translation engine startup

    Now that we support so many language files, translation engine startup
    had begun to occupy a large portion of the program initialization time.
    Some minor tweaks dropped average time on my development PC from ~1.2
    seconds to ~0.3 seconds, so a solid improvement.
    committed Sep 10, 2016
  4. Update all translation files against the latest nightly builds

    Many thanks to Roy K for handling this.  It's a time-consuming effort to
    keep these up-to-date, so I only do it sporadically.  It's a huge help
    when someone else tackles it.  Thanks, Roy!
    committed Sep 10, 2016