Référence de la classe wxMaskEdit

#include <wxMaskEdit.h>

Liste de tous les membres

Fonctions membres publiques

 wxMaskEdit ()
 wxMaskEdit (wxWindow *parent, wxWindowID id, const wxString &wxT="", const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, const wxValidator &validator=wxDefaultValidator, const wxString &name=wxTextCtrlNameStr, const wxString &mask="", unsigned int MskStyle=ME_LIBRE, bool GroupStyle=GBLANKS)
virtual ~wxMaskEdit ()
wxString getGroupText (size_t idx) const
wxString getTextValue () const
wxString getAbsValue () const
char * ToChar () const
void SetDisplay (const wxString &value)
void SetClear ()
void wxMaskSet (const wxString &mask, unsigned int MskStyle=ME_LIBRE, bool GroupStyle=GBLANKS)

Fonctions membres publiques statiques

static bool IsControl (char c)

Fonctions membres privées

long SzToL (size_t size_value=0)
void OnKeyPress (wxKeyEvent &evt)
void OnSetFocus (wxFocusEvent &evt)
void OnLostFocus (wxFocusEvent &evt)
void ParseMask (const wxString &mask, int style=0)
wxString GenMaskText ()
void DrawMask ()
void FixInsPt (size_t pos, int dir)
TextPartFindPart ()
size_t FindItem ()
size_t FindIdx ()
size_t ItemPos (size_t item)
bool CtrlKey (wxKeyEvent &evt)

Attributs privés

wxString m_Text
wxString m_mask
size_t NbrIdx
size_t Msk_Style
TextPartArray m_parts
NumberGroup::NGBehaviour m_behav
bool m_firstfocus

Attributs privés statiques

static const wxString m_control = wxString("#§")


Description détaillée

Définition à la ligne 132 du fichier wxMaskEdit.h.


Documentation des contructeurs et destructeur

wxMaskEdit  ) 
 

Définition à la ligne 390 du fichier wxmaskedit.cpp.

00391 : m_firstfocus(true)
00392 {
00393 }

wxMaskEdit wxWindow *  parent,
wxWindowID  id,
const wxString &  wxT = "",
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize,
long  style = 0,
const wxValidator &  validator = wxDefaultValidator,
const wxString &  name = wxTextCtrlNameStr,
const wxString &  mask = "",
unsigned int  MskStyle = ME_LIBRE,
bool  GroupStyle = GBLANKS
 

Définition à la ligne 395 du fichier wxmaskedit.cpp.

Références GBLANKS, GZEROS, m_behav, m_firstfocus, m_Text, et SetDisplay().

00407   : m_behav(beh), m_firstfocus(true)
00408 {
00409 if ( GroupStyle == GBLANKS) m_behav = NumberGroup::NGBehaviour (GBLANKS);
00410  else   m_behav =  NumberGroup::NGBehaviour(GZEROS);
00411 this->m_firstfocus= true;
00412 
00413  m_Text = txt;
00414 if ( MskStyle > 11 ) wxMessageBox("Non Conforme Style MaskEdit");
00415   //skip all events on construction
00416 this->wxTextCtrl::Create(parent, id, txt, pos, size,style,validator,name);
00417 // font Underline = true
00418 this->SetFont(wxFont(10,wxFONTFAMILY_SWISS, wxNORMAL,wxFONTWEIGHT_NORMAL ,true,wxT("Courier")));
00419 
00420 
00421 if (mask.Len() > 0 ) {
00422 this->ParseMask(mask, MskStyle);
00423 this->SetMaxLength(this->SzToL(mask.Length()));
00424 
00425 this->SetDisplay(m_Text);
00426 }
00427 
00428 
00429 
00430 }

~wxMaskEdit  )  [virtual]
 

Définition à la ligne 433 du fichier wxmaskedit.cpp.

Références m_parts.

00434 {
00435   //delete all groups
00436   WX_CLEAR_ARRAY(m_parts);
00437 }


