Panda3D
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
PGFrameStyle Class Reference

Public Types

enum  Type {
  T_none , T_flat , T_bevel_out , T_bevel_in ,
  T_groove , T_ridge , T_texture_border
}
 

Public Member Functions

 PGFrameStyle (const PGFrameStyle &copy)
 
void clear_texture ()
 Removes the texture from the frame.
 
NodePath generate_into (const NodePath &parent, const LVecBase4 &frame, int sort=0)
 Generates geometry representing a frame of the indicated size, and parents it to the indicated node, with the indicated scene graph sort order.
 
LColor get_color () const
 Returns the dominant color of the frame.
 
LVecBase4 get_internal_frame (const LVecBase4 &frame) const
 Computes the size of the internal frame, given the indicated external frame, appropriate for this kind of frame style.
 
Textureget_texture () const
 Returns the texture that has been applied to the frame, or NULL if no texture has been applied.
 
Type get_type () const
 Returns the basic type of frame.
 
const LVecBase2 & get_uv_width () const
 See set_uv_width().
 
const LVecBase2 & get_visible_scale () const
 Returns the scale factor on the visible representation of the frame, in the X and Y directions.
 
const LVecBase2 & get_width () const
 Returns the width parameter, which has meaning only for certain frame types.
 
bool has_texture () const
 Returns true if a texture has been applied to the frame.
 
void operator= (const PGFrameStyle &copy)
 
void output (std::ostream &out) const
 
void set_color (const LColor &color)
 Sets the dominant color of the frame.
 
void set_color (PN_stdfloat r, PN_stdfloat g, PN_stdfloat b, PN_stdfloat a)
 Sets the dominant color of the frame.
 
void set_texture (Texture *texture)
 Specifies a texture that should be applied to the frame.
 
void set_type (Type type)
 Sets the basic type of frame.
 
void set_uv_width (const LVecBase2 &uv_width)
 Sets the uv_width parameter, which indicates the amount of the texture that is consumed by the inner bevel–the width in texture space of the amount indicated by set_width.
 
void set_uv_width (PN_stdfloat u, PN_stdfloat v)
 Sets the uv_width parameter, which indicates the amount of the texture that is consumed by the inner bevel–the width in texture space of the amount indicated by set_width.
 
void set_visible_scale (const LVecBase2 &visible_scale)
 Sets a scale factor on the visible representation of the frame, in the X and Y directions.
 
void set_visible_scale (PN_stdfloat x, PN_stdfloat y)
 Sets a scale factor on the visible representation of the frame, in the X and Y directions.
 
void set_width (const LVecBase2 &width)
 Sets the width parameter, which has meaning only for certain frame types.
 
void set_width (PN_stdfloat x, PN_stdfloat y)
 Sets the width parameter, which has meaning only for certain frame types.
 
bool xform (const LMatrix4 &mat)
 Applies the indicated transform to the FrameStyle.
 

Detailed Description

Definition at line 29 of file pgFrameStyle.h.

Member Enumeration Documentation

◆ Type

enum PGFrameStyle::Type

Definition at line 37 of file pgFrameStyle.h.

Constructor & Destructor Documentation

◆ PGFrameStyle() [1/2]

PGFrameStyle::PGFrameStyle ( )
inline

Definition at line 17 of file pgFrameStyle.I.

◆ PGFrameStyle() [2/2]

PGFrameStyle::PGFrameStyle ( const PGFrameStyle & copy)
inline

Definition at line 29 of file pgFrameStyle.I.

◆ ~PGFrameStyle()

PGFrameStyle::~PGFrameStyle ( )
inline

Definition at line 56 of file pgFrameStyle.I.

Member Function Documentation

◆ clear_texture()

void PGFrameStyle::clear_texture ( )
inline

Removes the texture from the frame.

Definition at line 128 of file pgFrameStyle.I.

◆ generate_into()

NodePath PGFrameStyle::generate_into ( const NodePath & parent,
const LVecBase4 & frame,
int sort = 0 )

Generates geometry representing a frame of the indicated size, and parents it to the indicated node, with the indicated scene graph sort order.

The return value is the generated NodePath, if any, or an empty NodePath if nothing is generated.

Definition at line 152 of file pgFrameStyle.cxx.

References NodePath::attach_new_node().

◆ get_color()

LColor PGFrameStyle::get_color ( ) const
inline

Returns the dominant color of the frame.

Definition at line 95 of file pgFrameStyle.I.

◆ get_internal_frame()

LVecBase4 PGFrameStyle::get_internal_frame ( const LVecBase4 & frame) const

Computes the size of the internal frame, given the indicated external frame, appropriate for this kind of frame style.

This simply subtracts the border width for those frame styles that include a border.

Definition at line 69 of file pgFrameStyle.cxx.

Referenced by PGScrollFrame::remanage().

◆ get_texture()

Texture * PGFrameStyle::get_texture ( ) const
inline

Returns the texture that has been applied to the frame, or NULL if no texture has been applied.

Definition at line 120 of file pgFrameStyle.I.

Referenced by PT().

◆ get_type()

PGFrameStyle::Type PGFrameStyle::get_type ( ) const
inline

Returns the basic type of frame.

Definition at line 71 of file pgFrameStyle.I.

◆ get_uv_width()

const LVecBase2 & PGFrameStyle::get_uv_width ( ) const
inline

See set_uv_width().

Definition at line 186 of file pgFrameStyle.I.

◆ get_visible_scale()

const LVecBase2 & PGFrameStyle::get_visible_scale ( ) const
inline

Returns the scale factor on the visible representation of the frame, in the X and Y directions.

If this scale factor is other than 1, it will affect the size of the visible frame representation within the actual frame border.

Definition at line 217 of file pgFrameStyle.I.

◆ get_width()

const LVecBase2 & PGFrameStyle::get_width ( ) const
inline

Returns the width parameter, which has meaning only for certain frame types.

For instance, this is the width of the bevel for T_bevel_in or T_bevel_out. The units are in screen units.

Definition at line 158 of file pgFrameStyle.I.

◆ has_texture()

bool PGFrameStyle::has_texture ( ) const
inline

Returns true if a texture has been applied to the frame.

Definition at line 111 of file pgFrameStyle.I.

Referenced by PT().

◆ operator=()

void PGFrameStyle::operator= ( const PGFrameStyle & copy)
inline

Definition at line 43 of file pgFrameStyle.I.

◆ output()

void PGFrameStyle::output ( std::ostream & out) const

Definition at line 97 of file pgFrameStyle.cxx.

◆ set_color() [1/2]

void PGFrameStyle::set_color ( const LColor & color)
inline

Sets the dominant color of the frame.

Definition at line 87 of file pgFrameStyle.I.

◆ set_color() [2/2]

void PGFrameStyle::set_color ( PN_stdfloat r,
PN_stdfloat g,
PN_stdfloat b,
PN_stdfloat a )
inline

◆ set_texture()

void PGFrameStyle::set_texture ( Texture * texture)
inline

Specifies a texture that should be applied to the frame.

Definition at line 103 of file pgFrameStyle.I.

◆ set_type()

void PGFrameStyle::set_type ( PGFrameStyle::Type type)
inline

◆ set_uv_width() [1/2]

void PGFrameStyle::set_uv_width ( const LVecBase2 & uv_width)
inline

Sets the uv_width parameter, which indicates the amount of the texture that is consumed by the inner bevel–the width in texture space of the amount indicated by set_width.

Definition at line 178 of file pgFrameStyle.I.

◆ set_uv_width() [2/2]

void PGFrameStyle::set_uv_width ( PN_stdfloat u,
PN_stdfloat v )
inline

Sets the uv_width parameter, which indicates the amount of the texture that is consumed by the inner bevel–the width in texture space of the amount indicated by set_width.

Definition at line 168 of file pgFrameStyle.I.

References set_uv_width().

Referenced by set_uv_width().

◆ set_visible_scale() [1/2]

void PGFrameStyle::set_visible_scale ( const LVecBase2 & visible_scale)
inline

Sets a scale factor on the visible representation of the frame, in the X and Y directions.

If this scale factor is other than 1, it will affect the size of the visible frame representation within the actual frame border.

Definition at line 206 of file pgFrameStyle.I.

◆ set_visible_scale() [2/2]

void PGFrameStyle::set_visible_scale ( PN_stdfloat x,
PN_stdfloat y )
inline

Sets a scale factor on the visible representation of the frame, in the X and Y directions.

If this scale factor is other than 1, it will affect the size of the visible frame representation within the actual frame border.

Definition at line 196 of file pgFrameStyle.I.

References set_visible_scale().

Referenced by set_visible_scale(), and PGSliderBar::setup_slider().

◆ set_width() [1/2]

void PGFrameStyle::set_width ( const LVecBase2 & width)
inline

Sets the width parameter, which has meaning only for certain frame types.

For instance, this is the width of the bevel for T_bevel_in or T_bevel_out. The units are in screen units.

Definition at line 148 of file pgFrameStyle.I.

◆ set_width() [2/2]

void PGFrameStyle::set_width ( PN_stdfloat x,
PN_stdfloat y )
inline

Sets the width parameter, which has meaning only for certain frame types.

For instance, this is the width of the bevel for T_bevel_in or T_bevel_out. The units are in screen units.

Definition at line 138 of file pgFrameStyle.I.

References set_width().

Referenced by set_width(), PGButton::setup(), PGEntry::setup(), PGVirtualFrame::setup(), PGScrollFrame::setup(), PGWaitBar::setup(), PGSliderBar::setup_scroll_bar(), and PGSliderBar::setup_slider().

◆ xform()

bool PGFrameStyle::xform ( const LMatrix4 & mat)

Applies the indicated transform to the FrameStyle.

The return value is true if the frame style is transformed, or false if it was not affected by the transform.

Definition at line 113 of file pgFrameStyle.cxx.


The documentation for this class was generated from the following files: