mgui/smledit.h

Go to the documentation of this file.
00001 /**
00002  * \file mgui/smledit.h
00003  * \brief SML / Query / Script Editor class
00004  *
00005  * \if NODOC
00006  * $Log: smledit.h_v $
00007  * Revision 1.5  2003/10/03 19:58:19  linux32build!build
00008  * Doxygen
00009  *
00010  * Revision 1.4  2003/09/15 13:49:32  fileserver!dwilliss
00011  * Doxygen
00012  *
00013  * Revision 1.3  2002/10/10 20:29:21  mju
00014  * Move to 'mgui' folder.
00015  *
00016  * Revision 1.1  2002/08/14 20:48:23  dwilliss
00017  * Initial revision
00018  *
00019  * 
00020  * 3     5/07/02 3:52p Dwilliss
00021  * 
00022  * 2     12/13/01 10:55a Mju
00023  * MGUI unificiation with X.
00024  * 
00025  * 1     10/18/01 11:05a Mju
00026  * \endif
00027 **/
00028 
00029 #ifndef INC_MGUI_SMLEDIT_H
00030 #define INC_MGUI_SMLEDIT_H
00031 
00032 #ifndef  INC_MGUI_CTRL_H
00033 #include <mgui/ctrl.h>
00034 #endif
00035 
00036 #ifndef  INC_MI32_SML_H
00037 #include <mi32/sml.h>
00038 #endif
00039 
00040 class SCRIPTVIEW;
00041 
00042 namespace MGUI {
00043 
00044 //! Form for use in any MGUI_DIALOG to edit database queries
00045 //!
00046 class FORM_SMLEDITOR : public MGUI::FORM {
00047    public:
00048 
00049       //! Default constructor, initializes only.
00050       FORM_SMLEDITOR ();
00051 
00052       //! Destructor.
00053       ~FORM_SMLEDITOR ();
00054 
00055       //! Check to see if the syntax of the current query is valid.
00056       //! Returns true if valid, false if not.
00057       bool CheckSyntax (
00058          bool bShowError = true        //!< If syntax invalid, display error if true
00059          );
00060 
00061       //! Create the form.
00062       void Create (
00063          MGUI::LAYOUT_PANE_BASE& ParentPane,
00064          int width = 30,               //!< Width of editor part of form in 'em' characters
00065          int height = 10,              //!< Height of editor part of form in characters
00066          MGUI::LAYOUT_SIZEALIGN sizealign= MGUI::LAYOUT_SIZEALIGN_Expand,
00067          bool bFileIcons = true        //!< If true (default), tool bar will have open/save icons
00068          );
00069 
00070       //! Get the current script string.
00071       const MISTRING& GetScript (
00072          );
00073 
00074       //! Get toolbar pane, usually to add additional buttons.
00075       MGUI::LAYOUT_PANE& GetToolBarPane (
00076          );
00077 
00078       //! Returns true if the query has changed since it was last set.
00079       bool HasChanged (
00080          ) const;
00081 
00082       //! Determine if form has been created.
00083       //! @return true if created, false if not.
00084       virtual bool IsCreated (
00085          ) const;
00086 
00087       //! Determine if form is enabled for keyboard or mouse input.
00088       //! @return true if enabled, false if not, or if not yet created.
00089       virtual bool IsEnabled (
00090          ) const;
00091 
00092       //! Open the documentation window.
00093       void OpenDocumentation (
00094          );
00095 
00096       //! Set the SMLCONTEXT for this editor.
00097       //!
00098       //!   The following QFLAGs are implemented (defined in sml.h)
00099       //!
00100       //!      QFLAG_FileExtnSML    Make Open/Save/Save As buttons expect .sml files by default (normally expects .qry)
00101       //!      
00102       void SetContext (
00103          SMLCONTEXT* context,
00104          int segment,
00105          UINT32 flags = 0     //!< QFLAG_ constants from sml.h (QFLAG_FileExtnSML)
00106          );
00107 
00108       //! Set whether mouse or keyboard input to form is allowed.
00109       virtual void SetEnabled (
00110          bool enabled = true
00111          );
00112 
00113       //! Set the script string.
00114       void SetScript (
00115          const MISTRING& script
00116          );
00117 
00118       //! Set whether form is visible or not.
00119       virtual void SetVisible (
00120          bool visible = true
00121          );
00122 
00123    private:
00124       #ifndef GENERATING_DOXYGEN_OUTPUT
00125       SCRIPTVIEW* m_pView;
00126       #endif // GENERATING_DOXYGEN_OUTPUT
00127 
00128    };
00129 
00130 }  // End namespace MGUI
00131 
00132 
00133 #endif   // INC_MGUI_SMLEDIT
00134 

Generated on Thu Aug 12 06:18:29 2004 for TNTsdk by doxygen 1.3.4-20031026