Back to index

plt-scheme  4.2.1
Public Member Functions | Public Attributes | Private Attributes | Friends
wxIndividualLayoutConstraint Class Reference

#include <Layout.h>

Inheritance diagram for wxIndividualLayoutConstraint:
Inheritance graph
[legend]
Collaboration diagram for wxIndividualLayoutConstraint:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 wxIndividualLayoutConstraint (void)
void Set (wxRelationship rel, wxWindow **otherWSR, wxEdge otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
void LeftOf (wxWindow **sibling, int marg=wxLAYOUT_DEFAULT_MARGIN)
void RightOf (wxWindow **sibling, int marg=wxLAYOUT_DEFAULT_MARGIN)
void Above (wxWindow **sibling, int marg=wxLAYOUT_DEFAULT_MARGIN)
void Below (wxWindow **sibling, int marg=wxLAYOUT_DEFAULT_MARGIN)
void SameAs (wxWindow **otherW, wxEdge edge, int marg=wxLAYOUT_DEFAULT_MARGIN)
void PercentOf (wxWindow **otherWSR, wxEdge wh, int per)
void Absolute (int val)
void Unconstrained (void)
void AsIs (void)
Bool SatisfyConstraint (wxLayoutConstraints *constraints, wxWindow *win)
int GetEdge (wxEdge which, wxWindow *thisWin, wxWindow *other)
void install_cleanup ()
voidoperator new (size_t size)
voidoperator new (size_t size, GCPlacement gcp)
voidoperator new (size_t size, void *p)
voidoperator new (size_t size)
voidoperator new (size_t size, GCPlacement gcp)
void operator delete (void *obj)
void operator delete (void *, void *)
void operator delete (void *obj)
voidoperator new[] (size_t size)
voidoperator new[] (size_t size, GCPlacement gcp)
voidoperator new[] (size_t size, void *p)
void operator delete[] (void *obj)
void operator delete[] (void *, void *)

Public Attributes

WXTYPE __type
void__gc_external

Private Attributes

wxWindow ** otherWinSR
wxEdge otherEdge
wxEdge myEdge
wxRelationship relationship
int margin
int value
int percent
Bool done

Friends

class wxLayoutConstraints
class wxWindow

Detailed Description

Definition at line 37 of file Layout.h.


Constructor & Destructor Documentation


Member Function Documentation

Definition at line 48 of file Layout.h.

       { Set(wxAbove, sibling, wxTop, 0, marg); }

Here is the call graph for this function:

Definition at line 58 of file Layout.h.

Definition at line 64 of file Layout.h.

Definition at line 50 of file Layout.h.

       { Set(wxBelow, sibling, wxBottom, 0, marg); }

Here is the call graph for this function:

int wxIndividualLayoutConstraint::GetEdge ( wxEdge  which,
wxWindow thisWin,
wxWindow other 
)

Definition at line 460 of file Layout.cc.

{
    if (!other)
       return -1;
    if ((wxWindow*)thisWin->GetParent() == other) { // dimension is obtainable immediately
       // Compute size of client area of parent
       int w, h; other->GetClientSize(&w, &h);
       switch (which) {
       case wxLeft: case wxTop:        return 0;
       case wxRight: case wxWidth:     return w;
       case wxBottom: case wxHeight:          return h;
       case wxCentreX:                        return (w/2);
       case wxCentreY:                        return (h/2);
       }
    } else {
       wxLayoutConstraints *constr;
       wxIndividualLayoutConstraint *iconstr = NULL;
       constr = other->GetConstraints();
       switch (which) {
       case wxLeft:      iconstr = wxLC_ADDR(constr->left); break;
       case wxTop:       iconstr = wxLC_ADDR(constr->top); break;
       case wxRight:     iconstr = wxLC_ADDR(constr->right); break;
       case wxBottom:           iconstr = wxLC_ADDR(constr->bottom); break;
       case wxWidth:     iconstr = wxLC_ADDR(constr->width); break;
       case wxHeight:           iconstr = wxLC_ADDR(constr->height); break;
       case wxCentreX:          iconstr = wxLC_ADDR(constr->centreX); break;
       case wxCentreY:          iconstr = wxLC_ADDR(constr->centreY); break;
       }
       if (iconstr->done)
           return (iconstr->value);
    }
    return -1;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 99 of file wxGC.cxx.

{
  GC_finalization_proc old_fn;
  void *old_data;

# ifdef MZ_PRECISE_GC
#  define ALLOW_NON_BASE 0
#  define CHECK_BASE 0
# else
#  ifdef wx_xt
#   define ALLOW_NON_BASE 0
#   define CHECK_BASE 0
#  else
#   ifdef WIN32
#    define ALLOW_NON_BASE 0
#    define CHECK_BASE 1
#    define CRASH_ON_NONBASE 1
#   else
#    define ALLOW_NON_BASE 1
#    define CHECK_BASE 0
#   endif
#  endif
# endif

# if CHECK_BASE || ALLOW_NON_BASE
  if (GC_base(this) != (void *)this) {
#  if ALLOW_NON_BASE
    return;
#  else
#   ifdef CRASH_ON_NONBASE
    *(long *)0x0 = 1;
#   else
    printf("Clean-up object is not the base object\n");
    abort();
#   endif
#  endif
  }
# endif

  GC_register_finalizer_ignore_self(gcOBJ_TO_PTR(this), 
                                CAST_GCP GC_cleanup, NULL, 
                                CAST_GCPP &old_fn, &old_data);

# if CHECK_BASE
  if (old_fn) {
#  ifdef CRASH_ON_NONBASE
       *(long *)0x0 = 1;
#  else
    printf("Object already has a clean-up\n");
    abort();
#  endif
  }
# endif
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 44 of file Layout.h.

       { Set(wxLeftOf, sibling, wxLeft, 0, marg); }

Here is the call graph for this function:

void gc::operator delete ( void obj) [inline, inherited]
void gc::operator delete ( void obj) [inline, inherited]

Definition at line 287 of file gc_cpp.h.

                                           {
    GC_FREE( obj );}

Here is the caller graph for this function:

void gc::operator delete ( void ,
void  
) [inline, inherited]

Definition at line 291 of file gc_cpp.h.

{}
void gc::operator delete[] ( void obj) [inline, inherited]

Definition at line 305 of file gc_cpp.h.

                                             {
    gc::operator delete( obj );}

Here is the call graph for this function:

void gc::operator delete[] ( void ,
void  
) [inline, inherited]

Definition at line 309 of file gc_cpp.h.

{}
void* gc::operator new ( size_t  size) [inline, inherited]
void* gc::operator new ( size_t  size,
GCPlacement  gcp 
) [inline, inherited]
void * gc::operator new ( size_t  size) [inline, inherited]

Definition at line 273 of file gc_cpp.h.

                                           {
    return GC_MALLOC( size );}

Here is the caller graph for this function:

void * gc::operator new ( size_t  size,
GCPlacement  gcp 
) [inline, inherited]

Definition at line 276 of file gc_cpp.h.

                                                            {
    if (gcp == UseGC) 
        return GC_MALLOC( size );
    else if (gcp == PointerFreeGC)
       return GC_MALLOC_ATOMIC( size );
    else
        return GC_MALLOC_UNCOLLECTABLE( size );}
void * gc::operator new ( size_t  size,
void p 
) [inline, inherited]

Definition at line 284 of file gc_cpp.h.

                                                    {
    return p;}
void * gc::operator new[] ( size_t  size) [inline, inherited]

Definition at line 296 of file gc_cpp.h.

                                             {
    return gc::operator new( size );}

Here is the call graph for this function:

void * gc::operator new[] ( size_t  size,
GCPlacement  gcp 
) [inline, inherited]

Definition at line 299 of file gc_cpp.h.

                                                              {
    return gc::operator new( size, gcp );}

Here is the call graph for this function:

void * gc::operator new[] ( size_t  size,
void p 
) [inline, inherited]

Definition at line 302 of file gc_cpp.h.

                                                      {
    return p;}

Definition at line 129 of file Layout.cc.

{
    otherWinSR = otherW;
    relationship = wxPercentOf;
    percent = per;
    otherEdge = wh;
}

Definition at line 46 of file Layout.h.

       { Set(wxRightOf, sibling, wxRight, 0, marg); }

Here is the call graph for this function:

Definition at line 53 of file Layout.h.

       { Set(wxPercentOf, otherW, edge, 0, marg); percent = 100; }

Here is the call graph for this function:

Definition at line 141 of file Layout.cc.

{
    int edge_pos;
    wxWindow *otherWin;

    if (relationship == wxAbsolute || done == TRUE) {
       return (done = TRUE);
    }

    otherWin = (otherWinSR ? (wxWindow *)GET_SAFEREF(otherWinSR) : NULL);

    edge_pos = (win && otherWin) ? GetEdge(otherEdge, win, otherWin) : -1;
    switch (myEdge) {
    case wxLeft:
       switch (relationship) {
        case wxLeftOf:
           if (edge_pos != -1) { // otherWin has satisfying edge
              value = edge_pos - margin;
              done = TRUE;
           }
           break;
        case wxRightOf:
           if (edge_pos != -1) { // otherWin has satisfying edge
              value = edge_pos + margin;
              done = TRUE;
           }
           break;
        case wxPercentOf:
           if (edge_pos != -1) { // otherWin has satisfying edge
              value = (int)(edge_pos*(((float)percent)*0.01) + margin);
              done = TRUE;
           }
           break;
       case wxUnconstrained:
           if (wxLC_MEM(constraints->right, done) && wxLC_MEM(constraints->width, done)) {
              // compute using right edge and width
              value = wxLC_MEM(constraints->right, value) - wxLC_MEM(constraints->width, value) + margin;
              done = TRUE;
           } else if (wxLC_MEM(constraints->centreX, done) && wxLC_MEM(constraints->width, done)) {
              // compute using centreX and width
              value = (int)(wxLC_MEM(constraints->centreX, value) - (wxLC_MEM(constraints->width, value)/2)
                           + margin);
              done = TRUE;
           }
           break;
       default:
         break;
       }
       break; // goto bottom and return FALSE
    case wxRight:
       switch (relationship) {
        case wxLeftOf:
           if (edge_pos != -1) { // otherWin has satisfying edge
              value = edge_pos - margin;
              done = TRUE;
           }
           break;
        case wxRightOf:
           if (edge_pos != -1) { // otherWin has satisfying edge
              value = edge_pos + margin;
              done = TRUE;
           }
           break;
        case wxPercentOf:
           if (edge_pos != -1) { // otherWin has satisfying edge
              value = (int)(edge_pos*(((float)percent)*0.01) - margin);
              done = TRUE;
           }
           break;
       case wxUnconstrained:
           if (wxLC_MEM(constraints->left, done) && wxLC_MEM(constraints->width, done)) {
              // compute using left edge and width
              value = wxLC_MEM(constraints->left, value) + wxLC_MEM(constraints->width, value) - margin;
              done = TRUE;
           } else if (wxLC_MEM(constraints->centreX, done) && wxLC_MEM(constraints->width, done)) {
              // compute using centreX and width
              value = (int)(wxLC_MEM(constraints->centreX, value) + (wxLC_MEM(constraints->width, value)/2)
                           - margin);
              done = TRUE;
           }
           break;
       default:
         break;
       }
       break; // goto bottom and return FALSE
    case wxTop:
       switch (relationship) {
        case wxAbove:
           if (edge_pos != -1) { // otherWin has satisfying edge
              value = edge_pos - margin;
              done = TRUE;
           }
           break;
        case wxBelow:
           if (edge_pos != -1) { // otherWin has satisfying edge
              value = edge_pos + margin;
              done = TRUE;
           }
           break;
        case wxPercentOf:
           if (edge_pos != -1) { // otherWin has satisfying edge
              value = (int)(edge_pos*(((float)percent)*0.01) + margin);
              done = TRUE;
           }
           break;
       case wxUnconstrained:
           if (wxLC_MEM(constraints->bottom, done) && wxLC_MEM(constraints->height, done)) {
              // compute using bottom edge and height
              value = wxLC_MEM(constraints->bottom, value) - wxLC_MEM(constraints->height, value) + margin;
              done = TRUE;
           } else if (wxLC_MEM(constraints->centreY, done) && wxLC_MEM(constraints->height, done)) {
              // compute using centreY and height
              value = (int)(wxLC_MEM(constraints->centreY, value) - (wxLC_MEM(constraints->height, value)/2)
                           + margin);
              done = TRUE;
           }
           break;
       default:
         break;
       }
       break; // goto bottom and return FALSE
    case wxBottom:
       switch (relationship) {
        case wxAbove:
           if (edge_pos != -1) { // otherWin has satisfying edge
              value = edge_pos - margin;
              done = TRUE;
           }
           break;
        case wxBelow:
           if (edge_pos != -1) { // otherWin has satisfying edge
              value = edge_pos + margin;
              done = TRUE;
           }
           break;
        case wxPercentOf:
           if (edge_pos != -1) { // otherWin has satisfying edge
              value = (int)(edge_pos*(((float)percent)*0.01) - margin);
              done = TRUE;
           }
           break;
       case wxUnconstrained:
           if (wxLC_MEM(constraints->top, done) && wxLC_MEM(constraints->height, done)) {
              // compute using top edge and height
              value = wxLC_MEM(constraints->top, value) + wxLC_MEM(constraints->height, value) - margin;
              done = TRUE;
           } else if (wxLC_MEM(constraints->centreY, done) && wxLC_MEM(constraints->height, done)) {
              // compute using centreY and height
              value = (int)(wxLC_MEM(constraints->centreY, value) + (wxLC_MEM(constraints->height, value)/2)
                           - margin);
              done = TRUE;
           }
           break;
       default:
         break;
       }
       break; // goto bottom and return FALSE
    case wxCentreX:
       switch (relationship) {
        case wxLeftOf:
           if (edge_pos != -1) { // otherWin has satisfying edge
              value = edge_pos - margin;
              done = TRUE;
           }
           break;
        case wxRightOf:
           if (edge_pos != -1) { // otherWin has satisfying edge
              value = edge_pos + margin;
              done = TRUE;
           }
           break;
        case wxPercentOf:
           if (edge_pos != -1) { // otherWin has satisfying edge
              value = (int)(edge_pos*(((float)percent)*0.01) + margin);
              done = TRUE;
           }
           break;
       case wxUnconstrained:
           if (wxLC_MEM(constraints->left, done) && wxLC_MEM(constraints->width, done)) {
              // compute using left edge and width
              value = (int)(wxLC_MEM(constraints->left, value) + (wxLC_MEM(constraints->width, value)/2)
                           + margin);
              done = TRUE;
           } else if (wxLC_MEM(constraints->right, done) && wxLC_MEM(constraints->width, done)) {
              // compute using right edge and width
              value = (int)(wxLC_MEM(constraints->right, value) - (wxLC_MEM(constraints->width, value)/2)
                           + margin);
              done = TRUE;
           } else if (wxLC_MEM(constraints->left, done) && wxLC_MEM(constraints->right, done)) {
              // compute using left and right edge
              value = (int)(wxLC_MEM(constraints->left, value) 
                           + (wxLC_MEM(constraints->right, value)-wxLC_MEM(constraints->left, value))/2
                         + margin);
              done = TRUE;
           }
           break;
       default:
         break;
       }
       break; // goto bottom and return FALSE
    case wxCentreY:
       switch (relationship) {
        case wxAbove:
           if (edge_pos != -1) { // otherWin has satisfying edge
              value = edge_pos - margin;
              done = TRUE;
           }
           break;
        case wxBelow:
           if (edge_pos != -1) { // otherWin has satisfying edge
              value = edge_pos + margin;
              done = TRUE;
           }
           break;
        case wxPercentOf:
           if (edge_pos != -1) { // otherWin has satisfying edge
              value = (int)(edge_pos*(((float)percent)*0.01) + margin);
              done = TRUE;
           }
           break;
       case wxUnconstrained:
           if (wxLC_MEM(constraints->top, done) && wxLC_MEM(constraints->height, done)) {
              // compute using top edge and height
              value = (int)(wxLC_MEM(constraints->top, value) + (wxLC_MEM(constraints->height, value)/2)
                           + margin);
              done = TRUE;
           } else if (wxLC_MEM(constraints->bottom, done) && wxLC_MEM(constraints->height, done)) {
              // compute using bottom edge and height
              value = (int)(wxLC_MEM(constraints->bottom, value) - (wxLC_MEM(constraints->height, value)/2)
                           + margin);
              done = TRUE;
           } else if (wxLC_MEM(constraints->top, done) && wxLC_MEM(constraints->bottom, done)) {
              // compute using top and bottom edge
              value = (int)(wxLC_MEM(constraints->top, value) 
                           + (wxLC_MEM(constraints->bottom, value)-wxLC_MEM(constraints->top, value))/2
                           + margin);
              done = TRUE;
           }
           break;
       default:
         break;
       }
       break; // goto bottom and return FALSE
    case wxWidth:
       switch (relationship) {
        case wxPercentOf:
           if (edge_pos != -1) { // otherWin has satisfying edge
              value = (int)(edge_pos*(((float)percent)*0.01));
              done = TRUE;
           }
           break;
        case wxAsIs:
           if (win) {
              int h;
              win->GetSize(&value, &h);
              done = TRUE;
           }
           break;
       case wxUnconstrained:
           if (wxLC_MEM(constraints->left, done) && wxLC_MEM(constraints->right, done)) {
              // compute using left and right edge
              value = wxLC_MEM(constraints->right, value) - wxLC_MEM(constraints->left, value);
              done = TRUE;
           } else if (wxLC_MEM(constraints->left, done) && wxLC_MEM(constraints->centreX, done)) {
              // compute using left edge and centreX
              value = (wxLC_MEM(constraints->centreX, value) - wxLC_MEM(constraints->left, value)) * 2;
              done = TRUE;
           } else if (wxLC_MEM(constraints->right, done) && wxLC_MEM(constraints->centreX, done)) {
              // compute using right edge and centreX
              value = (wxLC_MEM(constraints->right, value) - wxLC_MEM(constraints->centreX, value)) * 2;
              done = TRUE;
           }
           break;
       default:
         break;
       }
       break; // goto bottom and return FALSE
    case wxHeight:
       switch (relationship) {
        case wxPercentOf:
           if (edge_pos != -1) { // otherWin has satisfying edge
              value = (int)(edge_pos*(((float)percent)*0.01));
              done = TRUE;
           }
           break;
        case wxAsIs:
           if (win) {
              int w;
              win->GetSize(&w, &value);
              done = TRUE;
           }
       case wxUnconstrained:
           if (wxLC_MEM(constraints->top, done) && wxLC_MEM(constraints->bottom, done)) {
              // compute using top and bottom edge
              value = wxLC_MEM(constraints->bottom, value) - wxLC_MEM(constraints->top, value);
              done = TRUE;
           } else if (wxLC_MEM(constraints->top, done) && wxLC_MEM(constraints->centreY, done)) {
              // compute using top edge and centreY
              value = (wxLC_MEM(constraints->centreY, value) - wxLC_MEM(constraints->top, value)) * 2;
              done = TRUE;
           } else if (wxLC_MEM(constraints->bottom, done) && wxLC_MEM(constraints->centreY, done)) {
              // compute using right edge and centreX
              value = (wxLC_MEM(constraints->bottom, value) - wxLC_MEM(constraints->centreY, value)) * 2;
              done = TRUE;
           }
           break;
       default:
         break;
       }
       break; // goto bottom and return FALSE
    }
    return done;
}

Here is the call graph for this function:

void wxIndividualLayoutConstraint::Set ( wxRelationship  rel,
wxWindow **  otherWSR,
wxEdge  otherE,
int  val = 0,
int  marg = wxLAYOUT_DEFAULT_MARGIN 
)

Definition at line 119 of file Layout.cc.

{
    relationship = rel;
    otherWinSR   = otherW;
    otherEdge    = otherE;
    value        = val;
    margin       = marg;
}

Here is the caller graph for this function:

Definition at line 61 of file Layout.h.


Friends And Related Function Documentation

friend class wxLayoutConstraints [friend]

Definition at line 72 of file Layout.h.

friend class wxWindow [friend]

Definition at line 73 of file Layout.h.


Member Data Documentation

Definition at line 146 of file wxGC.h.

WXTYPE wxObject::__type [inherited]

Definition at line 77 of file Object.h.

Definition at line 83 of file Layout.h.

Definition at line 80 of file Layout.h.

Definition at line 78 of file Layout.h.

Definition at line 76 of file Layout.h.

Definition at line 75 of file Layout.h.

Definition at line 82 of file Layout.h.

Definition at line 79 of file Layout.h.

Definition at line 81 of file Layout.h.


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