Documentation des fonctions membres

bool CtrlKey wxKeyEvent &  evt  )  [private]
 

Définition à la ligne 971 du fichier wxmaskedit.cpp.

Références m_mask, ME_ALPHA, ME_CAPBLK, ME_CAPITAL, ME_CAPLBR, ME_DATE, ME_LIBRE, ME_LTRBLK, ME_LTRNUM, ME_NDEC, ME_NDECS, ME_NUM, et ME_SIGNED.

00972 {
00973 // table ansi etendu
00974 // 128..163  ex: £ €    car speciaux.
00975 // 192..255  ex: àçèéö  ect....
00976 
00977 //wxMessageBox(wxString::Format("%d",evt.GetKeyCode()));
00978 if (this->IsEditable() == false ) return false;
00979 if (evt.GetKeyCode() == '_' || evt.GetKeyCode() == '#' || evt.GetKeyCode() == '§' )  return  false;
00980 
00981 if (evt.GetKeyCode() == WXK_RETURN)  return  true;
00982 
00983 if (evt.GetKeyCode() == WXK_TAB)  return  true;
00984 
00985 if (evt.GetKeyCode() ==  WXK_NUMPAD_TAB) return  true;
00986 
00987 if (evt.GetKeyCode() == WXK_END)  return  true;
00988 
00989 if (evt.GetKeyCode() == WXK_BACK ||
00990     evt.GetKeyCode() == WXK_DELETE) return  true;
00991 
00992 if (evt.GetKeyCode() == WXK_LEFT || evt.GetKeyCode() == WXK_UP ||
00993     evt.GetKeyCode() == WXK_NUMPAD_LEFT)  return  true;
00994 
00995  if (evt.GetKeyCode() == WXK_RIGHT || evt.GetKeyCode() == WXK_DOWN||
00996     evt.GetKeyCode() == WXK_NUMPAD_RIGHT) return  true;
00997 
00998 //if (evt.GetKeyCode() == WXK_UP )wxMessageBox(wxString::Format("%d",evt.GetKeyCode()));
00999 
01000 //@@@@@@  char
01001 
01002 if   (evt.GetKeyCode() >= 255 ) return  false;
01003 //   && evt.GetKeyCode() < 326 && evt.GetKeyCode() > 335)  return  false; '0' '9'
01004 
01005      size_t pos  = this->GetInsertionPoint();
01006 if (evt.GetKeyCode() == 32 && pos == 0 ) return false ;
01007 
01008 
01009 
01010     if(this->Msk_Style == ME_LIBRE || this->Msk_Style == ME_CAPLBR )
01011   {  if (evt.GetKeyCode() >= 32 && evt.GetKeyCode() <= 127)  return  true;
01012      if (evt.GetKeyCode() >= 128 && evt.GetKeyCode() <= 255) return  true;
01013 
01014     }
01015   if(this->Msk_Style == ME_CAPBLK  )
01016   {  if ( m_mask[pos] !='§' )   return false;
01017      if (evt.GetKeyCode() >= 'A' && evt.GetKeyCode() <= 'Z') return  true;
01018      if (evt.GetKeyCode() >= 'a' && evt.GetKeyCode() <= 'z') return  true;
01019      if (evt.GetKeyCode() >= 128 && evt.GetKeyCode() <= 255) return  true;
01020      if (evt.GetKeyCode() == ' ')return  true;
01021     }
01022   if(this->Msk_Style == ME_CAPITAL  )
01023   {  if ( m_mask[pos] !='§' )   return false;
01024      if (evt.GetKeyCode() >= 'A' && evt.GetKeyCode() <= 'Z') return  true;
01025      if (evt.GetKeyCode() >= 'a' && evt.GetKeyCode() <= 'z') return  true;
01026      if (evt.GetKeyCode() == 128 && evt.GetKeyCode() == 163) return  true;
01027      if (evt.GetKeyCode() >= 192 && evt.GetKeyCode() <= 255) return  true;
01028    }
01029   if(this->Msk_Style == ME_LTRNUM )
01030   {  if (evt.GetKeyCode() >= 'A' && evt.GetKeyCode() <= 'Z') return  true;
01031      if (evt.GetKeyCode() >= 'a' && evt.GetKeyCode() <= 'z') return  true;
01032      if (evt.GetKeyCode() == 128 && evt.GetKeyCode() == 163) return  true;
01033      if (evt.GetKeyCode() >= 192 && evt.GetKeyCode() <= 255) return  true;
01034      if (evt.GetKeyCode() >= '0' && evt.GetKeyCode() <= '9') return  true;
01035      if (evt.GetKeyCode() == ' ' ) return  true;
01036    }
01037   if(this->Msk_Style == ME_LTRBLK)
01038   {  if ( m_mask[pos] !='§' )   return false;
01039      if (evt.GetKeyCode() >= 'A' && evt.GetKeyCode() <= 'Z') return  true;
01040      if (evt.GetKeyCode() >= 'a' && evt.GetKeyCode() <= 'z') return  true;
01041      if (evt.GetKeyCode() == ' ' ) return  true;
01042    }
01043   if(this->Msk_Style == ME_ALPHA )
01044   {  if ( m_mask[pos] !='§' )   return false;
01045      if (evt.GetKeyCode() >= 'A' && evt.GetKeyCode() <= 'Z') return  true;
01046      if (evt.GetKeyCode() >= 'a' && evt.GetKeyCode() <= 'z') return  true;
01047      if (evt.GetKeyCode() == 128 && evt.GetKeyCode() == 163) return  true;
01048      if (evt.GetKeyCode() >= 192 && evt.GetKeyCode() <= 255) return  true;
01049      if (evt.GetKeyCode() == ' ' ) return  true;
01050    }
01051   if(this->Msk_Style == ME_NUM  || this->Msk_Style == ME_NDEC )
01052   { if ( m_mask[pos] !='#' )   return false;
01053     if (evt.GetKeyCode() >= '0' && evt.GetKeyCode() <= '9' ) return  true;
01054    }
01055 
01056   if(this->Msk_Style == ME_SIGNED  || this->Msk_Style == ME_NDECS )
01057   {
01058      if (evt.GetKeyCode() == '-' && m_mask[pos] =='§') return  true;
01059      if (evt.GetKeyCode() == '+' && m_mask[pos] =='§') return  true;
01060      if ( m_mask[pos] !='#' )   return false;
01061      if (evt.GetKeyCode() >= '0' && evt.GetKeyCode() <= '9') return  true;
01062 
01063    }
01064   if(this->Msk_Style == ME_DATE )
01065   { if ( m_mask[pos] !='#' )   return false;
01066     if (evt.GetKeyCode() >= '0' && evt.GetKeyCode() <= '9' ) return  true;
01067    }
01068 
01069 return false;
01070 }

void DrawMask  )  [private]
 

Définition à la ligne 527 du fichier wxmaskedit.cpp.

Références GenMaskText().

00528 {
00529   this->SetValue(GenMaskText());
00530 }

size_t FindIdx  )  [private]
 

Définition à la ligne 594 du fichier wxmaskedit.cpp.

Références m_parts.

00595 {
00596   size_t pos = this->GetInsertionPoint();
00597   size_t currtot = 0;
00598 
00599   for (size_t i = 0; i < m_parts.GetCount(); i++) {
00600     currtot += m_parts.Item(i)->getSize();
00601 
00602     if (currtot > pos) {
00603       return m_parts.Item(i)->getSize() - (currtot - pos);
00604     }
00605   }
00606 
00607   return 0;
00608 }

size_t FindItem  )  [private]
 

Définition à la ligne 562 du fichier wxmaskedit.cpp.

Références m_parts.

00563 {
00564   size_t pos = this->GetInsertionPoint();
00565   size_t currtot = 0;
00566   size_t i ;
00567   for (i = 0; i < m_parts.GetCount(); i++) {
00568     currtot += m_parts.Item(i)->getSize();
00569 
00570     if (currtot > pos) {
00571       return i;
00572     }
00573   }
00574 
00575   return --i;
00576 }

TextPart * FindPart  )  [private]
 

Définition à la ligne 544 du fichier wxmaskedit.cpp.

Références m_parts.

Référencé par FixInsPt(), OnKeyPress(), et SetDisplay().

00545 {
00546   size_t pos = this->GetInsertionPoint();
00547   size_t currtot = 0;
00548 
00549   for (size_t i = 0; i < m_parts.GetCount(); i++) {
00550     currtot += m_parts.Item(i)->getSize();
00551 
00552     if (currtot > pos) {
00553       return m_parts.Item(i);
00554     }
00555   }
00556 
00557   return 0;
00558 }

void FixInsPt size_t  pos,
int  dir
[private]
 

Définition à la ligne 877 du fichier wxmaskedit.cpp.

Références FindPart(), GenMaskText(), et TextPart::isStatic().

Référencé par OnSetFocus().

00878 {
00879   size_t masksz = this->GenMaskText().Len();
00880   if(pos >= masksz) {
00881     this->SetInsertionPoint(this->SzToL(masksz));
00882     return;
00883   }
00884 
00885   if (pos <= 0 && dir <= 0) {
00886     this->SetInsertionPoint(0);
00887 
00888     if (this->FindPart() && this->FindPart()->isStatic()) {
00889       FixInsPt(pos, 1);
00890     }
00891 
00892     return;
00893   }
00894 
00895   this->SetInsertionPoint(this->SzToL(pos));
00896 
00897   if (dir == 0) return;
00898 
00899   //check for static, and skip
00900   while (this->FindPart() &&
00901     this->FindPart()->isStatic()) {
00902 
00903       if (pos == 0 && dir < 0) {
00904         if (this->FindPart() && this->FindPart()->isStatic()) {
00905           FixInsPt(pos, 1);
00906         }
00907 
00908         break;
00909       }
00910       else if(pos >= masksz) {
00911         break;
00912       }
00913 
00914       pos += dir;
00915       this->SetInsertionPoint(this->SzToL(pos));
00916   }
00917 }

wxString GenMaskText  )  [private]
 

Définition à la ligne 532 du fichier wxmaskedit.cpp.

Références m_parts.

Référencé par DrawMask(), et FixInsPt().

00533 {
00534   wxString full;
00535 
00536   for (size_t i = 0; i < m_parts.GetCount(); i++) {
00537     full += m_parts.Item(i)->getValue();
00538   }
00539   return full;
00540 }

wxString getAbsValue  )  const
 

Définition à la ligne 801 du fichier wxmaskedit.cpp.

Références m_parts.

00802 {
00803   wxString ret;
00804     wxString trt ;
00805 
00806   for (size_t i = 0; i < m_parts.GetCount(); i++) {
00807 
00808     m_parts[i]->normalize();
00809 
00810    trt  += m_parts[i]->getTransform();
00811 
00812   }
00813 
00814  for (size_t i = 0; i < m_mask.Length(); i++) {
00815   switch(this->Msk_Style)
00816 {
00817  case  ME_NDEC  : if ( trt[i] != ' ' ) ret += trt[i]; break;
00818 
00819  case  ME_NDECS : if ( trt[i] != ' ' ) ret += trt[i]; break;
00820 
00821  case  ME_NUM : if (m_mask[i] == '#' && trt[i] != ' ' ) ret += trt[i]; break;
00822 
00823  case  ME_SIGNED : if (m_mask[i] == '#' && trt[i] != ' ' ) ret += trt[i]; break;
00824 
00825  case  ME_DATE : if (m_mask[i] == '#') ret += trt[i]; break;
00826 
00827 default:
00828             if ( m_mask[i] =='§')  if ( trt[i] != ' ' ) ret += trt[i];break;
00829 }
00830  } // for
00831    ret.Trim();
00832   return ret.Trim(true);
00833 }

wxString getGroupText size_t  idx  )  const
 

Définition à la ligne 791 du fichier wxmaskedit.cpp.

Références m_parts.

00792 {
00793           if ( this->NbrIdx < idx) return wxT("¤"); // prblm  ????
00794           else return m_parts[idx]->getTransform();
00795 }

wxString getTextValue  )  const
 

Définition à la ligne 862 du fichier wxmaskedit.cpp.

Références m_parts.

00863 {
00864   wxString ret;
00865 
00866   for (size_t i = 0; i < m_parts.GetCount(); i++) {
00867     m_parts[i]->normalize();
00868    ret  += m_parts[i]->getTransform();
00869   }
00870   ret.Replace("_", " ");
00871   return ret;
00872 }

bool IsControl char  c  )  [static]
 

Définition à la ligne 612 du fichier wxmaskedit.cpp.

Références m_control.

Référencé par LetterGroup::getValue(), NumberGroup::getValue(), et ParseMask().

00613 {
00614   return m_control.Find(c) != -1;
00615 }

size_t ItemPos size_t  item  )  [private]
 

Définition à la ligne 581 du fichier wxmaskedit.cpp.

Références m_parts.

00582 {
00583   size_t pos = 0;
00584 
00585   for (size_t i = 0; i <= item; i++)
00586     pos += m_parts.Item(i)->getSize();
00587 
00588 
00589   return pos;
00590 }

void OnKeyPress wxKeyEvent &  evt  )  [private]
 

Définition à la ligne 658 du fichier wxmaskedit.cpp.

Références FindPart().

00659 {
00660  TextPart* p = this->FindPart();
00661  size_t pos = 0 ;
00662  size_t savpos = 0;
00663  wxString val_;
00664   //if alt or Edit are down, ignore this key, also
00665   // ignore return ( frame wxDEFAULT_FRAME_STYLE | wxTAB_TRAVERSAL
00666   // debug      wxMessageBox(wxString::Format("%d",pos));
00667 
00668  if (false == this->CtrlKey(evt)  ){   evt.Skip();    return;  }
00669 
00670  if ( evt.HasModifiers() ||
00671       evt.GetKeyCode() == WXK_RETURN ||
00672       evt.GetKeyCode() == WXK_TAB  ) {   evt.Skip();  return;  }
00673 
00674 
00675 // next part
00676  if (evt.GetKeyCode() == WXK_END )  {
00677      if (this->FindPart())
00678      { p->normalize();
00679      pos = this->ItemPos(this->FindItem()); //
00680      this->DrawMask();
00681      this->FixInsPt(pos,1);
00682      }
00683          return;
00684 }
00685 
00686   //if this is part of ascii, send it to the Edits
00687   if ((evt.GetKeyCode() >= 32 &&  evt.GetKeyCode() <= 127 )
00688       ||(evt.GetKeyCode() >= 128 && evt.GetKeyCode() <= 255)
00689       ||(evt.GetKeyCode() >= 326 && evt.GetKeyCode() <= 335)
00690       || (evt.GetKeyCode() == WXK_BACK)
00691       || (evt.GetKeyCode() == WXK_DELETE) ) {
00692 
00693         p = this->FindPart();
00694         pos = this->GetInsertionPoint();
00695         //find the textpart based on the current
00696         //cursor position
00697 
00698         if (this->FindPart() && this->FindPart()->isStatic() && evt.GetKeyCode() != WXK_BACK) {
00699           pos++;
00700           this->FixInsPt(pos, 1);
00701         }
00702 
00703 //  WXK_BACK
00704         if (evt.GetKeyCode() == WXK_BACK ) {
00705 
00706             if (pos > 0 ) pos-- ;
00707             this->SetInsertionPoint(this->SzToL(pos));
00708             p = this->FindPart();
00709             if (m_mask[pos] != '#' && m_mask[pos] !='§' )   return;
00710             else {
00711               savpos =this->FindIdx();
00712               p->OnKeyDown(evt,savpos);
00713               this->DrawMask();
00714               this->SetInsertionPoint(this->SzToL(pos));
00715               return;
00716              }
00717 
00718         }
00719 // WXK_DELETE
00720         else if (evt.GetKeyCode() == WXK_DELETE  ) {
00721 
00722             size_t item    = this->FindItem();
00723 
00724             pos=0;
00725             wxKeyEvent k(wxEVT_CHAR);
00726             k.m_keyCode = WXK_DELETE;
00727 
00728             this->FixInsPt(0, 1);
00729 
00730             for (size_t i = 0; i <= item; i++ ) {
00731 
00732                 this->SetInsertionPoint(this->SzToL(pos));
00733                 p = this->FindPart();   savpos =pos;
00734 
00735                     for (size_t n = 0; n <= p->getSize() ; n++) {
00736 
00737                                  if (m_mask[pos] == '#' || m_mask[pos] =='§'  )
00738                                  if (i == item) p->OnKeyDown(k,n);
00739                                                        pos++;    }
00740                 pos--;
00741                                                  }
00742             this->DrawMask();
00743             this->FixInsPt(savpos, 1);
00744             pos = this->GetInsertionPoint();
00745             return;
00746        }
00747 // CHAR *all
00748        if (this->FindPart()) {
00749         int dir = p->OnKeyDown(evt,this->FindIdx());
00750         this->DrawMask();
00751         pos += dir;
00752         this->FixInsPt(pos, 1);
00753       }
00754 
00755   }//handle arrow keys
00756   else if (evt.GetKeyCode() == WXK_LEFT || evt.GetKeyCode() == WXK_UP ||
00757     evt.GetKeyCode() == WXK_NUMPAD_LEFT) {
00758 
00759 val_ = this->getAbsValue().Trim(false);
00760 if (val_.Len() ==  0) {  this->FixInsPt(pos, 1);   return;  }
00761 
00762       pos = this->GetInsertionPoint();
00763       if (pos > 0) {
00764        // this->SetInsertionPoint(--pos);
00765         this->FixInsPt(--pos, 0);
00766       }
00767 
00768   }
00769   else if (evt.GetKeyCode() == WXK_RIGHT || evt.GetKeyCode() == WXK_DOWN||
00770     evt.GetKeyCode() == WXK_NUMPAD_RIGHT) {
00771 
00772       val_ = this->getAbsValue().Trim(false);
00773 if (val_.Len() ==  0) {  this->FixInsPt(pos, 1);  return;  }
00774 
00775       pos = this->GetInsertionPoint();
00776       if (pos < val_.Len()) {
00777        // this->SetInsertionPoint(++pos);
00778         this->FixInsPt(++pos, 1);
00779       }
00780 
00781   }
00782   else {
00783     evt.Skip();
00784   }
00785 }

void OnLostFocus wxFocusEvent &  evt  )  [private]
 

Définition à la ligne 634 du fichier wxmaskedit.cpp.

Références m_parts.

00635 {
00636   //record insrtion point
00637   long inspt = this->GetInsertionPoint();
00638 
00639   //normalize all portions
00640   for (size_t i = 0; i < m_parts.GetCount(); i++) {
00641     m_parts.Item(i)->normalize();
00642   }
00643 
00644   //redraw
00645   this->DrawMask();
00646 
00647   //reset point
00648   this->SetInsertionPoint(inspt);
00649     m_firstfocus = true;
00650   evt.Skip();
00651 }

void OnSetFocus wxFocusEvent &  evt  )  [private]
 

Définition à la ligne 620 du fichier wxmaskedit.cpp.

Références FixInsPt(), et m_firstfocus.

00621 {
00622   if (m_firstfocus) {
00623     this->SetInsertionPoint(0);
00624     this->FixInsPt(0, 1);
00625 
00626     m_firstfocus = false;
00627   }
00628 
00629   evt.Skip();
00630 }

