DlangUI

Cross Platform GUI for D programming language

Home API Docs Screenshots Download .zip View on GitHub

dlangui.widgets.popup

This module contains popup widgets implementation.

Popups appear above other widgets inside window.

Useful for popup menus, notification popups, etc.

Synopsis:
import dlangui.widgets.popup;



License:
Boost License 1.0

Authors:
Vadim Lopatin, coolreader.org@gmail.com

enum PopupAlign: uint;
popup alignment option flags

Center
center popup around anchor widget center

Below
place popup below anchor widget close to lower bound

Right
place popup below anchor widget close to right bound (when no space enough, align near left bound)

Point
align to specified point

FitAnchorSize
if popup content size is less than anchor's size, increase it to anchor size

enum PopupFlags: uint;
popup behavior flags - for PopupWidget.flags property

CloseOnClickOutside
close popup when mouse button clicked outside of its bounds

interface OnPopupCloseHandler;
interface - slot for onPopupCloseListener

class PopupWidget: dlangui.widgets.layouts.LinearLayout;
popup widget container

Signal!OnPopupCloseHandler onPopupCloseListener;
popup close signal

@property uint flags();
popup close listener (called right before closing)

set popup close listener (to call right before closing)

returns popup behavior flags (combination of PopupFlags)

@property PopupWidget flags(uint flags);
set popup behavior flags (combination of PopupFlags)

@property ref PopupAnchor anchor();
access to popup anchor

bool modal();
returns true if popup is modal

PopupWidget modal(bool modal);
set modality flag

void measure(int parentWidth, int parentHeight);
Measure widget according to desired width and height constraints. (Step 1 of two phase layout).

void close();
close and destroy popup

void onClose();
just call on close listener

void layout(Rect rc);
Set widget rectangle to specified value and layout widget contents. (Step 2 of two phase layout).

bool onMouseEventOutside(MouseEvent event);
called for mouse activity outside shown popup bounds