/* * $Id$ */ /* . Do not edit lines in this section! NAME = ui_dbstruct */ /*----------------------------------------------------------------------*/ #include "hbclass.ch" #include "error.ch" #include "hbqtgui.ch" /*----------------------------------------------------------------------*/ CLASS ui_dbstruct DATA oParent /* . Do not edit lines in this section! */ METHOD new( oParent ) METHOD create( oParent ) METHOD destroy() METHOD connects() METHOD disconnects() ERROR HANDLER __OnError( ... ) /* */ /* . Do not edit lines in this section! */ METHOD buttonAdd_Activated( ... ) /* */ PROTECTED: DATA oUI ENDCLASS /*----------------------------------------------------------------------*/ METHOD ui_dbstruct:new( oParent ) hb_default( @oParent, ::oParent ) ::oParent := oParent RETURN Self /*----------------------------------------------------------------------*/ METHOD ui_dbstruct:create( oParent ) hb_default( @oParent, ::oParent ) ::oParent := oParent ::oUI := hbqtui_dbstruct( ::oParent ) ::connects() RETURN Self /*----------------------------------------------------------------------*/ METHOD ui_dbstruct:destroy() IF HB_ISOBJECT( ::oUI ) ::disconnects() ::oUI:destroy() ENDIF RETURN Self /*----------------------------------------------------------------------*/ METHOD ui_dbstruct:__OnError( ... ) LOCAL cMsg := __GetMessage() LOCAL oError IF SubStr( cMsg, 1, 1 ) == "_" cMsg := SubStr( cMsg, 2 ) ENDIF IF Left( cMsg, 2 ) == "Q_" IF SubStr( cMsg, 3 ) $ ::oUI:qObj RETURN ::oUI:qObj[ SubStr( cMsg, 3 ) ] ELSE oError := ErrorNew() oError:severity := ES_ERROR oError:genCode := EG_ARG oError:subSystem := "HBQT" oError:subCode := 1001 oError:canRetry := .F. oError:canDefault := .F. oError:Args := hb_AParams() oError:operation := ProcName() oError:Description := "Control <" + substr( cMsg, 3 ) + "> does not exist" Eval( ErrorBlock(), oError ) ENDIF ELSEIF ::oUI:oWidget:hasValidPointer() RETURN ::oUI:oWidget:&cMsg( ... ) ENDIF RETURN NIL /*----------------------------------------------------------------------*/ METHOD ui_dbstruct:connects() /* . Do not edit lines in this section! */ ::oUI:qObj[ "buttonAdd" ]:connect( "clicked()", {|...| ::buttonAdd_Activated( ... ) } ) /* */ RETURN Self /*----------------------------------------------------------------------*/ METHOD ui_dbstruct:disconnects() /* . Do not edit lines in this section! */ /* */ RETURN Self /*----------------------------------------------------------------------*/ /* . Do not edit code in this section! */ METHOD ui_dbstruct:buttonAdd_Activated( ... ) Local oMsg oMsg := QMessageBox() oMsg:setText( "I am just clicked and fine " ) oMsg:exec() RETURN Self /* */ /*----------------------------------------------------------------------*/