void ParseMask const wxString &  mask,
int  style = 0
[private]
 

Définition à la ligne 481 du fichier wxmaskedit.cpp.

Références TextPart::append(), IsControl(), m_behav, m_mask, m_parts, Msk_Style, NbrIdx, et TextPart::setStyle().

Référencé par wxMaskSet().

00482 {
00483   m_mask = mask ;
00484 
00485   char cEdit = 0x00;
00486   TextPart* part = 0;
00487   this->NbrIdx  = 0;
00488   this->Msk_Style = style;
00489   for (size_t i = 0; i < mask.Len(); i++) {
00490 
00491     if ( mask[i] != cEdit  && IsControl(mask[i]) ) {
00492       if (part) m_parts.Add(part);
00493 
00494       if (mask[i] == '#') {
00495         cEdit = '#';
00496         part = new NumberGroup(this->NbrIdx, m_behav);
00497                 this->NbrIdx ++;
00498 
00499       }
00500      else if (mask[i] == '§' ) {
00501         cEdit = '§';
00502         part = new LetterGroup(this->NbrIdx);
00503                 this->NbrIdx ++;
00504 
00505       }
00506     }
00507     else if (!IsControl(mask[i])) {
00508       if (part) m_parts.Add(part);
00509       cEdit = '0';
00510       part = new TextPart(this->NbrIdx);
00511                 this->NbrIdx ++;
00512     }
00513 
00514     part->append( mask[i] );
00515     part->setStyle(style);
00516   }
00517 
00518  if (part)  m_parts.Add( part );
00519 
00520 
00521  -- NbrIdx;
00522 }

void SetClear  ) 
 

Définition à la ligne 963 du fichier wxmaskedit.cpp.

Références SetDisplay().

00964 {
00965     this->SetDisplay(wxT(""));
00966 }

void SetDisplay const wxString &  value  ) 
 

Définition à la ligne 922 du fichier wxmaskedit.cpp.

Références FindPart(), TextPart::getSize(), m_mask, m_parts, et TextPart::OnKeyDown().

Référencé par SetClear(), wxMaskEdit(), et wxMaskSet().

00923 {
00924       wxString  xval = value ;
00925       int     ncar = 0;
00926   //set insertion pt to 0
00927   this->SetInsertionPoint(0);
00928      wxKeyEvent k(wxEVT_CHAR);
00929 
00930 
00931 // clear *all Textpart
00932       TextPart* p = this->FindPart();
00933       for (size_t i = 0 , pos = 0; i < m_parts.GetCount(); i++ ) {
00934       this->SetInsertionPoint(this->SzToL(pos));
00935       p = this->FindPart();
00936 
00937       k.m_keyCode = WXK_DELETE;
00938 
00939       for (size_t n = 0; n < p->getSize(); n++) {
00940       if (m_mask[pos] == '#' || m_mask[pos] =='§') p->OnKeyDown(k,n); pos++; }
00941        }
00942 
00943 
00944 // initialise Textpart
00945       this->SetInsertionPoint(0); FixInsPt(0, 0);
00946     if (this->Msk_Style == ME_SIGNED || this->Msk_Style == ME_NDECS )
00947       {p = this->FindPart(); k.m_keyCode = '+'; p->OnKeyDown(k,0);}
00948 
00949 if (value != "")  for (size_t i = 0; i < xval.Len(); i++) {
00950     ncar = xval[i]; if ( ncar <0 )  k.m_keyCode = 256 + ncar ; else k.m_keyCode = ncar;
00951     this->OnKeyPress(k);
00952   }
00953   this->DrawMask();
00954   wxFocusEvent e;
00955   this->OnLostFocus(e);
00956 }

long SzToL size_t  size_value = 0  )  [private]
 

Définition à la ligne 441 du fichier wxmaskedit.cpp.

