CEditEx and CStaticEx - Classes that extend the functionality of the CEdit and CStatic

Description:
Both CEditEx and CStaticEx allow for easy customization of text, background, and font attributes.

Using these classes:
See example code provided.

Attributes:

    1. COLORREF bkColor( COLORREF crColor )        COLORREF bkColor() const     2. COLORREF textColor( COLORREF crColor )        COLORREF textColor() const     3. (CEdit Only) void setCustomMask( CEditMask* editMask = 0 /* null == default */ ) - note I have tried using this feature yet.     4. (CEdit Only) void definePopupMenu( UINT uResourceID = 0 /* null == default */ ) - Overide default context menu with new menu resource.     5. void setFont( const LOGFONT* lpLogFont ); - NOTE: See CLogFont included in the CEditEx headers and CStaticEx headers        void setFont( LONG fontHeight = -8,                      LONG fontWeight = FW_NORMAL,                      UCHAR pitchAndFamily = DEFAULT_PITCH | FF_DONTCARE,                      LPCSTR faceName = _T("MS Sans Serif" );
    6. (CStaticEx Only) The following idea came from Paul DiLascia in the December 1997 issue of MSJ.         void onClickDoShellCommand( const CString& linkName ) - Use control as a link to open a link or exe         COLORREF setLinkColorVisited( COLORREF crColor ) - Sets the visit color, returns previous setting         COLORREF setLinkColorUnvisited( COLORREF crColor ) - Sets the unvisited color, returns previous setting         BOOL doCustomCursor( bool custom = true ) - show a custom cursor over the control

Download source code and demo project - 23 KB



Comments

  • visual C++ or visual nightmare

    Posted by Legacy on 07/21/2002 12:00am

    Originally posted by: Khalid

    Hello to all...
    I'm very new to Visual C++ but i'm not new to programming. I must say that I find Visual C++ by MS extremely complicated and unneededly confusing. If someone can help me, please give me the steps needed to write a small mfc program that will on a click of a button display a ListBox with the ability to add/delete strings to/from it. I've seen source code but will have to admint that it is a mystery as to be able to recreate the steps.
    Regards,,
    Khalid,,,

    Reply
  • ExEditors Library

    Posted by Legacy on 03/19/2002 12:00am

    Originally posted by: Mike Philips

    A complete collection of editors in a single file:
    
    

    http://www.exontrol.com/sg.jsp?content=products/exeditors

    Regards,
    Mike

    Reply
  • Dynamic create CStaticEx

    Posted by Legacy on 09/15/2000 12:00am

    Originally posted by: Smirnov

    Hi, after analyse this example I try do CMyStatic : public : CStatic. After dynamic create this varibale, on debug work breakpoint in WindowProc (...), but dont work breakpoint in OnLButtonDown(...).
    In downloaded project on debug all breakpoints work.
    May be some different in style ? My first argoment Create:
    Create(WS_VISIBLE|WS_BORDER ...
    Who know why I can not cath breakpoint in CMyStatic::OnLButtonDown?

    Thanks

    Reply
  • Using with a CFormView

    Posted by Legacy on 10/05/1999 12:00am

    Originally posted by: Matt Rutledge

    This works great with a CDialog but I need to use it with a CFormView class with several edit controls, I keep getting Assertion failures on _ASSERT(::IsWindow(m_hWnd)); becuase CFormView is not using CWnd* pParent;
    What do I need to change to get this to work?

    Thanks
    Matt

    Reply
  • Font weight always FW_NORMAL?

    Posted by Legacy on 08/27/1999 12:00am

    Originally posted by: Donald Thomas

    I noticed in your code that in the setFont methos where you can pass the font height and font weight that you don't use the font weight passed in. You always use FW_NORMAL. Why? Can you really not change the font weight with this method?

    Reply
  • Color does not change if control is disabled !

    Posted by Legacy on 07/19/1999 12:00am

    Originally posted by: Mango

    The color of the text in the CEditEx control does not change
    if the control is disabled, although the font size and the background seems to be correctly updated ?

    Can this situation be taken care of too ?

    Otherwise its great work..
    Thanks,
    Mango

    Reply
  • "Courier New" and right aligned

    Posted by Legacy on 06/01/1999 12:00am

    Originally posted by: Marcus

    If you use the font "Courier New" and set the alignment of the edit control to "right", then the control acts strange:
    The cursor acts left aligned and the text appears right aligned. With other fonts like "Times New Roman" or "Arial" or "MS Sans Serif" this does not happen. (BTW - I used lfPitchAndFamily = FIXED_PITCH for "Courier New")
    Any hints why this happens??

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • This paper introduces IBM Java on the IBM PowerLinux 7R2 server and describes IBM's implementation of the Java platform, which includes IBM's Java Virtual Machine and development toolkit.

  • Not all enterprise applications are created equal. Sophisticated applications need developer support but other more basic apps do not. With the right tools, everyone is a potential app developer with ideas and a perspective to share. Trends such as low-code development and model driven development are fundamentally changing how and who creates applications. Is your organization ready? Read this report and learn: The seven personas of enterprise app delivery How application ownership is spreading to the …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds