Page 1 of 1
#command Syntax
Posted: Fri Oct 18, 2019 6:23 am
by Jimmy
hi,
when have a Method using Xbase++ Syntax like this
Code: Select all
METHOD XbpPBar:SetMaximum( nMaximum )
i can use
Code: Select all
#xcommand METHOD <!ClassName!>:<MethodName> => METHOD <MethodName> CLASS <ClassName>
to change it to harbour Style
now when have this Code how to enhance it to harbour Syntax
Code: Select all
CLASS XbpPBar FROM XbpIWindow, DataRef
PROTECTED:
VAR nMaximum
...
EXPORTED:
ASSIGN METHOD SetMaximum() VAR Maximum
ACCESS METHOD GetMaximum() VAR Maximum
...
ENDCLASS
METHOD XbpPBar:SetMaximum( nMaximum )
...
who can help me to translate it
p.s. this Progressbar also have ITaskbarList3 Interface to display Animation in Taskbar-Icon
http://www.hmgforum.com/download/file.php?id=9165
Re: #command Syntax
Posted: Fri Oct 18, 2019 6:26 am
by Antonio Linares
Jimmy,
Please provide full XbpPBar.prg source code to help you
Re: #command Syntax
Posted: Fri Oct 18, 2019 7:33 am
by Jimmy
hm ... em, äh ...
that sample is only a Demo Code for this Type of Syntax used by Alaska
i have my own native Control using Ot4Xb and hope Pablo will help me to "translate" it to harbour
---
but i like to learn how to translate Xbase++ CLASS Syntax to harbour CLASS Code
Code: Select all
ASSIGN METHOD SetMaximum() VAR Maximum
ACCESS METHOD GetMaximum() VAR Maximum
i think it must be something like
Code: Select all
ASSIGN SetMaximum( nVal ) INLINE ::SetMaximum( nVal )
ACCESS GetMaximum() INLINE ::GetMaximum() // -> RETURN ::Maximum
is this the right Syntax
any chance to use #xcommmand to translate Xbase++ Code to harbour Syntax
Re: #command Syntax
Posted: Fri Oct 18, 2019 11:15 am
by Antonio Linares
DATA nMaximum
METHOD SetMaximum( nVal ) INLINE ::nMaximum := nVal
METHOD GetMaximum() INLINE ::nMaximum
The simplest way uses to be the best one
Re: #command Syntax
Posted: Sat Oct 19, 2019 4:03 am
by Jimmy
hi Antonio,
Antonio Linares wrote:The simplest way uses to be the best one
i agree : keep it simple
but there is also this Syntax
that is why Alaska also use ASSIGN / ACCESS Method and Xbase++ User can " := " Syntax.
Code: Select all
PROTECTED:
VAR nMaximum
EXPORTED:
ACCESS METHOD GetMaximum() VAR Maximum
ASSIGN METHOD SetMaximum() VAR Maximum
ENDCLASS
METHOD XbpPBar:SetMaximum( nMaximum )
IF nMaximum < ::nMinimum
::nMaximum := ::nMinimum
::nMinimum := nMaximum
ELSE
::nMaximum := nMaximum
ENDIF
i'm searching for a (easy) Way to run (those) existing Xbase++ Code under harbour.
i have a HbXbase.CH like this and #include it in my Project
Code: Select all
#IFDEF __XPP__
// Xbase++ Code
#ELSE
// different harbour Code
#xtranslate XbpDialog => WvgDialog
#xtranslate XbpStatusBar => WvgStatusBar
#xtranslate XbpStatic => WvgStatic
...
#xcommand METHOD <!ClassName!>:<MethodName> => METHOD <MethodName> CLASS <ClassName>
...
#ENDIF
that Way it is less work to change Xbase++ Source to get it compile/link ... than the real Work begin.
so how do more #xcommand with harbour
---
p.s.
Progressbar is just a Sample.
i saw FW have a "green" Progressbar (PROGRESS_CLASSA) which i want to use in next Step.