00441                                         {
00442     long long_value;
00443     wxString s =  wxString::Format(wxT("%d"), size_value) ;
00444     s.ToLong(&long_value);
00445 
00446 //      char strValue[10] ;
00447 //      sprintf(strValue,"%d",size_value);
00448 //      return atol(strValue);
00449 
00450         return long_value;
00451 }

char * ToChar  )  const
 

Définition à la ligne 836 du fichier wxmaskedit.cpp.

Références m_parts.

00837 {
00838   wxString ret;
00839   wxString trt ;
00840   char * vchar ;
00841   for (size_t i = 0; i < m_parts.GetCount(); i++) {
00842 
00843     m_parts[i]->normalize();
00844 
00845    trt  += m_parts[i]->getTransform();
00846 
00847   }
00848 
00849  for (size_t i = 0; i < m_mask.Length(); i++) {
00850           if ( trt[i] != '_' & trt[i] != ' ' ) ret += trt[i];
00851   }
00852    ret.Trim(); ret.Trim(true);
00853    vchar = (char*) malloc( ret.Length() );
00854    strcpy(vchar,ret.c_str());
00855 
00856   return &(vchar[0]);
00857 }

void wxMaskSet const wxString &  mask,
unsigned int  MskStyle = ME_LIBRE,
bool  GroupStyle = GBLANKS
 

Définition à la ligne 456 du fichier wxmaskedit.cpp.

Références GBLANKS, GZEROS, m_behav, m_firstfocus, m_parts, ParseMask(), et SetDisplay().

00462 {
00463 if ( GroupStyle == GBLANKS) m_behav = NumberGroup::NGBehaviour (GBLANKS);
00464  else   m_behav =  NumberGroup::NGBehaviour(GZEROS);
00465  this->m_firstfocus= true;
00466         //this->m_behav = beh;
00467 
00468 WX_CLEAR_ARRAY(m_parts);
00469 
00470 if ( MskStyle > 11 ) wxMessageBox("Non Conforme Style MaskEdit");
00471   //skip all events on construction
00472 this->ParseMask(mask, MskStyle);
00473 this->SetMaxLength(this->SzToL(mask.Length()));
00474 
00475 // checked if that is appropriate, m_text comes from wxMaskEdit.
00476 this->SetDisplay(this->m_Text);
00477 }


Documentation des données membres

NumberGroup::NGBehaviour m_behav [private]
 

Définition à la ligne 198 du fichier wxMaskEdit.h.

Référencé par ParseMask(), wxMaskEdit(), et wxMaskSet().

const wxString m_control = wxString("#§") [static, private]
 

Définition à la ligne 195 du fichier wxMaskEdit.h.

Référencé par IsControl().

bool m_firstfocus [private]
 

Définition à la ligne 199 du fichier wxMaskEdit.h.

Référencé par OnSetFocus(), wxMaskEdit(), et wxMaskSet().

wxString m_mask [private]
 

Définition à la ligne 183 du fichier wxMaskEdit.h.

Référencé par CtrlKey(), ParseMask(), et SetDisplay().

TextPartArray m_parts [private]
 

Définition à la ligne 196 du fichier wxMaskEdit.h.

Référencé par FindIdx(), FindItem(), FindPart(), GenMaskText(), getAbsValue(), getGroupText(), getTextValue(), ItemPos(), OnLostFocus(), ParseMask(), SetDisplay(), ToChar(), wxMaskSet(), et ~wxMaskEdit().

wxString m_Text [private]
 

Définition à la ligne 181 du fichier wxMaskEdit.h.

Référencé par wxMaskEdit().

size_t Msk_Style [private]
 

Définition à la ligne 185 du fichier wxMaskEdit.h.

Référencé par ParseMask().

size_t NbrIdx [private]
 

Définition à la ligne 184 du fichier wxMaskEdit.h.

Référencé par ParseMask().


La documentation de cette classe a été générée à partir des fichiers suivants:
Généré le Fri Oct 27 13:01:35 2006 pour wxMaskEdit par  doxygen 1.4.6-NO