text: //
  // FILE NAME: CQCIntfEng_PushButton.hpp
  //
  // AUTHOR: Dean Roddey
  //
  // CREATED: 04/13/2002
  //
  // COPYRIGHT: Charmed Quark Systems, Ltd @ 2020
  //
  //  This software is copyrighted by 'Charmed Quark Systems, Ltd' and
  //  the author (Dean Roddey.) It is licensed under the MIT Open Source
  //  license:
  //
  //  https://opensource.org/licenses/MIT
  //
  // DESCRIPTION:
  //
  //  This is the header for the CQCIntfEng_PushButton.cpp file, which
  //  implements a simple derivative of the TCQCIntfButtonBase class. In this
  //  case we provide the little extra stuff needed to create a push button.
  //
  //  We aren't directly used, but do the grunt work for a number of derived
  //  classes, command buttons, check boxes, special action buttons. They
  //  override Clicked() to do whatever they do, and may provide other type
  //  specific functionality.
  //
  // CAVEATS/GOTCHAS:
  //
  // LOG:
  //
  //  $Log$
  //
  #pragma once
  
  
  #pragma CIDLIB_PACK(CIDLIBPACK)
  
  
  // ---------------------------------------------------------------------------
  //   CLASS: TCQCIntfPushButton
  //  PREFIX: iwdg
  // ---------------------------------------------------------------------------
  class CQCINTFENGEXPORT TCQCIntfPushButton
  
      : public TCQCIntfButtonBase
        , public MCQCIntfFontIntf
        , public MCQCIntfImgListIntf
        , public MCQCIntfXlatIntf
  {
      public :
          // -------------------------------------------------------------------
          //  Public, static data
          // -------------------------------------------------------------------
          static const TString strFocusImg;
          static const TString strPressedImg;
          static const TString strUnpressedImg;
          static const TString strOverlayImg;
  
  
          // -------------------------------------------------------------------
          //  Constructors and Destructor
          // -------------------------------------------------------------------
          TCQCIntfPushButton
          (
              const   tCQCIntfEng::ECapFlags  eCapFlags
              , const TString&                strTypeName
          );
  
          TCQCIntfPushButton
          (
              const   TCQCIntfPushButton&     iwdgToCopy
          );
  
          ~TCQCIntfPushButton();
  
  
          // -------------------------------------------------------------------
          //  Public operators
          // -------------------------------------------------------------------
          TCQCIntfPushButton& operator=
          (
              const   TCQCIntfPushButton&     iwdgToAssign
          );
  
  
          // -------------------------------------------------------------------
          //  Public, inherited methods
          // -------------------------------------------------------------------
          tCIDLib::TBoolean bCanSizeTo() const override;
  
          tCIDLib::TBoolean bIsSame
          (
              const   TCQCIntfWidget&         iwdgSrc
          )   const override;
  
          tCQCKit::ECmdRes eDoCmd
          (
              const   TCQCCmdCfg&             ccfgToDo
              , const tCIDLib::TCard4         c4Index
              , const TString&                strUserId
              , const TString&                strEventId
              ,       TStdVarsTar&            ctarGlobals
              ,       tCIDLib::TBoolean&      bResult
              ,       TCQCActEngine&          acteTar
          )   override;
  
          tCIDLib::TVoid Initialize
          (
                      TCQCIntfContainer* const piwdgParent
              ,       TDataSrvClient&         dsclInit
              ,       tCQCIntfEng::TErrList&  colErrs
          )   override;
  
          tCIDLib::TVoid QueryCmds
          (
                      TCollection<TCQCCmd>&   colToFill
              , const tCQCKit::EActCmdCtx     eContext
          )   const override;
  
          tCIDLib::TVoid QueryContentSize
          (
                      TSize&                  szToFill
          )   override;
  
          tCIDLib::TVoid QueryReferencedImgs
          (
                      tCIDLib::TStrHashSet&   colToFill
              ,       tCIDLib::TStrHashSet&   colScopes
              , const tCIDLib::TBoolean       bIncludeSysImgs
              , const tCIDLib::TBoolean       bIncludeScopes
          )   const override;
  
          tCIDLib::TVoid QueryWdgAttrs
          (
                      tCIDMData::TAttrList&   colAttrs
              ,       TAttrData&              adatTmp
          )   const override;
  
          tCIDLib::TVoid RefreshImages
          (
                      TDataSrvClient&         dsclToUse
          )   override;
  
          tCIDLib::TVoid Replace
          (
              const   tCQCIntfEng::ERepFlags  eToRep
              , const TString&                strSrc
              , const TString&                strTar
              , const tCIDLib::TBoolean       bRegEx
              , const tCIDLib::TBoolean       bFullMatch
              ,       TRegEx&                 regxFind
          )   override;
  
          TSize szDefaultSize() const override;
  
          tCIDLib::TVoid SetWdgAttr
          (
                      TAttrEditWnd&           wndAttrEd
              , const TAttrData&              adatNew
              , const TAttrData&              adatOld
          )   override;
  
          tCIDLib::TVoid SetDefParms
          (
                      TCQCCmdCfg&             ccfgToSet
          )   const override;
  
          tCIDLib::TVoid Validate
          (
              const   TCQCFldCache&           cfcData
              ,       tCQCIntfEng::TErrList&  colErrs
              ,       TDataSrvClient&         dsclVal
          )   const override;
  
  
      protected :
          // -------------------------------------------------------------------
          //  Declare our friends
          // -------------------------------------------------------------------
          friend class TCQCIntfButtBmpTab;
  
  
          // -------------------------------------------------------------------
          //  Protected, inherited methods
          // -------------------------------------------------------------------
          tCIDLib::TVoid CaptionChanged() override;
  
          tCIDLib::TVoid StreamFrom
          (
                      TBinInStream&           strmToReadFrom
          )   override;
  
          tCIDLib::TVoid StreamTo
          (
                      TBinOutStream&          strmToWriteTo
          )   const override;
  
          tCIDLib::TVoid Update
          (
                      TGraphDrawDev&          gdevTarget
              , const TArea&                  areaInvalid
              ,       TGUIRegion&             grgnClip
          )   override;
  
  
          // -------------------------------------------------------------------
          //  Protected, non-virtual methods
          // -------------------------------------------------------------------
          tCIDLib::TVoid SetText
          (
              const   TString&                strToSet
              , const tCIDLib::TBoolean       bNoRedraw
              , const tCIDLib::TBoolean       bErrState
          );
  
  
      private :
          // -------------------------------------------------------------------
          //  Private data members
          //
          //  m_bErrState
          //  m_strDisplayText
          //  m_strLiveText
          //      Derived classes tell us what text to display. We will then
          //      swizzle that potentially, in two ways. We can do translations
          //      via the Xlats mixin, and the caption text can have a %(f)
          //      token in it which we'll format the derived class's text into.
          //
          //      They call SetText() to tell us what to display. They can also
          //      indicate they don't have good data to display, so we'll display
          //      the standard not available text.
          //
          //      We have to store that provided live text and error state because
          //      we allow the caption to be changed via action command. If the
          //      caption changes we have go back and reformat the display text.
          // -------------------------------------------------------------------
          tCIDLib::TBoolean   m_bErrState;
          TString             m_strDisplayText;
          TString             m_strLiveText;
  
  
          // -------------------------------------------------------------------
          //  Private, non-virtual methods
          // -------------------------------------------------------------------
          tCIDLib::TVoid DrawButton
          (
                      TGraphDrawDev&          gdevTarget
              , const TArea&                  areaInvalid
              ,       TArea&                  areaDraw
          );
  
  
          // -------------------------------------------------------------------
          //  Magic Macros
          // -------------------------------------------------------------------
          RTTIDefs(TCQCIntfPushButton,TCQCIntfButtonBase)
  };
  
  #pragma CIDLIB_POPPACK
  
  
  