2011-08-12 18:06 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
+ contrib/hbcuied
+ contrib/hbcuied/cu_achoi.prg
+ contrib/hbcuied/cu_desgn.prg
+ contrib/hbcuied/cu_field.prg
+ contrib/hbcuied/cu_main.prg
+ contrib/hbcuied/cu_menu.prg
+ contrib/hbcuied/cu_outpt.prg
+ contrib/hbcuied/cu_prpty.prg
+ contrib/hbcuied/cu_utlty.prg
+ contrib/hbcuied/hbcuied.ch
+ contrib/hbcuied/hbcuied.hbp
+ Added: initial commit of Harbour's CUI Forms Editor.
NOTE: It is a work-in-progress and hence is subject
to heavy changes. For now you can just play with
it, though, it does not offer anything singnificant.
Only building blocks are set in place.
This code has been pulled out from my application
sources which is a part of much larger reports
object. Hence, it contains some code which
eventually will be stripped out. Also sources
need to be formatted heavily per Harbour standards.
During next several days I will be occupied with
this development. Any suggessions coming in way
will highly benefit this tool.
This commit is contained in:
@@ -16,6 +16,35 @@
|
||||
The license applies to all entries newer than 2009-04-28.
|
||||
*/
|
||||
|
||||
2011-08-12 18:06 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
|
||||
+ contrib/hbcuied
|
||||
+ contrib/hbcuied/cu_achoi.prg
|
||||
+ contrib/hbcuied/cu_desgn.prg
|
||||
+ contrib/hbcuied/cu_field.prg
|
||||
+ contrib/hbcuied/cu_main.prg
|
||||
+ contrib/hbcuied/cu_menu.prg
|
||||
+ contrib/hbcuied/cu_outpt.prg
|
||||
+ contrib/hbcuied/cu_prpty.prg
|
||||
+ contrib/hbcuied/cu_utlty.prg
|
||||
+ contrib/hbcuied/hbcuied.ch
|
||||
+ contrib/hbcuied/hbcuied.hbp
|
||||
+ Added: initial commit of Harbour's CUI Forms Editor.
|
||||
|
||||
NOTE: It is a work-in-progress and hence is subject
|
||||
to heavy changes. For now you can just play with
|
||||
it, though, it does not offer anything singnificant.
|
||||
Only building blocks are set in place.
|
||||
|
||||
This code has been pulled out from my application
|
||||
sources which is a part of much larger reports
|
||||
object. Hence, it contains some code which
|
||||
eventually will be stripped out. Also sources
|
||||
need to be formatted heavily per Harbour standards.
|
||||
|
||||
During next several days I will be occupied with
|
||||
this development. Any suggessions coming in way
|
||||
will highly benefit this tool.
|
||||
|
||||
2011-08-12 15:49 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
|
||||
* contrib/hbide/ideactions.prg
|
||||
* contrib/hbide/ideedit.prg
|
||||
|
||||
817
harbour/contrib/hbcuied/cu_achoi.prg
Normal file
817
harbour/contrib/hbcuied/cu_achoi.prg
Normal file
@@ -0,0 +1,817 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* CUI Forms Editor
|
||||
*
|
||||
* Copyright 2011 Pritpal Bedi <bedipritpal@hotmail.com>
|
||||
* http://harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
/*----------------------------------------------------------------------*/
|
||||
/*----------------------------------------------------------------------*/
|
||||
/*----------------------------------------------------------------------*/
|
||||
/*
|
||||
* EkOnkar
|
||||
* ( The LORD is ONE )
|
||||
*
|
||||
* Harbour CUI Editor Source
|
||||
*
|
||||
* Pritpal Bedi
|
||||
* 13Aug2011
|
||||
*/
|
||||
/*----------------------------------------------------------------------*/
|
||||
/*----------------------------------------------------------------------*/
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
#include "inkey.ch"
|
||||
#include "setcurs.ch"
|
||||
#include "set.ch"
|
||||
#include "achoice.ch"
|
||||
#include "common.ch"
|
||||
#include "hbclass.ch"
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
#define K_MOVING 1001
|
||||
#define K_LEFT_DOWN 1002
|
||||
#define K_LEFT_DBLCLICK 1006
|
||||
#define K_LEFT_UP 1003
|
||||
#define K_RIGHT_DOWN 1004
|
||||
#define K_RIGHT_DBLCLICK 1007
|
||||
#define K_RIGHT_UP 1005
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
#define INRANGE( xLo, xVal, xHi ) ( ( xVal >= xLo ) .AND. ( xVal <= xHi ) )
|
||||
#define BETWEEN( xLo, xVal, xHi ) min( max( xLo, xVal ), xHi )
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
FUNCTION VouchAChoice( nTop, nLft, nBtm, nRgt, acItems, xSelect, cUserFunc, nPos, nHiLytRow, oWin, nLastKey, cargo_ )
|
||||
LOCAL nChoice, oChoice
|
||||
LOCAL crs := SetCursor( 0 )
|
||||
|
||||
oChoice := AChoiceNew():New( nTop, nLft, nBtm, nRgt, acItems, xSelect, ;
|
||||
cUserFunc, ;
|
||||
nPos, nHiLytRow, oWin, nLastKey, cargo_ )
|
||||
oChoice:Exe()
|
||||
nChoice := oChoice:nPos
|
||||
nLastKey := oChoice:nKey
|
||||
oChoice:Destroy()
|
||||
|
||||
SetCursor( crs )
|
||||
|
||||
RETURN ( nChoice )
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
CREATE CLASS AChoiceNew
|
||||
|
||||
VAR nTop, nLeft, nBottom, nRight
|
||||
VAR acItems
|
||||
VAR xSelect
|
||||
VAR cUserFunc
|
||||
VAR nPos
|
||||
VAR nHiLiteRow
|
||||
VAR oWin
|
||||
VAR cargo_
|
||||
VAR nNumCols
|
||||
VAR nNumRows
|
||||
VAR acCopy
|
||||
VAR alSelect
|
||||
VAR nNewPos
|
||||
VAR lFinished
|
||||
VAR nKey
|
||||
VAR nMode
|
||||
VAR nAtTop
|
||||
VAR nAtBtm
|
||||
VAR nItems
|
||||
VAR bScan
|
||||
VAR lUserFunc
|
||||
VAR nUserFunc
|
||||
VAR bUserFunc
|
||||
VAR cLoClr
|
||||
VAR cHiClr
|
||||
VAR cUnClr
|
||||
VAR nFrstItem
|
||||
VAR nLastItem
|
||||
VAR bAction
|
||||
VAR mrc_
|
||||
|
||||
METHOD init
|
||||
METHOD Destroy
|
||||
METHOD DispPageNew
|
||||
METHOD DispLineNew
|
||||
METHOD Up
|
||||
METHOD Down
|
||||
METHOD PageUp
|
||||
METHOD PageDown
|
||||
METHOD GoTop
|
||||
METHOD GoBottom
|
||||
METHOD Top
|
||||
METHOD Bottom
|
||||
METHOD GoTo
|
||||
METHOD Exe
|
||||
METHOD DeHilite
|
||||
METHOD HiLite
|
||||
METHOD DispAtNew
|
||||
|
||||
ENDCLASS
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
METHOD AChoiceNew:Destroy()
|
||||
|
||||
RETURN NIL
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
METHOD AChoiceNew:init( nTop, nLft, nBtm, nRgt, acItems, xSelect, ;
|
||||
cUserFunc, nPos, nHiLiteRow, oWin, nLastKey, cargo_ )
|
||||
LOCAL nCntr
|
||||
|
||||
HB_SYMBOL_UNUSED( nLastKey )
|
||||
|
||||
DEFAULT nTop TO 0 // The topmost row of the window
|
||||
DEFAULT nLft TO 0 // The leftmost column of the window
|
||||
DEFAULT nBtm TO maxrow() + 1 // The bottommost row of the windows
|
||||
DEFAULT nRgt TO maxcol() + 1 // The rightmost column of the window
|
||||
DEFAULT acItems TO {} // The items FROM which TO choose
|
||||
DEFAULT xSelect TO .T. // Array OR logical, what is selectable
|
||||
DEFAULT cUserFunc TO NIL // Optional FUNCTION FOR key exceptions
|
||||
DEFAULT nPos TO 1 // The number of the selected item
|
||||
DEFAULT nHiLiteRow TO 0 // The row TO be highlighted
|
||||
|
||||
::nTop := nTop
|
||||
::nLeft := nLft
|
||||
::nBottom := nBtm
|
||||
::nRight := nRgt
|
||||
::acItems := acItems
|
||||
::xSelect := xSelect
|
||||
::cUserFunc := cUserFunc
|
||||
::nPos := nPos
|
||||
::nHiLiteRow := nHiLiteRow
|
||||
::oWin := oWin
|
||||
::cargo_ := cargo_
|
||||
|
||||
::nNumCols := 0 // Number of columns IN the window
|
||||
::nNumRows := 0 // Number of rows IN the window
|
||||
::acCopy := {} // A padded copy of the items
|
||||
::alSelect := {} // Select permission
|
||||
::nNewPos := 0 // The NEXT item TO be selected
|
||||
::lFinished := .F. // Is processing finished?
|
||||
::nKey := 0 // The keystroke TO be processed
|
||||
::nMode := AC_IDLE // The current operating mode
|
||||
::nAtTop := 1 // The number of the item at the top
|
||||
::nAtBtm := 1 // The number of the item at the bottom
|
||||
::nItems := 0 // The number of items
|
||||
::bScan := { | cX | IF( left( cX, 1 ) == upper( chr( ::nKey ) ), .T., .F. ) }
|
||||
::lUserFunc := ( !empty( ::cUserFunc ) )
|
||||
::nUserFunc := 0 // RETURN value FROM user FUNCTION
|
||||
::bUserFunc := { || AC_ABORT } // Block form of user FUNCTION
|
||||
::cLoClr := Before( ",", setcolor() )
|
||||
::cHiClr := Before( ",", After( ",", setcolor() ) )
|
||||
::cUnClr := After( ",", After( ",", After( ",", After( ",", setcolor() ) ) ) )
|
||||
::nFrstItem := 0
|
||||
::nLastItem := 0
|
||||
::bAction := NIL
|
||||
::mrc_ := {}
|
||||
|
||||
IF ::lUserFunc
|
||||
::bUserFunc := &( "{|nM,nP,nH,nK,aC|" + ::cUserFunc + "(nM,nP,nH,nK,aC)}" )
|
||||
ENDIF
|
||||
|
||||
IF empty( ::cHiClr )
|
||||
::cHiClr := After( "/", ::cLoClr ) + "/" + Before( "/", ::cLoClr )
|
||||
ENDIF
|
||||
|
||||
IF empty( ::cUnClr )
|
||||
::cUnClr := ::cLoClr
|
||||
ENDIF
|
||||
|
||||
::nNumCols := ::nRight - ::nLeft + 1
|
||||
::nNumRows := ::nBottom - ::nTop + 1
|
||||
|
||||
aeval( ::acItems, { | x | IF( valtype( x ) == "C", aadd( ::acCopy, padr( x, ::nNumCols ) ), .F. ) } )
|
||||
::nItems := len( ::acCopy )
|
||||
|
||||
::alSelect := array( ::nItems )
|
||||
|
||||
IF valtype( ::xSelect ) == "A"
|
||||
afill( ::alSelect, .T. )
|
||||
FOR nCntr := 1 TO len( ::xSelect )
|
||||
IF nCntr <= ::nItems
|
||||
IF valtype( ::xSelect[ nCntr ] ) == "C"
|
||||
IF empty( ::xSelect[ nCntr ] )
|
||||
::lFinished := .T.
|
||||
::nPos := 0
|
||||
ELSE
|
||||
::alSelect[ nCntr ] := &( ::xSelect[ nCntr ] )
|
||||
ENDIF
|
||||
ELSE
|
||||
::alSelect[ nCntr ] := ::xSelect[ nCntr ]
|
||||
ENDIF
|
||||
ELSE
|
||||
nCntr := len( ::xSelect ) + 1
|
||||
ENDIF
|
||||
NEXT
|
||||
ELSE
|
||||
afill( ::alSelect, ::xSelect )
|
||||
ENDIF
|
||||
|
||||
RETURN SELF
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
METHOD AChoiceNew:Exe()
|
||||
|
||||
IF !( ::lFinished )
|
||||
::nFrstItem := ascan( ::alSelect, .T. ) // First valid item
|
||||
|
||||
IF ::nFrstItem == 0
|
||||
::nLastItem := 0
|
||||
::nPos := 0
|
||||
::nMode := AC_NOITEM
|
||||
ELSE
|
||||
::nMode := AC_IDLE
|
||||
::nLastItem := ::nItems
|
||||
DO WHILE ( !( ::alSelect[ ::nLastItem ] ) )
|
||||
::nLastItem--
|
||||
ENDDO
|
||||
ENDIF
|
||||
|
||||
// Ensure hilighted item can be selected
|
||||
::nPos := BETWEEN( ::nFrstItem, ::nPos, ::nLastItem )
|
||||
::nNewPos := ::nPos
|
||||
IF !( ::alSelect[ ::nNewPos ] )
|
||||
IF ::nNewPos == ::nLastItem
|
||||
::nNewPos := ::nFrstItem
|
||||
ENDIF
|
||||
DO WHILE ( !( ::alSelect[ ::nNewPos ] ) )
|
||||
::nNewPos++
|
||||
ENDDO
|
||||
ENDIF
|
||||
::nPos := ::nNewPos
|
||||
|
||||
// Force hilighted row TO be valid
|
||||
//
|
||||
::nHiLiteRow := BETWEEN( 0, ::nHiLiteRow, ::nNumRows - 1 )
|
||||
|
||||
// Force the topmost item TO be a valid index of the array
|
||||
//
|
||||
::nAtTop := BETWEEN( 1, max( 1, ::nPos - ::nHiLiteRow ), ::nItems )
|
||||
|
||||
// Ensure as much of the selection area as possible is covered
|
||||
//
|
||||
IF ( ::nAtTop + ::nNumRows - 1 ) > ::nItems
|
||||
::nAtTop := max( 1, ::nItems - ::nNumrows + 1 )
|
||||
ENDIF
|
||||
|
||||
::DispPageNew()
|
||||
ENDIF
|
||||
|
||||
DO WHILE ( !::lFinished )
|
||||
|
||||
IF ::nMode != AC_GOTO .AND. ::nMode != AC_NOITEM
|
||||
::nKey := inkey( , INKEY_ALL + HB_INKEY_GTEVENT )
|
||||
::nMode := AC_IDLE
|
||||
::mrc_ := { 0, 0, mRow(), mCol(), 0, LastKey(), .f. }
|
||||
ENDIF
|
||||
|
||||
#ifdef __WVT__
|
||||
IF nLastPos <> ::nPos
|
||||
Wvt_DrawFocusRect( ::nTop + ( ::nPos - ::nAtTop ), ::nLeft, ;
|
||||
::nTop + ( ::nPos - ::nAtTop ), ::nRight )
|
||||
nLastPos := ::nPos
|
||||
ENDIF
|
||||
#ENDIF
|
||||
|
||||
DO CASE
|
||||
CASE ( ::bAction := SetKey( ::nKey ) ) != NIL
|
||||
eval( ::bAction, ProcName( 1 ), ProcLine( 1 ), '' )
|
||||
|
||||
CASE ::nKey == K_MOVING
|
||||
::nPos := ::DispAtNew()
|
||||
|
||||
CASE ::nKey == K_MWFORWARD
|
||||
::Up()
|
||||
|
||||
CASE ::nKey == K_MWBACKWARD
|
||||
::Down()
|
||||
|
||||
CASE ::nKey == K_LDBLCLK
|
||||
::nPos := ::DispAtNew()
|
||||
::nMode := AC_SELECT
|
||||
|
||||
CASE ::nKey == K_LEFT_DOWN
|
||||
IF ::mrc_[ 3 ] >= ::nTop .AND. ::mrc_[ 3 ] <= ::nBottom .AND. ;
|
||||
::mrc_[ 4 ] >= ::nLeft .AND. ::mrc_[ 4 ] <= ::nRight
|
||||
keyboard( chr( K_ENTER ) )
|
||||
ENDIF
|
||||
|
||||
CASE ( ( ::nKey == K_ESC ) .OR. ( ::nMode == AC_NOITEM ) ) .AND. ( !::lUserFunc )
|
||||
::nMode := AC_ABORT
|
||||
::nPos := 0
|
||||
::lFinished := .T.
|
||||
|
||||
CASE ::nKey == K_UP
|
||||
::Up()
|
||||
|
||||
CASE ::nKey == K_DOWN
|
||||
::Down()
|
||||
|
||||
CASE ::nKey == K_PGUP
|
||||
::PageUp()
|
||||
|
||||
CASE ::nKey == K_PGDN
|
||||
::PageDown()
|
||||
|
||||
CASE ::nKey == K_HOME
|
||||
::Top()
|
||||
|
||||
CASE ::nKey == K_END
|
||||
::Bottom()
|
||||
|
||||
CASE ( ::nKey == K_CTRL_HOME .OR. ::nKey == K_CTRL_PGUP )
|
||||
::GoTop()
|
||||
|
||||
CASE ( ::nKey == K_CTRL_END .OR. ::nKey == K_CTRL_PGDN )
|
||||
::GoBottom()
|
||||
|
||||
CASE ( ::nKey == K_ENTER ) .AND. ( !::lUserFunc )
|
||||
::nMode := AC_SELECT
|
||||
::lFinished := .T.
|
||||
|
||||
CASE ( ::nKey == K_RIGHT ) .AND. ( !::lUserFunc )
|
||||
::nPos := 0
|
||||
::lFinished := .T.
|
||||
|
||||
CASE ( ::nKey == K_LEFT ) .AND. ( !::lUserFunc )
|
||||
::nPos := 0
|
||||
::lFinished := .T.
|
||||
|
||||
CASE INRANGE( 32, ::nKey, 255 ) .AND. ( ( !::lUserFunc ) .OR. ( ::nMode == AC_GOTO ) )
|
||||
::GoTo()
|
||||
::nMode := AC_IDLE
|
||||
|
||||
CASE ::nMode == AC_GOTO
|
||||
::nMode := AC_IDLE
|
||||
|
||||
OTHERWISE
|
||||
IF ::nKey == 0
|
||||
::nMode := AC_IDLE
|
||||
ELSE
|
||||
::nMode := AC_EXCEPT
|
||||
ENDIF
|
||||
|
||||
ENDCASE
|
||||
|
||||
IF ::lUserFunc
|
||||
::nUserFunc := eval( ::bUserFunc, ::nMode, ::nPos, ;
|
||||
::nPos - ::nAtTop, ::nKey, ::cargo_ )
|
||||
DO CASE
|
||||
CASE ::nUserFunc == AC_ABORT
|
||||
::lFinished := .T.
|
||||
::nPos := 0
|
||||
|
||||
CASE ::nUserFunc == AC_SELECT
|
||||
::lFinished := .T.
|
||||
|
||||
CASE ::nUserFunc == AC_CONT
|
||||
|
||||
CASE ::nUserFunc == AC_GOTO
|
||||
::nMode := AC_GOTO
|
||||
|
||||
ENDCASE
|
||||
ENDIF
|
||||
ENDDO
|
||||
|
||||
RETURN SELF
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
METHOD AChoiceNew:DispPageNew()
|
||||
LOCAL nCntr
|
||||
LOCAL nRow := row()
|
||||
LOCAL nCol := col()
|
||||
LOCAL nRowPos, nPos
|
||||
|
||||
DispBegin()
|
||||
|
||||
FOR nCntr := 1 TO ::nNumRows
|
||||
nRowPos := ::nTop + nCntr - 1
|
||||
nPos := ::nAtTop + nCntr - 1
|
||||
|
||||
IF INRANGE( 1, nPos, ::nItems )
|
||||
::DispLineNew( nPos, nRowPos, nPos == ::nPos )
|
||||
ELSE
|
||||
DispOutAt( nRowPos, ::nLeft, space( len( ::acCopy[ 1 ] ) ), ::cLoClr, ::oWin )
|
||||
ENDIF
|
||||
NEXT
|
||||
|
||||
DispEnd()
|
||||
|
||||
SetPos( nRow,nCol )
|
||||
|
||||
RETURN SELF
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
METHOD AChoiceNew:DispLineNew( nPos, nRow, lHiLite )
|
||||
|
||||
DispOutAt( nRow, ::nLeft, ::acCopy[ nPos ],;
|
||||
IF( ::alSelect[ nPos ], ;
|
||||
IF( lHiLite, ::cHiClr, ::cLoClr ), ::cUnClr ), ::oWin )
|
||||
|
||||
RETURN SELF
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
METHOD AChoiceNew:DeHilite()
|
||||
|
||||
::DispLineNew( ::nPos, ::nTop + ( ::nPos - ::nAtTop ), .F. )
|
||||
|
||||
RETURN SELF
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
METHOD AChoiceNew:HiLite()
|
||||
|
||||
::DispLineNew( ::nPos, ::nTop + ( ::nPos - ::nAtTop ), .T. )
|
||||
|
||||
RETURN SELF
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
METHOD AChoiceNew:Up()
|
||||
LOCAL nScroll
|
||||
|
||||
IF ::nPos == ::nFrstItem
|
||||
::nMode := AC_HITTOP
|
||||
IF ::nAtTop > max( 1, ::nPos - ::nNumRows + 1 )
|
||||
::nAtTop := max( 1, ::nPos - ::nNumRows + 1 )
|
||||
::DispPageNew()
|
||||
ENDIF
|
||||
ELSE
|
||||
::nNewPos := ::nPos - 1
|
||||
DO WHILE !( ::alSelect[ ::nNewPos ] )
|
||||
::nNewPos--
|
||||
ENDDO
|
||||
|
||||
IF INRANGE( ::nAtTop, ::nNewPos, ::nAtTop + ::nNumRows - 1 )
|
||||
::DeHilite()
|
||||
::nPos := ::nNewPos
|
||||
::HiLite()
|
||||
ELSE
|
||||
DispBegin()
|
||||
|
||||
::DeHilite()
|
||||
|
||||
nScroll := max( -::nNumRows, ( ::nNewPos - ( ::nAtTop + ::nNumRows - 1 ) ) )
|
||||
Scroll( ::nTop, ::nLeft, ::nBottom, ::nRight, nScroll )
|
||||
|
||||
::nAtTop := ::nNewPos
|
||||
::nPos := max( ::nPos, ::nAtTop + ::nNumRows - 1 )
|
||||
|
||||
DO WHILE ( ::nPos > ::nNewPos )
|
||||
::DispLineNew( ::nPos, ::nTop + ( ::nPos - ::nAtTop ), .F. )
|
||||
::nPos--
|
||||
ENDDO
|
||||
|
||||
::HiLite()
|
||||
|
||||
Dispend()
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
RETURN SELF
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
METHOD AChoiceNew:Down()
|
||||
LOCAL nScroll
|
||||
|
||||
IF ::nPos == ::nLastItem
|
||||
::nMode := AC_HITBOTTOM
|
||||
IF ::nAtTop < min( ::nPos, ::nItems - ::nNumRows + 1 )
|
||||
::nAtTop := min( ::nPos, ::nItems - ::nNumRows + 1 )
|
||||
::DispPageNew()
|
||||
ENDIF
|
||||
ELSE
|
||||
::nNewPos := ::nPos + 1
|
||||
DO WHILE !( ::alSelect[ ::nNewPos ] )
|
||||
::nNewPos++
|
||||
ENDDO
|
||||
|
||||
IF INRANGE( ::nAtTop, ::nNewPos, ::nAtTop + ::nNumRows - 1 )
|
||||
::DeHilite()
|
||||
::nPos := ::nNewPos
|
||||
::HiLite()
|
||||
ELSE
|
||||
Dispbegin()
|
||||
|
||||
::DeHilite()
|
||||
|
||||
nScroll := min( ::nNumRows, ( ::nNewPos - ( ::nAtTop + ::nNumRows - 1 ) ) )
|
||||
scroll( ::nTop, ::nLeft, ::nBottom, ::nRight, nScroll )
|
||||
|
||||
::nAtTop := ::nNewPos - ::nNumRows + 1
|
||||
::nPos := max( ::nPos, ::nAtTop )
|
||||
DO WHILE ( ::nPos < ::nNewPos )
|
||||
::DispLineNew( ::nPos, ::nTop + ( ::nPos - ::nAtTop ), .F. )
|
||||
::nPos ++
|
||||
ENDDO
|
||||
|
||||
::Hilite()
|
||||
|
||||
Dispend()
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
RETURN SELF
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
METHOD AChoiceNew:PageUp()
|
||||
|
||||
IF ::nPos == ::nFrstItem
|
||||
::nMode := AC_HITTOP
|
||||
IF ::nAtTop > max( 1, ::nPos - ::nNumRows + 1 )
|
||||
::nAtTop := max( 1, ::nPos - ::nNumRows + 1 )
|
||||
::DispPageNew()
|
||||
ENDIF
|
||||
ELSE
|
||||
IF INRANGE( ::nAtTop, ::nFrstItem, ::nAtTop + ::nNumRows - 1 )
|
||||
::nPos := ::nFrstItem
|
||||
::nAtTop := max( ::nPos - ::nNumRows + 1, 1 )
|
||||
::DispPageNew()
|
||||
ELSE
|
||||
IF ( ::nPos - ::nNumRows + 1 ) < ::nFrstItem
|
||||
::nPos := ::nFrstItem
|
||||
::nAtTop := ::nFrstItem
|
||||
ELSE
|
||||
::nPos := max( ::nFrstItem, ::nPos - ::nNumRows + 1 )
|
||||
::nAtTop := max( 1, ::nAtTop - ::nNumRows + 1 )
|
||||
DO WHILE ( ::nPos > ::nFrstItem ) .AND. ( !( ::alSelect[ ::nPos ] ) )
|
||||
::nPos--
|
||||
::nAtTop--
|
||||
ENDDO
|
||||
::nAtTop := max( 1, ::nAtTop )
|
||||
ENDIF
|
||||
::DispPageNew()
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
RETURN SELF
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
METHOD AChoiceNew:PageDown()
|
||||
LOCAL nGap
|
||||
|
||||
IF ::nPos == ::nLastItem
|
||||
::nMode := AC_HITBOTTOM
|
||||
IF ::nAtTop < min( ::nPos, max( 1, ::nItems - ::nNumRows + 1 ) )
|
||||
::nAtTop := min( ::nPos, max( 1, ::nItems - ::nNumRows + 1 ) )
|
||||
::DispPageNew()
|
||||
ENDIF
|
||||
ELSE
|
||||
IF INRANGE( ::nAtTop, ::nLastItem, ::nAtTop + ::nNumRows - 1 )
|
||||
::DeHilite()
|
||||
::nPos := ::nLastItem
|
||||
::Hilite()
|
||||
ELSE
|
||||
nGap := ::nPos - ::nAtTop
|
||||
::nPos := min( ::nLastItem, ::nPos + ::nNumRows - 1 )
|
||||
IF ( ::nPos + ::nNumRows - 1 ) > ::nLastItem
|
||||
::nAtTop := ::nLastItem - ::nNumRows + 1
|
||||
::nPos := min( ::nLastItem, ::nAtTop + nGap )
|
||||
ELSE
|
||||
::nAtTop := ::nPos - nGap
|
||||
ENDIF
|
||||
|
||||
DO WHILE ( ::nPos < ::nLastItem ) .AND. !( ::alSelect[ ::nPos ] )
|
||||
::nPos++
|
||||
::nAtTop++
|
||||
ENDDO
|
||||
|
||||
DO WHILE ( ::nAtTop + ::nNumRows - 1 ) > ::nItems
|
||||
::nAtTop--
|
||||
ENDDO
|
||||
::DispPageNew()
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
RETURN SELF
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
METHOD AChoiceNew:Top()
|
||||
|
||||
IF ::nPos == ::nFrstItem
|
||||
IF ::nAtTop == max( 1, ::nPos - ::nNumRows + 1 )
|
||||
::nMode := AC_HITTOP
|
||||
ELSE
|
||||
::nAtTop := max( 1, ::nPos - ::nNumRows + 1 )
|
||||
::DispPageNew()
|
||||
ENDIF
|
||||
ELSE
|
||||
::nNewPos := ::nAtTop
|
||||
DO WHILE !( ::alSelect[ ::nNewPos ] )
|
||||
::nNewPos++
|
||||
ENDDO
|
||||
IF ::nNewPos != ::nPos
|
||||
::DeHilite()
|
||||
::nPos := ::nNewPos
|
||||
::HiLite()
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
RETURN SELF
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
METHOD AChoiceNew:Bottom()
|
||||
|
||||
IF ::nPos == ::nLastItem
|
||||
IF ::nAtTop == min( ::nPos, ::nItems - ::nNumRows + 1 )
|
||||
::nMode := AC_HITBOTTOM
|
||||
ELSE
|
||||
::nAtTop := min( ::nPos, ::nItems - ::nNumRows + 1 )
|
||||
::DispPageNew()
|
||||
ENDIF
|
||||
ELSE
|
||||
::nNewPos := ::nAtTop + ::nNumRows - 1
|
||||
DO WHILE !( ::alSelect[ ::nNewPos ] )
|
||||
::nNewPos--
|
||||
ENDDO
|
||||
IF ::nNewPos != ::nPos
|
||||
::DeHilite()
|
||||
::nPos := ::nNewPos
|
||||
::HiLite()
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
RETURN SELF
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
METHOD AChoiceNew:GoTop()
|
||||
|
||||
IF ::nPos == ::nFrstItem
|
||||
IF ::nAtTop == max( 1, ::nPos - ::nNumRows + 1 )
|
||||
::nMode := AC_HITTOP
|
||||
ELSE
|
||||
::nAtTop := max( 1, ::nPos - ::nNumRows + 1 )
|
||||
::DispPageNew()
|
||||
ENDIF
|
||||
ELSE
|
||||
::nPos := ::nFrstItem
|
||||
::nAtTop := ::nPos
|
||||
::DispPageNew()
|
||||
ENDIF
|
||||
|
||||
RETURN SELF
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
METHOD AChoiceNew:GoBottom()
|
||||
|
||||
IF ::nPos == ::nLastItem
|
||||
IF ::nAtTop == min( ::nLastItem, ::nItems - ::nNumRows + 1 )
|
||||
::nMode := AC_HITBOTTOM
|
||||
ELSE
|
||||
::nAtTop := min( ::nLastItem, ::nItems - ::nNumRows + 1 )
|
||||
::DispPageNew()
|
||||
ENDIF
|
||||
ELSE
|
||||
IF INRANGE( ::nAtTop, ::nLastItem, ::nAtTop + ::nNumRows - 1 )
|
||||
::DeHilite()
|
||||
::nPos := ::nLastItem
|
||||
::HiLite()
|
||||
ELSE
|
||||
::nPos := ::nLastItem
|
||||
::nAtTop := max( 1, ::nPos - ::nNumRows + 1 )
|
||||
::DispPageNew()
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
RETURN SELF
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
METHOD AChoiceNew:GoTo()
|
||||
|
||||
::nNewPos := ascan( ::acCopy, ::bScan, ::nPos + 1 )
|
||||
DO WHILE INRANGE( ::nPos, ::nNewPos, ::nLastItem ) .AND. !( ::alSelect[ ::nNewPos ] )
|
||||
::nNewPos := ascan( ::acCopy, ::bScan, ::nNewPos + 1 )
|
||||
ENDDO
|
||||
|
||||
IF ::nNewPos == 0
|
||||
::nNewPos := ascan( ::acCopy, ::bScan )
|
||||
DO WHILE INRANGE( 1, ::nNewPos, ::nLastItem ) .AND. !( ::alSelect[ ::nNewPos ] )
|
||||
::nNewPos := ascan( ::acCopy, ::bScan, ::nNewPos + 1 )
|
||||
ENDDO
|
||||
ENDIF
|
||||
|
||||
IF INRANGE( ::nFrstItem, ::nNewPos, ::nLastItem ) .AND. ::alSelect[ ::nNewPos ]
|
||||
IF INRANGE( ::nAtTop, ::nNewPos, ::nAtTop + ::nNumRows - 1 )
|
||||
::DeHilite()
|
||||
::nPos := ::nNewPos
|
||||
::HiLite()
|
||||
ELSE
|
||||
::nPos := ::nNewPos
|
||||
::nAtTop := BETWEEN( 1, ::nPos - ::nNumRows + 1, ::nItems )
|
||||
::DispPageNew()
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
RETURN SELF
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
METHOD AChoiceNew:DispAtNew()
|
||||
LOCAL nNewPos
|
||||
|
||||
IF ::mrc_[ 3 ] >= ::nTop .AND. ::mrc_[ 3 ] <= ::nTop + ::nNumRows - 1 ;
|
||||
.AND. ;
|
||||
::mrc_[ 4 ] >= ::nLeft .AND. ::mrc_[ 4 ] <= ::nRight
|
||||
|
||||
IF ( nNewPos := ::nAtTop + ( ::mrc_[ 3 ] - ::nTop ) ) <> ::nPos
|
||||
IF ::alSelect[ nNewPos ]
|
||||
::DeHilite()
|
||||
::nPos := nNewPos
|
||||
::nNewPos := ::nPos
|
||||
::HiLite()
|
||||
ENDIF
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
RETURN ::nPos
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
STATIC FUNCTION Before( cDelim, cValue )
|
||||
LOCAL cRetVal := cValue
|
||||
|
||||
IF cDelim $ cValue
|
||||
cRetVal := left( cValue, at( cDelim, cValue ) - 1 )
|
||||
ENDIF
|
||||
|
||||
RETURN ( cRetVal )
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
STATIC FUNCTION After( cDelim, cValue )
|
||||
LOCAL cRetVal := ''
|
||||
|
||||
IF cDelim $ cValue
|
||||
cRetVal := substr( cValue, at( cDelim, cValue ) + 1 )
|
||||
ENDIF
|
||||
|
||||
RETURN ( cRetVal )
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
1410
harbour/contrib/hbcuied/cu_desgn.prg
Normal file
1410
harbour/contrib/hbcuied/cu_desgn.prg
Normal file
File diff suppressed because it is too large
Load Diff
521
harbour/contrib/hbcuied/cu_field.prg
Normal file
521
harbour/contrib/hbcuied/cu_field.prg
Normal file
@@ -0,0 +1,521 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* CUI Forms Editor
|
||||
*
|
||||
* Copyright 2011 Pritpal Bedi <bedipritpal@hotmail.com>
|
||||
* http://harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
/*----------------------------------------------------------------------*/
|
||||
/*----------------------------------------------------------------------*/
|
||||
/*----------------------------------------------------------------------*/
|
||||
/*
|
||||
* EkOnkar
|
||||
* ( The LORD is ONE )
|
||||
*
|
||||
* Harbour CUI Editor Source
|
||||
*
|
||||
* Pritpal Bedi
|
||||
* 13Aug2011
|
||||
*/
|
||||
/*----------------------------------------------------------------------*/
|
||||
/*----------------------------------------------------------------------*/
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
#include "hbcuied.ch"
|
||||
#include "common.ch"
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
#define FLD_UNIQUE 1 // N 4
|
||||
|
||||
#define FLD_ALIAS 2 // C 8
|
||||
#define FLD_HEADING 3 // C 15
|
||||
#define FLD_TYPE 4 // C 1
|
||||
#define FLD_LEN 5 // N 3
|
||||
#define FLD_DEC 6 // N 3
|
||||
#define FLD_ORD_NAT 7 // N 3
|
||||
#define FLD_FLD_NO 8 // N 3
|
||||
|
||||
#define FLD_INDEXED 9 // L 1
|
||||
#define FLD_INDEX_NO 10 // N 3
|
||||
|
||||
#define FLD_CONFIGURE 11 // L 1
|
||||
#define FLD_CALCULATED 12 // L 1
|
||||
#define FLD_TRIGGER 13 // L 1
|
||||
|
||||
#define FLD_ORD_GET 14 // N 3
|
||||
#define FLD_EDITABLE 15 // L 1
|
||||
#define FLD_DATA 16 // C 60
|
||||
#define FLD_WHEN 17 // C 100
|
||||
#define FLD_VALID 18 // C 100
|
||||
|
||||
#define FLD_ORD_BRW 19 // N 3
|
||||
#define FLD_BROWSE 20 // L 1
|
||||
#define FLD_BRW_INIT 21 // L 1
|
||||
#define FLD_BRW_VIS 22 // L 1
|
||||
|
||||
#define FLD_HELP 23 // C 8
|
||||
#define FLD_PG_TOTAL 24 // L 1
|
||||
|
||||
#define FLD_F_FLD 25 // N 3
|
||||
#define FLD_F_ALIAS 26 // C 8
|
||||
#define FLD_F_LOOK_FLD 27 // N 3
|
||||
#define FLD_F_RTN_FLD 28 // N 3
|
||||
|
||||
#define FLD_ENCRYPTED 29 // L 1
|
||||
#define FLD_ENK_BASE 30 // N 3
|
||||
#define FLD_ENK_ALOG 31 // N 3
|
||||
#define FLD_FLD_ATTR 32 // N 2
|
||||
// ---
|
||||
// 352
|
||||
#define FLD_INIT_VRBLS 32
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
#define FLD_LEN_UNIQUE 4
|
||||
|
||||
#define FLD_LEN_ALIAS 8
|
||||
#define FLD_LEN_HEADING 15
|
||||
#define FLD_LEN_TYPE 1
|
||||
#define FLD_LEN_LEN 3
|
||||
#define FLD_LEN_DEC 2
|
||||
#define FLD_LEN_ORD_NAT 3
|
||||
#define FLD_LEN_FLD_NO 3
|
||||
|
||||
#define FLD_LEN_INDEXED 1
|
||||
#define FLD_LEN_INDEX_NO 3
|
||||
|
||||
#define FLD_LEN_CONFIGURE 1
|
||||
#define FLD_LEN_CALCULATED 1
|
||||
#define FLD_LEN_TRIGGER 1
|
||||
|
||||
#define FLD_LEN_ORD_GET 3
|
||||
#define FLD_LEN_EDITABLE 1
|
||||
#define FLD_LEN_DATA 60
|
||||
#define FLD_LEN_WHEN 100
|
||||
#define FLD_LEN_VALID 100
|
||||
|
||||
#define FLD_LEN_ORD_BRW 3
|
||||
#define FLD_LEN_BROWSE 1
|
||||
#define FLD_LEN_BRW_INIT 1
|
||||
#define FLD_LEN_BRW_VIS 1
|
||||
|
||||
#define FLD_LEN_HELP 8
|
||||
#define FLD_LEN_PG_TOTAL 1
|
||||
|
||||
#define FLD_LEN_F_FLD 3
|
||||
#define FLD_LEN_F_ALIAS 8
|
||||
#define FLD_LEN_F_LOOK_FLD 3
|
||||
#define FLD_LEN_F_RTN_FLD 3
|
||||
|
||||
#define FLD_LEN_ENCRYPTED 1
|
||||
#define FLD_LEN_ENK_BASE 3
|
||||
#define FLD_LEN_ENK_ALOG 3
|
||||
|
||||
#define FLD_LEN_FLD_ATTR 2
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
#define FLD_OS_UNIQUE 1 // 4
|
||||
|
||||
#define FLD_OS_ALIAS 5 // 8
|
||||
#define FLD_OS_HEADING 13 // 15
|
||||
#define FLD_OS_TYPE 28 // 1
|
||||
#define FLD_OS_LEN 29 // 3
|
||||
#define FLD_OS_DEC 32 // 2
|
||||
#define FLD_OS_ORD_NAT 34 // 3
|
||||
#define FLD_OS_FLD_NO 37 // 3
|
||||
|
||||
#define FLD_OS_INDEXED 40 // 1
|
||||
#define FLD_OS_INDEX_NO 41 // 3
|
||||
|
||||
#define FLD_OS_CONFIGURE 44 // 1
|
||||
#define FLD_OS_CALCULATED 45 // 1
|
||||
#define FLD_OS_TRIGGER 46 // 1
|
||||
|
||||
#define FLD_OS_ORD_GET 47 // 3
|
||||
#define FLD_OS_EDITABLE 50 // 1
|
||||
#define FLD_OS_DATA 51 // 60
|
||||
#define FLD_OS_WHEN 111 //-----100
|
||||
#define FLD_OS_VALID 211 //-----100
|
||||
|
||||
#define FLD_OS_ORD_BRW 311 // 3
|
||||
#define FLD_OS_BROWSE 314 // 1
|
||||
#define FLD_OS_BRW_INIT 315 // 1
|
||||
#define FLD_OS_BRW_VIS 316 // 1
|
||||
|
||||
#define FLD_OS_HELP 317 // 8
|
||||
#define FLD_OS_PG_TOTAL 325 // 1
|
||||
|
||||
#define FLD_OS_F_FLD 326 // 3
|
||||
#define FLD_OS_F_ALIAS 329 // 8
|
||||
#define FLD_OS_F_LOOK_FLD 337 // 3
|
||||
#define FLD_OS_F_RTN_FLD 340 // 3
|
||||
|
||||
#define FLD_OS_ENCRYPTED 343 // 1
|
||||
#define FLD_OS_ENK_BASE 344 // 3
|
||||
#define FLD_OS_ENK_ALOG 347 // 3
|
||||
#define FLD_OS_FLD_ATTR 350 // 2
|
||||
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
#define PRM_TYPE 1 // C 1
|
||||
#define PRM_ALIAS 2 // C 8
|
||||
#define PRM_DESC 3 // C 35
|
||||
#define PRM_FILE_1 4 // C 8
|
||||
#define PRM_FILE_2 5 // C 8
|
||||
#define PRM_FILE_3 6 // C 8
|
||||
#define PRM_PK 7 // N 3
|
||||
#define PRM_DK 8 // N 3
|
||||
#define PRM_PROTO 9 // N 2
|
||||
#define PRM_PATH 10 // C 80
|
||||
#define PRM_DELETE 11 // C 80
|
||||
#define PRM_PREVALIDATE 12 // C 80
|
||||
#define PRM_INITIALIZE 13 // C 80
|
||||
#define PRM_ATTACHED 14 // L 1
|
||||
#define PRM_MODE 15 // C 1
|
||||
#define PRM_SHORT 16 // C 3
|
||||
|
||||
#define PRM_INIT_VRBLS 16
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
#define PRM_LEN_TYPE 1
|
||||
#define PRM_LEN_ALIAS 8 // C 8
|
||||
#define PRM_LEN_DESC 35 // C 35
|
||||
#define PRM_LEN_FILE_1 8 // C 8
|
||||
#define PRM_LEN_FILE_2 8 // C 8
|
||||
#define PRM_LEN_FILE_3 8 // C 8
|
||||
#define PRM_LEN_PK 3 // N 3
|
||||
#define PRM_LEN_DK 3 // N 3
|
||||
#define PRM_LEN_PROTO 2 // N 2
|
||||
#define PRM_LEN_PATH 80 // C 80
|
||||
#define PRM_LEN_DELETE 80 // C 80
|
||||
#define PRM_LEN_PREVALIDATE 80 // C 80
|
||||
#define PRM_LEN_INITIALIZE 80 // C 80
|
||||
#define PRM_LEN_ATTACHED 1 // L 1
|
||||
#define PRM_LEN_MODE 1 // C 1
|
||||
#define PRM_LEN_SHORT 3 // C 3
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
#define PRM_OS_TYPE 1 // C 1
|
||||
#define PRM_OS_ALIAS 2 // C 8
|
||||
#define PRM_OS_DESC 10 // C 35
|
||||
#define PRM_OS_FILE_1 45 // C 8
|
||||
#define PRM_OS_FILE_2 53 // C 8
|
||||
#define PRM_OS_FILE_3 61 // C 8
|
||||
#define PRM_OS_PK 69 // N 3
|
||||
#define PRM_OS_DK 72 // N 3
|
||||
#define PRM_OS_PROTO 75 // N 2
|
||||
#define PRM_OS_PATH 77 // C 80
|
||||
#define PRM_OS_DELETE 157 // C 80
|
||||
#define PRM_OS_PREVALIDATE 237 // C 80
|
||||
#define PRM_OS_INITIALIZE 317 // C 80
|
||||
#define PRM_OS_ATTACHED 397 // L 1
|
||||
#define PRM_OS_MODE 398 // C 1
|
||||
#define PRM_OS_SHORT 399 // C 3
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
#define FATR_CHR 1
|
||||
#define FATR_DTE 2
|
||||
#define FATR_NUM 3
|
||||
#define FATR_LOG 4
|
||||
#define FATR_PKS 5
|
||||
#define FATR_PKM 6
|
||||
#define FATR_DTF 7
|
||||
#define FATR_FRN 8
|
||||
#define FATR_INF 9
|
||||
#define FATR_SUM 10
|
||||
#define FATR_TRG 11
|
||||
#define FATR_REF 12
|
||||
#define FATR_OPN 13
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
FUNCTION scrMdlFld( obj_, scn_, nObj )
|
||||
LOCAL v_, n, sel_
|
||||
|
||||
sel_:= scrVvSelAble( scn_ )
|
||||
v_ := IF( nObj > 0, scrObj2Vv( obj_[ nObj ] ), scrVvBlank() )
|
||||
n := v_[ VV_FIELD ]
|
||||
IF nObj == 0
|
||||
v_[ VV_FIELD ] := 0
|
||||
v_[ VV_ID ] := space( 10 )
|
||||
v_[ VV_F_PIC ] := space( 15 )
|
||||
v_[ VV_COLOR ] := 'N/W '
|
||||
ENDIF
|
||||
|
||||
IF .T.
|
||||
v_[ VV_EQN ] := 'fieldget('+ ltrim( str( n ) ) + ')'
|
||||
|
||||
sel_[ VV_ALIGN ] := .f.
|
||||
sel_[ VV_PRN_LEN ] := .f.
|
||||
// sel_[ VV_ID ] := .f.
|
||||
sel_[ VV_PRN_LEN ] := .f.
|
||||
sel_[ VV_ALIGN ] := .f.
|
||||
sel_[ VV_COLOR ] := .f.
|
||||
sel_[ VV_POINT ] := .f.
|
||||
sel_[ VV_COL_JUST ] := .f.
|
||||
sel_[ VV_PATTERN ] := .f.
|
||||
sel_[ VV_F_TYPE ] := .T.
|
||||
|
||||
scrField( nObj, 1, obj_, scn_, v_, sel_, OBJ_CLR_FIELD )
|
||||
IF nObj > 0
|
||||
scrOrdObj( obj_ )
|
||||
ENDIF
|
||||
ENDIF
|
||||
RETURN NIL
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
STATIC FUNCTION scrFldUnique(obj_)
|
||||
LOCAL nUnq := 2001
|
||||
DO WHILE .t.
|
||||
IF ascan(obj_,{|e_| e_[OBJ_OBJ_UNIQUE] == nUnq }) == 0
|
||||
EXIT
|
||||
ENDIF
|
||||
nUnq++
|
||||
ENDDO
|
||||
RETURN nUnq
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
#IF 0
|
||||
STATIC FUNCTION prpObj2Fld( obj_ ) // Akin TO Blank
|
||||
|
||||
LOCAL v_:= array( FLD_INIT_VRBLS )
|
||||
LOCAL idx_:={ .f.,.f.,.f.,.f.,.t.,.t.,.t.,.t.,.f.,.f.,.f.,.f.,.f. }
|
||||
LOCAL nAttr := obj_[ OBJ_MDL_F_TYPE ]
|
||||
|
||||
v_[FLD_UNIQUE ] := obj_[OBJ_OBJ_UNIQUE]
|
||||
v_[FLD_ALIAS ] := space(8)
|
||||
v_[FLD_HEADING ] := obj_[OBJ_ID]
|
||||
v_[FLD_TYPE ] := obj_[OBJ_F_TYPE]
|
||||
v_[FLD_LEN ] := obj_[OBJ_F_LEN]
|
||||
v_[FLD_DEC ] := obj_[OBJ_F_DEC]
|
||||
v_[FLD_ORD_NAT ] := 0
|
||||
v_[FLD_FLD_NO ] := 0
|
||||
v_[FLD_INDEXED ] := idx_[nAttr]
|
||||
v_[FLD_INDEX_NO ] := 0
|
||||
v_[FLD_CONFIGURE ] := VouchInArray(nAttr,{FATR_NUM,FATR_LOG,FATR_CHR,;
|
||||
FATR_DTE,FATR_REF,FATR_TRG,FATR_INF})
|
||||
v_[FLD_CALCULATED ] := VouchInArray(nAttr,{FATR_NUM,FATR_LOG,FATR_CHR,;
|
||||
FATR_DTE,FATR_INF})
|
||||
v_[FLD_TRIGGER ] := nAttr == FATR_TRG .OR. nAttr == FATR_REF
|
||||
v_[FLD_ORD_GET ] := 0
|
||||
v_[FLD_EDITABLE ] := !VouchInArray(nAttr,{FATR_PKS,FATR_PKM})
|
||||
v_[FLD_DATA ] := space(FLD_LEN_DATA)
|
||||
v_[FLD_WHEN ] := space(FLD_LEN_WHEN)
|
||||
v_[FLD_VALID ] := space(FLD_LEN_VALID)
|
||||
v_[FLD_ORD_BRW ] := 0
|
||||
v_[FLD_BROWSE ] := nAttr <> FATR_TRG .OR. nAttr <> FATR_REF
|
||||
v_[FLD_BRW_INIT ] := nAttr <> FATR_TRG .OR. nAttr <> FATR_REF
|
||||
v_[FLD_BRW_VIS ] := nAttr <> FATR_TRG .OR. nAttr <> FATR_REF
|
||||
v_[FLD_HELP ] := space(8)
|
||||
v_[FLD_PG_TOTAL ] := obj_[OBJ_F_TYPE]=='N'
|
||||
v_[FLD_F_FLD ] := 0
|
||||
v_[FLD_F_ALIAS ] := space(8)
|
||||
v_[FLD_F_LOOK_FLD ] := 0
|
||||
v_[FLD_F_RTN_FLD ] := 0
|
||||
v_[FLD_ENCRYPTED ] := .t.
|
||||
v_[FLD_ENK_BASE ] := b_rand(254)
|
||||
v_[FLD_ENK_ALOG ] := b_rand(19)
|
||||
v_[FLD_FLD_ATTR ] := nAttr
|
||||
RETURN v_
|
||||
#ENDIF
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
FUNCTION prpFld2Str(v_)
|
||||
LOCAL s := ;
|
||||
str(v_[FLD_UNIQUE ], FLD_LEN_UNIQUE )+ ;
|
||||
pad(v_[FLD_ALIAS ], FLD_LEN_ALIAS )+ ;
|
||||
pad(v_[FLD_HEADING ], FLD_LEN_HEADING )+ ;
|
||||
pad(v_[FLD_TYPE ], FLD_LEN_TYPE )+ ;
|
||||
str(v_[FLD_LEN ], FLD_LEN_LEN )+ ;
|
||||
str(v_[FLD_DEC ], FLD_LEN_DEC )+ ;
|
||||
str(v_[FLD_ORD_NAT ], FLD_LEN_ORD_NAT )+ ;
|
||||
str(v_[FLD_FLD_NO ], FLD_LEN_FLD_NO )+ ;
|
||||
IF(v_[FLD_INDEXED ], 'T', 'F' )+ ;
|
||||
str(v_[FLD_INDEX_NO ], FLD_LEN_INDEX_NO )+ ;
|
||||
IF(v_[FLD_CONFIGURE ], 'T', 'F' )+ ;
|
||||
IF(v_[FLD_CALCULATED ], 'T', 'F' )+ ;
|
||||
IF(v_[FLD_TRIGGER ], 'T', 'F' )+ ;
|
||||
str(v_[FLD_ORD_GET ], FLD_LEN_ORD_GET )+ ;
|
||||
IF(v_[FLD_EDITABLE ], 'T', 'F' )+ ;
|
||||
pad(v_[FLD_DATA ], FLD_LEN_DATA )+ ;
|
||||
pad(v_[FLD_WHEN ], FLD_LEN_WHEN )+ ;
|
||||
pad(v_[FLD_VALID ], FLD_LEN_VALID )+ ;
|
||||
str(v_[FLD_ORD_BRW ], FLD_LEN_ORD_BRW )+ ;
|
||||
IF(v_[FLD_BROWSE ], 'T', 'F' )+ ;
|
||||
IF(v_[FLD_BRW_INIT ], 'T', 'F' )+ ;
|
||||
IF(v_[FLD_BRW_VIS ], 'T', 'F' )+ ;
|
||||
pad(v_[FLD_HELP ], FLD_LEN_HELP )+ ;
|
||||
IF(v_[FLD_PG_TOTAL ], 'T', 'F' )+ ;
|
||||
str(v_[FLD_F_FLD ], FLD_LEN_F_FLD )+ ;
|
||||
pad(v_[FLD_F_ALIAS ], FLD_LEN_F_ALIAS )+ ;
|
||||
str(v_[FLD_F_LOOK_FLD ], FLD_LEN_F_LOOK_FLD )+ ;
|
||||
str(v_[FLD_F_RTN_FLD ], FLD_LEN_F_RTN_FLD )+ ;
|
||||
IF(v_[FLD_ENCRYPTED ], 'T', 'F' )+ ;
|
||||
str(v_[FLD_ENK_BASE ], FLD_LEN_ENK_BASE )+ ;
|
||||
str(v_[FLD_ENK_ALOG ], FLD_LEN_ENK_ALOG )+ ;
|
||||
str(v_[FLD_FLD_ATTR ], FLD_LEN_FLD_ATTR )
|
||||
RETURN s
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
FUNCTION prpStr2Fld(s)
|
||||
LOCAL v_:= array(FLD_INIT_VRBLS)
|
||||
|
||||
v_[FLD_UNIQUE ] := val(substr(s, FLD_OS_UNIQUE , FLD_LEN_UNIQUE ))
|
||||
v_[FLD_ALIAS ] := substr(s, FLD_OS_ALIAS , FLD_LEN_ALIAS )
|
||||
v_[FLD_HEADING ] := substr(s, FLD_OS_HEADING , FLD_LEN_HEADING )
|
||||
v_[FLD_TYPE ] := substr(s, FLD_OS_TYPE , FLD_LEN_TYPE )
|
||||
v_[FLD_LEN ] := val(substr(s, FLD_OS_LEN , FLD_LEN_LEN ))
|
||||
v_[FLD_DEC ] := val(substr(s, FLD_OS_DEC , FLD_LEN_DEC ))
|
||||
v_[FLD_ORD_NAT ] := val(substr(s, FLD_OS_ORD_NAT , FLD_LEN_ORD_NAT ))
|
||||
v_[FLD_FLD_NO ] := val(substr(s, FLD_OS_FLD_NO , FLD_LEN_FLD_NO ))
|
||||
v_[FLD_INDEXED ] := substr(s, FLD_OS_INDEXED , FLD_LEN_INDEXED )=='T'
|
||||
v_[FLD_INDEX_NO ] := val(substr(s, FLD_OS_INDEX_NO , FLD_LEN_INDEX_NO ))
|
||||
v_[FLD_CONFIGURE ] := substr(s, FLD_OS_CONFIGURE , FLD_LEN_CONFIGURE )=='T'
|
||||
v_[FLD_CALCULATED ] := substr(s, FLD_OS_CALCULATED , FLD_LEN_CALCULATED)=='T'
|
||||
v_[FLD_TRIGGER ] := substr(s, FLD_OS_TRIGGER , FLD_LEN_TRIGGER )=='T'
|
||||
v_[FLD_ORD_GET ] := val(substr(s, FLD_OS_ORD_GET , FLD_LEN_ORD_GET ))
|
||||
v_[FLD_EDITABLE ] := substr(s, FLD_OS_EDITABLE , FLD_LEN_EDITABLE )=='T'
|
||||
v_[FLD_DATA ] := substr(s, FLD_OS_DATA , FLD_LEN_DATA )
|
||||
v_[FLD_WHEN ] := substr(s, FLD_OS_WHEN , FLD_LEN_WHEN )
|
||||
v_[FLD_VALID ] := substr(s, FLD_OS_VALID , FLD_LEN_VALID )
|
||||
v_[FLD_ORD_BRW ] := val(substr(s, FLD_OS_ORD_BRW , FLD_LEN_ORD_BRW ))
|
||||
v_[FLD_BROWSE ] := substr(s, FLD_OS_BROWSE , FLD_LEN_BROWSE )=='T'
|
||||
v_[FLD_BRW_INIT ] := substr(s, FLD_OS_BRW_INIT , FLD_LEN_BRW_INIT )=='T'
|
||||
v_[FLD_BRW_VIS ] := substr(s, FLD_OS_BRW_VIS , FLD_LEN_BRW_VIS )=='T'
|
||||
v_[FLD_HELP ] := substr(s, FLD_OS_HELP , FLD_LEN_HELP )
|
||||
v_[FLD_PG_TOTAL ] := substr(s, FLD_OS_PG_TOTAL , FLD_LEN_PG_TOTAL )=='T'
|
||||
v_[FLD_F_FLD ] := val(substr(s, FLD_OS_F_FLD , FLD_LEN_F_FLD ))
|
||||
v_[FLD_F_ALIAS ] := substr(s, FLD_OS_F_ALIAS , FLD_LEN_F_ALIAS )
|
||||
v_[FLD_F_LOOK_FLD ] := val(substr(s, FLD_OS_F_LOOK_FLD , FLD_LEN_F_LOOK_FLD))
|
||||
v_[FLD_F_RTN_FLD ] := val(substr(s, FLD_OS_F_RTN_FLD , FLD_LEN_F_RTN_FLD ))
|
||||
v_[FLD_ENCRYPTED ] := substr(s, FLD_OS_ENCRYPTED , FLD_LEN_ENCRYPTED )=='T'
|
||||
v_[FLD_ENK_BASE ] := val(substr(s, FLD_OS_ENK_BASE , FLD_LEN_ENK_BASE ))
|
||||
v_[FLD_ENK_ALOG ] := val(substr(s, FLD_OS_ENK_ALOG , FLD_LEN_ENK_ALOG ))
|
||||
v_[FLD_FLD_ATTR ] := val(substr(s, FLD_OS_FLD_ATTR , FLD_LEN_FLD_ATTR ))
|
||||
|
||||
RETURN v_
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
FUNCTION prpMdlBlank()
|
||||
LOCAL v_:= array(PRM_INIT_VRBLS)
|
||||
|
||||
v_[PRM_TYPE ] := 'S'
|
||||
v_[PRM_ALIAS ] := 'Z7_NEW '
|
||||
v_[PRM_DESC ] := 'The NEXT Module '
|
||||
v_[PRM_FILE_1 ] := 'Z7A00001'
|
||||
v_[PRM_FILE_2 ] := 'Z7B00002'
|
||||
v_[PRM_FILE_3 ] := 'Z7_NEW '
|
||||
v_[PRM_PK ] := 1
|
||||
v_[PRM_DK ] := 2
|
||||
v_[PRM_PROTO ] := 0
|
||||
v_[PRM_PATH ] := space(PRM_LEN_PATH)
|
||||
v_[PRM_DELETE ] := space(PRM_LEN_DELETE)
|
||||
v_[PRM_PREVALIDATE] := space(PRM_LEN_PREVALIDATE)
|
||||
v_[PRM_INITIALIZE ] := space(PRM_LEN_INITIALIZE)
|
||||
v_[PRM_ATTACHED ] := .f.
|
||||
v_[PRM_MODE ] := 'V'
|
||||
v_[PRM_SHORT ] := 'XXX'
|
||||
|
||||
RETURN v_
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
FUNCTION prpMdl2Str(v_)
|
||||
LOCAL s := ;
|
||||
pad(v_[PRM_TYPE ], PRM_LEN_TYPE ) +;
|
||||
pad(v_[PRM_ALIAS ], PRM_LEN_ALIAS ) +;
|
||||
pad(v_[PRM_DESC ], PRM_LEN_DESC ) +;
|
||||
pad(v_[PRM_FILE_1 ], PRM_LEN_FILE_1 ) +;
|
||||
pad(v_[PRM_FILE_2 ], PRM_LEN_FILE_2 ) +;
|
||||
pad(v_[PRM_FILE_3 ], PRM_LEN_FILE_3 ) +;
|
||||
str(v_[PRM_PK ], PRM_LEN_PK ) +;
|
||||
str(v_[PRM_DK ], PRM_LEN_DK ) +;
|
||||
str(v_[PRM_PROTO ], PRM_LEN_PROTO ) +;
|
||||
pad(v_[PRM_PATH ], PRM_LEN_PATH ) +;
|
||||
pad(v_[PRM_DELETE ], PRM_LEN_DELETE ) +;
|
||||
pad(v_[PRM_PREVALIDATE], PRM_LEN_PREVALIDATE) +;
|
||||
pad(v_[PRM_INITIALIZE ], PRM_LEN_INITIALIZE ) +;
|
||||
IF(v_[PRM_ATTACHED ],'T','F') +;
|
||||
pad(v_[PRM_MODE ], PRM_LEN_MODE ) +;
|
||||
pad(v_[PRM_SHORT ], PRM_LEN_SHORT )
|
||||
RETURN s
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
FUNCTION prpStr2Mdl(s)
|
||||
LOCAL v_:= array(PRM_INIT_VRBLS)
|
||||
|
||||
v_[PRM_TYPE ] := substr(s, PRM_OS_TYPE , PRM_LEN_TYPE )
|
||||
v_[PRM_ALIAS ] := substr(s, PRM_OS_ALIAS , PRM_LEN_ALIAS )
|
||||
v_[PRM_DESC ] := substr(s, PRM_OS_DESC , PRM_LEN_DESC )
|
||||
v_[PRM_FILE_1 ] := substr(s, PRM_OS_FILE_1 , PRM_LEN_FILE_1 )
|
||||
v_[PRM_FILE_2 ] := substr(s, PRM_OS_FILE_2 , PRM_LEN_FILE_2 )
|
||||
v_[PRM_FILE_3 ] := substr(s, PRM_OS_FILE_3 , PRM_LEN_FILE_3 )
|
||||
v_[PRM_PK ] := val(substr(s, PRM_OS_PK , PRM_LEN_PK ))
|
||||
v_[PRM_DK ] := val(substr(s, PRM_OS_DK , PRM_LEN_DK ))
|
||||
v_[PRM_PROTO ] := val(substr(s, PRM_OS_PROTO , PRM_LEN_PROTO ))
|
||||
v_[PRM_PATH ] := substr(s, PRM_OS_PATH , PRM_LEN_PATH )
|
||||
v_[PRM_DELETE ] := substr(s, PRM_OS_DELETE , PRM_LEN_DELETE )
|
||||
v_[PRM_PREVALIDATE] := substr(s, PRM_OS_PREVALIDATE, PRM_LEN_PREVALIDATE)
|
||||
v_[PRM_INITIALIZE ] := substr(s, PRM_OS_INITIALIZE , PRM_LEN_INITIALIZE )
|
||||
v_[PRM_ATTACHED ] := substr(s, PRM_OS_ATTACHED , PRM_LEN_ATTACHED ) == 'T'
|
||||
v_[PRM_MODE ] := substr(s, PRM_OS_MODE , PRM_LEN_MODE )
|
||||
v_[PRM_SHORT ] := substr(s, PRM_OS_SHORT , PRM_LEN_SHORT )
|
||||
|
||||
RETURN v_
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
104
harbour/contrib/hbcuied/cu_main.prg
Normal file
104
harbour/contrib/hbcuied/cu_main.prg
Normal file
@@ -0,0 +1,104 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* CUI Forms Editor
|
||||
*
|
||||
* Copyright 2011 Pritpal Bedi <bedipritpal@hotmail.com>
|
||||
* http://harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
/*----------------------------------------------------------------------*/
|
||||
/*----------------------------------------------------------------------*/
|
||||
/*----------------------------------------------------------------------*/
|
||||
/*
|
||||
* EkOnkar
|
||||
* ( The LORD is ONE )
|
||||
*
|
||||
* Harbour CUI Editor Source
|
||||
*
|
||||
* Pritpal Bedi
|
||||
* 13Aug2011
|
||||
*/
|
||||
/*----------------------------------------------------------------------*/
|
||||
/*----------------------------------------------------------------------*/
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
#include "hbgtinfo.ch"
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
FUNCTION Main( cSource, cScreen )
|
||||
|
||||
SET SCOREBOARD OFF
|
||||
SET EPOCH TO 1950
|
||||
|
||||
Wvt_SetGui( .f. )
|
||||
Wvt_SetFont( "Courier New", 18, 0, 0 )
|
||||
Wvt_SetMouseMove( .t. )
|
||||
|
||||
SetColor( "N/W" )
|
||||
CLS
|
||||
? "Press ESC TO EXIT ... "
|
||||
|
||||
hb_gtInfo( HB_GTI_WINTITLE, "Harbour CUI Forms Designer v1.0" )
|
||||
|
||||
hb_threadStart( {|| thd_dgn_Screen( cSource, cScreen ) } )
|
||||
|
||||
DO WHILE inkey() != 27
|
||||
|
||||
ENDDO
|
||||
|
||||
RETURN cSource
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
FUNCTION HB_GTSYS()
|
||||
|
||||
REQUEST HB_GT_WVG_DEFAULT
|
||||
|
||||
RETURN NIL
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
237
harbour/contrib/hbcuied/cu_menu.prg
Normal file
237
harbour/contrib/hbcuied/cu_menu.prg
Normal file
@@ -0,0 +1,237 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* CUI Forms Editor
|
||||
*
|
||||
* Copyright 2011 Pritpal Bedi <bedipritpal@hotmail.com>
|
||||
* http://harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
/*----------------------------------------------------------------------*/
|
||||
/*----------------------------------------------------------------------*/
|
||||
/*----------------------------------------------------------------------*/
|
||||
/*
|
||||
* EkOnkar
|
||||
* ( The LORD is ONE )
|
||||
*
|
||||
* Harbour CUI Editor Source
|
||||
*
|
||||
* Pritpal Bedi
|
||||
* 13Aug2011
|
||||
*/
|
||||
/*----------------------------------------------------------------------*/
|
||||
/*----------------------------------------------------------------------*/
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
#include "hbcuied.ch"
|
||||
#include "common.ch"
|
||||
#include "hbgtinfo.ch"
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
#define REP_MSG_WAIT_YES .T.
|
||||
#define REP_MSG_WAIT_NO .F.
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
FUNCTION thd_dgn_Screen( cSource )
|
||||
LOCAL rpt_, oCrt
|
||||
|
||||
DEFAULT cSource TO "Untitled"
|
||||
|
||||
SetMTModule( .t. )
|
||||
|
||||
oCrt := WvgCrt():New( , , { -1,-1 }, { 24,79 }, , .f. )
|
||||
oCrt:resizeMode := HB_GTI_RESIZEMODE_ROWS
|
||||
oCrt:icon := "..\..\package\harb_win.ico"
|
||||
oCrt:create()
|
||||
oCrt:closable := .f.
|
||||
oCrt:showWindow()
|
||||
|
||||
hb_gtInfo( HB_GTI_WINTITLE, 'Harbour Screen Designer - ' + cSource )
|
||||
SetColor( 'N/W' )
|
||||
CLS
|
||||
SetOCrt( oCrt )
|
||||
|
||||
rpt_:= dgn_Screen( cSource, REP_FOR_MDL )
|
||||
|
||||
oCrt:destroy()
|
||||
|
||||
RETURN rpt_
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
STATIC FUNCTION dgn_Screen( cObject, nMode )
|
||||
LOCAL rpt_:={}
|
||||
LOCAL bErr
|
||||
|
||||
bErr := errorBlock( {|| Break() } )
|
||||
|
||||
IF ! empty( rpt_:= rptDefine( cObject, rpt_, nMode,/*struct_*/, /*cRpt*/, 1, REP_MSG_WAIT_YES ) )
|
||||
rptSave( cObject, /*cRpt*/, rpt_, 1, nMode, REP_MSG_WAIT_YES )
|
||||
ENDIF
|
||||
|
||||
errorBlock( bErr )
|
||||
|
||||
RETURN rpt_
|
||||
|
||||
//---------------------------------------------------------------------//
|
||||
|
||||
STATIC FUNCTION rptDefine( cObject,rpt_,nMode,struct_,cRpt,nWhere,lMsg )
|
||||
LOCAL scn_,a_,obj_
|
||||
|
||||
a_ := rpt2ObjScn( cObject,rpt_,nMode,struct_,cRpt,nWhere,lMsg )
|
||||
obj_:= a_[ 1 ]
|
||||
scn_:= a_[ 2 ]
|
||||
|
||||
a_ := Operate(obj_,scn_) // Common TO All Modes
|
||||
|
||||
obj_:= a_[ 1 ]
|
||||
scn_:= a_[ 2 ]
|
||||
rpt_:= objScn2rpt( obj_,scn_,nMode )
|
||||
|
||||
RETURN rpt_
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
FUNCTION rptSave( /* cObject,cRpt,rRpt_,nWhere,nMode,lMsgWait */ )
|
||||
RETURN .t.
|
||||
|
||||
//---------------------------------------------------------------------//
|
||||
|
||||
STATIC FUNCTION rptInit()
|
||||
RETURN { { '',0,'' } }
|
||||
|
||||
//---------------------------------------------------------------------//
|
||||
|
||||
STATIC FUNCTION s2sct(s)
|
||||
LOCAL sct_:= array( SCT_INIT_VRBLS )
|
||||
|
||||
sct_[SCT_ORDER] := val(substr(s,SCT_OS_ORDER,SCT_LEN_ORDER))
|
||||
sct_[SCT_ID ] := substr(s,SCT_OS_ID ,SCT_LEN_ID )
|
||||
sct_[SCT_SAY ] := substr(s,SCT_OS_SAY ,SCT_LEN_SAY )
|
||||
sct_[SCT_ROWS ] := val(substr(s,SCT_OS_ROWS ,SCT_LEN_ROWS ))
|
||||
sct_[SCT_COLOR] := substr(s,SCT_OS_COLOR,SCT_LEN_COLOR)
|
||||
sct_[SCT_EQN ] := substr(s,SCT_OS_EQN ,SCT_LEN_EQN )
|
||||
sct_[SCT_EJECT] := substr(s,SCT_OS_EJECT,SCT_LEN_EJECT) == 'T'
|
||||
sct_[SCT_RESET] := substr(s,SCT_OS_RESET,SCT_LEN_RESET) == 'T'
|
||||
|
||||
RETURN sct_
|
||||
|
||||
//---------------------------------------------------------------------//
|
||||
|
||||
STATIC FUNCTION sct2s(sct_)
|
||||
LOCAL s := ;
|
||||
str(sct_[SCT_ORDER],SCT_LEN_ORDER) + ;
|
||||
pad(sct_[SCT_ID ],SCT_LEN_ID ) + ;
|
||||
pad(sct_[SCT_SAY ],SCT_LEN_SAY ) + ;
|
||||
str(sct_[SCT_ROWS ],SCT_LEN_ROWS ) + ;
|
||||
pad(sct_[SCT_COLOR],SCT_LEN_COLOR) + ;
|
||||
pad(sct_[SCT_EQN ],SCT_LEN_EQN ) + ;
|
||||
IF(sct_[SCT_EJECT],'T','F' ) + ;
|
||||
IF(sct_[SCT_RESET],'T','F' )
|
||||
RETURN s
|
||||
|
||||
//---------------------------------------------------------------------//
|
||||
|
||||
FUNCTION rpt2ObjScn( cObject,rpt_,nMode,struct_,cRpt,nWhere,lMsg )
|
||||
LOCAL obj_,scn_:={}
|
||||
LOCAL i, n
|
||||
|
||||
HB_SYMBOL_UNUSED( struct_ )
|
||||
|
||||
rpt_:= IF(rpt_ == NIL .OR. empty(rpt_), rptInit(), rpt_)
|
||||
obj_:= scrScn2obj(rpt_,0)
|
||||
|
||||
DO CASE
|
||||
|
||||
CASE nMode == REP_FOR_MDL
|
||||
scn_:= scrConfig(obj_,DGN_MODULE)
|
||||
IF (n := ascan(rpt_,{|e_| e_[2]==1 })) > 0
|
||||
scn_[SCN_PROPERTY] := eval(COMPILE(rpt_[n,3]))
|
||||
ENDIF
|
||||
IF (n := ascan(rpt_,{|e_| e_[2]== 51 })) > 0 // Property
|
||||
scn_[SCN_PROPERTY] := prpStr2Mdl(rpt_[n,3])
|
||||
ENDIF
|
||||
FOR i := 1 TO len(rpt_) // Fields
|
||||
IF inRange(rpt_[i,2],2001,3000)
|
||||
aadd(scn_[SCN_FIELDS], prpStr2Fld(rpt_[i,3]))
|
||||
ENDIF
|
||||
NEXT
|
||||
|
||||
ENDCASE
|
||||
|
||||
scn_[SCN_FILE ] := iif( empty( rpt_[ 1,1 ] ), 'Untitled', substr( rpt_[ 1,1 ], 13 ) )
|
||||
|
||||
scn_[SCN_COBJECT ] := cObject // FOR threaded usage
|
||||
scn_[SCN_CRPT ] := cRpt
|
||||
scn_[SCN_NWHERE ] := nWhere
|
||||
scn_[SCN_NMODE ] := nMode
|
||||
scn_[SCN_LMSG ] := lMsg
|
||||
|
||||
RETURN {obj_,scn_}
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
FUNCTION objScn2Rpt(obj_,scn_,nMode)
|
||||
LOCAL rpt_:={}, i //, s
|
||||
|
||||
DO CASE
|
||||
CASE nMode == REP_FOR_MDL
|
||||
aeval(obj_,{|e_| IF(e_[OBJ_ROW]==0,'',aadd(rpt_,{'',0,scrObj2str(e_)} )) })
|
||||
IF !empty(scn_[SCN_PROPERTY])
|
||||
aadd(rpt_, {'',51,prpMdl2Str(scn_[SCN_PROPERTY]) })
|
||||
ENDIF
|
||||
IF !empty(scn_[SCN_FIELDS])
|
||||
FOR i := 1 TO len(scn_[SCN_FIELDS])
|
||||
aadd(rpt_,{'',scn_[SCN_FIELDS,i,1], prpFld2Str(scn_[SCN_FIELDS,i]) })
|
||||
NEXT
|
||||
ENDIF
|
||||
ENDCASE
|
||||
|
||||
RETURN rpt_
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
520
harbour/contrib/hbcuied/cu_outpt.prg
Normal file
520
harbour/contrib/hbcuied/cu_outpt.prg
Normal file
@@ -0,0 +1,520 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* CUI Forms Editor
|
||||
*
|
||||
* Copyright 2011 Pritpal Bedi <bedipritpal@hotmail.com>
|
||||
* http://harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
/*----------------------------------------------------------------------*/
|
||||
/*----------------------------------------------------------------------*/
|
||||
/*----------------------------------------------------------------------*/
|
||||
/*
|
||||
* EkOnkar
|
||||
* ( The LORD is ONE )
|
||||
*
|
||||
* Harbour CUI Editor Source
|
||||
*
|
||||
* Pritpal Bedi
|
||||
* 13Aug2011
|
||||
*/
|
||||
/*----------------------------------------------------------------------*/
|
||||
/*----------------------------------------------------------------------*/
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
#include "hbcuied.ch"
|
||||
#include "inkey.ch"
|
||||
#include "wvtwin.ch"
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
#define K_WVT_FULLSCREEN 299701
|
||||
|
||||
#define K_WVT_BITMAP 299705
|
||||
#define K_WVT_FRAME 299706
|
||||
#define K_WVT_ELLIPSE 299707
|
||||
#define K_WVT_LINE_H 299708
|
||||
#define K_WVT_LINE_V 299709
|
||||
#define K_WVT_GRID 299710
|
||||
#define K_WVT_BARCODE 299711
|
||||
#define K_WVT_TEXTBOX 299712
|
||||
|
||||
#define K_WVT_CARRY 299721
|
||||
#define K_WVT_BROUGHT 299722
|
||||
#define K_WVT_SUMMARY 299723
|
||||
#define K_WVT_GROUP 299724
|
||||
#define K_WVT_MATRIX 299725
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
FUNCTION ScrDisplay( scn_ )
|
||||
|
||||
dispbegin()
|
||||
setcursor(0)
|
||||
setColor( scn_[ SCN_CLR_OVERALL ] )
|
||||
cls
|
||||
|
||||
@ scn_[SCN_ROW_RULER], scn_[SCN_LEFT] ;
|
||||
SAY substr( scn_[SCN_RULER], 1, scn_[SCN_RIGHT] - scn_[SCN_LEFT] + 1 ) ;
|
||||
COLOR scn_[ SCN_CLR_RULER ]
|
||||
|
||||
scrMsg()
|
||||
|
||||
setcolor( scn_[ SCN_CLR_WINDOW ] )
|
||||
setCursor(2)
|
||||
dispend()
|
||||
|
||||
RETURN NIL
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
FUNCTION scrStatus(obj_,scn_)
|
||||
LOCAL s,objId,nSct,cClr:='GR+/BG'
|
||||
LOCAL typ_
|
||||
|
||||
dispbegin()
|
||||
s := pad(scn_[SCN_DESIGN_ID],8)+' ³ '
|
||||
|
||||
s += pad(scn_[SCN_FILE],12)+;
|
||||
' ³ '+;
|
||||
' Row:'+;
|
||||
str( scn_[SCN_ROW_REP]-1, 3 )+;
|
||||
' Col:'+;
|
||||
str( scn_[SCN_COL_REP]-1, 3 )+;
|
||||
' ³ ' +;
|
||||
IF(readInsert(),'Ins ',' ')+;
|
||||
' ³ '
|
||||
|
||||
objId := ''
|
||||
IF scn_[SCN_OBJ_HILITE] > 0
|
||||
objId := scn_[SCN_OBJ_ID_,obj_[scn_[SCN_OBJ_HILITE],OBJ_TYPE]]
|
||||
IF obj_[scn_[SCN_OBJ_HILITE],OBJ_TYPE] == OBJ_O_BOX
|
||||
typ_:= {'Bitmap','Frame','Ellipse','Line (H)','Line (V)','Grid','BarCode','Text Box'}
|
||||
objId := typ_[obj_[scn_[SCN_OBJ_HILITE],OBJ_MDL_F_TYPE]-60]
|
||||
ENDIF
|
||||
ELSEIF scn_[SCN_OBJ_SELECTED] > 0
|
||||
objId := scn_[SCN_OBJ_ID_,obj_[scn_[SCN_OBJ_SELECTED],OBJ_TYPE]]
|
||||
IF obj_[scn_[SCN_OBJ_SELECTED],OBJ_TYPE] == OBJ_O_BOX
|
||||
typ_:= {'Bitmap','Frame','Ellipse','Line (H)','Line (V)','Grid','BarCode','Text Box'}
|
||||
objId := typ_[obj_[scn_[SCN_OBJ_SELECTED],OBJ_MDL_F_TYPE]-60]
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
s += pad(trim(objId),10)+' ³ '
|
||||
|
||||
IF ( nSct := scrSecOrd(scn_,scn_[SCN_ROW_REP])) <> NIL
|
||||
s += scn_[ SCN_SECTORS_,nSct,SCT_ID ]
|
||||
#ifdef __WVT__
|
||||
cClr := scn_[ SCN_SECTORS_,nSct,SCT_COLOR ]
|
||||
#ENDIF
|
||||
ENDIF
|
||||
|
||||
@ scn_[SCN_STATUS_ROW], scn_[SCN_STATUS_COL] ;
|
||||
say pad(s,scn_[SCN_STATUS_COL_TO]-scn_[SCN_STATUS_COL]+1) ;
|
||||
color scn_[SCN_CLR_STATUS]
|
||||
|
||||
/* Ruler */
|
||||
s := substr(scn_[SCN_RULER],;
|
||||
max( 1,scn_[SCN_COL_REP]-scn_[SCN_COL_CUR]+scn_[SCN_LEFT]),;
|
||||
scn_[ SCN_RIGHT]-scn_[SCN_LEFT]+1 )
|
||||
DispBox( scn_[SCN_TOP]-1,0,scn_[SCN_TOP]-1,maxcol(),' ',scn_[SCN_CLR_OVERALL] )
|
||||
@ scn_[SCN_ROW_RULER],scn_[SCN_LEFT] SAY s COLOR scn_[SCN_CLR_RULER]
|
||||
@ scn_[SCN_ROW_RULER],scn_[SCN_COL_CUR] say ;
|
||||
substr( s, scn_[SCN_COL_CUR]-scn_[SCN_LEFT]+1,1) COLOR cClr
|
||||
|
||||
@ scn_[SCN_ROW_CUR],scn_[SCN_COL_CUR] SAY ''
|
||||
|
||||
// Now update current cursor position
|
||||
scn_[SCN_ROW_PREV] := scn_[SCN_ROW_CUR]
|
||||
scn_[SCN_COL_PREV] := scn_[SCN_COL_CUR]
|
||||
|
||||
dispend()
|
||||
RETURN NIL
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
FUNCTION scrHiLite(obj_,scn_,mode)
|
||||
LOCAL nObj := scn_[SCN_OBJ_HILITE]
|
||||
LOCAL cColor := IF(mode,scn_[SCN_CLR_HILITE],obj_[nObj,OBJ_COLOR])
|
||||
|
||||
IF obj_[nObj,OBJ_TYPE] == OBJ_O_BOX
|
||||
DispBegin()
|
||||
dispBox( obj_[nObj,OBJ_ROW] + scn_[SCN_ROW_DIS],;
|
||||
obj_[nObj,OBJ_COL] + scn_[SCN_COL_DIS],;
|
||||
obj_[nObj,OBJ_TO_ROW] + scn_[SCN_ROW_DIS],;
|
||||
obj_[nObj,OBJ_TO_COL] + scn_[SCN_COL_DIS],;
|
||||
obj_[nObj,OBJ_BOX_SHAPE],;
|
||||
'gr+/b' /* cColor */)
|
||||
DispEnd()
|
||||
ELSEIF obj_[nObj,OBJ_TYPE] == OBJ_O_FIELD .OR. ;
|
||||
obj_[nObj,OBJ_TYPE] == OBJ_O_EXP
|
||||
DispBegin()
|
||||
@ obj_[nObj,OBJ_ROW]+scn_[SCN_ROW_DIS], ;
|
||||
obj_[nObj,OBJ_COL]+scn_[SCN_COL_DIS] ;
|
||||
say obj_[nObj,OBJ_TEXT] color cColor
|
||||
DispEnd()
|
||||
ENDIF
|
||||
RETURN NIL
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
FUNCTION scrDispSelctd(obj_,scn_)
|
||||
LOCAL i,j,nCol,nRow
|
||||
|
||||
IF !empty(scn_[SCN_TEXT_BLOCK_])
|
||||
DispBegin()
|
||||
|
||||
FOR i := scn_[SCN_TEXT_BLOCK_,1] TO scn_[SCN_TEXT_BLOCK_,3]
|
||||
IF (nRow := i+scn_[SCN_ROW_DIS]) <= scn_[SCN_BOTTOM]
|
||||
FOR j := scn_[SCN_TEXT_BLOCK_,2] TO scn_[SCN_TEXT_BLOCK_,4]
|
||||
IF (nCol := j+scn_[SCN_COL_DIS]) <= scn_[SCN_RIGHT]
|
||||
@ nRow,nCol SAY scrGetChar(obj_,i,j) COLOR 'GR+/R'
|
||||
ENDIF
|
||||
NEXT
|
||||
ENDIF
|
||||
NEXT
|
||||
|
||||
DispEnd()
|
||||
ENDIF
|
||||
RETURN NIL
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
FUNCTION scrDispGhost(obj_,scn_,gst_)
|
||||
LOCAL i,j,nRow,nCol
|
||||
|
||||
HB_SYMBOL_UNUSED( obj_ )
|
||||
|
||||
DispBegin()
|
||||
FOR i := gst_[1] TO gst_[3]
|
||||
IF (nRow := i+scn_[SCN_ROW_DIS]) <= scn_[SCN_BOTTOM]
|
||||
FOR j := gst_[2] TO gst_[4]
|
||||
IF (nCol := j+scn_[SCN_COL_DIS]) <= scn_[SCN_RIGHT]
|
||||
@ nRow,nCol SAY THE_FILL COLOR 'GR+/R'
|
||||
ENDIF
|
||||
NEXT
|
||||
ENDIF
|
||||
NEXT
|
||||
DispEnd()
|
||||
|
||||
RETURN NIL
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
FUNCTION scrMove(obj_,scn_)
|
||||
LOCAL i,scrT,scrB,scrL,scrR,k,n,nRepOff,nRowWnd,nTo
|
||||
LOCAL crs := setCursor( 0 )
|
||||
LOCAL nOff, cText, nRow, nCol, cColor
|
||||
|
||||
dispBegin()
|
||||
|
||||
IF scn_[SCN_DESIGN] == DGN_MODULE .OR. scn_[SCN_DESIGN]==DGN_SCREEN
|
||||
scrT := VouchWndSave(0,0,scn_[SCN_TOP]-1,maxcol())
|
||||
scrB := VouchWndSave(scn_[SCN_BOTTOM]+1,0,maxrow(),maxcol())
|
||||
scrL := VouchWndSave(0,0,maxrow(),scn_[SCN_LEFT]-1)
|
||||
scrR := VouchWndSave(0,scn_[SCN_RIGHT]+1,maxrow(),maxcol())
|
||||
ELSE
|
||||
scrT := VouchWndSave(0,0,scn_[SCN_TOP]-2,maxcol())
|
||||
scrB := VouchWndSave(maxrow()-2,0,maxrow(),maxcol())
|
||||
DispBox( scn_[SCN_TOP],0,maxrow()-2,maxcol(),' ',scn_[SCN_CLR_OVERALL] )
|
||||
|
||||
nRowWnd := scn_[SCN_BOTTOM ] - scn_[SCN_TOP] + 1
|
||||
nRepOff := scn_[SCN_ROW_REP] - (scn_[SCN_ROW_CUR] - scn_[SCN_TOP])
|
||||
nTo := (nRowWnd + nRepOff - 1)
|
||||
|
||||
k := 0
|
||||
FOR i := nRepOff TO nTo
|
||||
IF ( n := scrSecOrd( scn_,i ) ) <> NIL
|
||||
@ scn_[ SCN_TOP ]+k, 0 SAY scn_[ SCN_SECTORS_, n, SCT_SAY ] ;
|
||||
COLOR scn_[ SCN_SECTORS_,n,SCT_COLOR ]
|
||||
k++
|
||||
ENDIF
|
||||
NEXT
|
||||
|
||||
scrL := VouchWndSave(0,0,maxrow(),scn_[SCN_LEFT]-1)
|
||||
scrR := VouchWndSave(0,scn_[SCN_RIGHT]+1,maxrow()-2,maxcol())
|
||||
ENDIF
|
||||
|
||||
dispBox(scn_[ SCN_TOP ],;
|
||||
scn_[ SCN_LEFT ],;
|
||||
scn_[ SCN_BOTTOM ],;
|
||||
scn_[ SCN_RIGHT ],;
|
||||
scn_[ SCN_DRAW_FILL ],;
|
||||
scn_[ SCN_CLR_PREV ] )
|
||||
|
||||
FOR i := 1 TO len( obj_ )
|
||||
IF obj_[ i,OBJ_ROW ] + scn_[ SCN_ROW_DIS ] <= scn_[ SCN_BOTTOM ] .AND. ;
|
||||
obj_[ i,OBJ_COL ] + scn_[ SCN_COL_DIS ] <= scn_[ SCN_RIGHT ]
|
||||
|
||||
nOff := obj_[ i,OBJ_COL ] + scn_[ SCN_COL_DIS ]
|
||||
nRow := obj_[ i,OBJ_ROW ] + scn_[ SCN_ROW_DIS ]
|
||||
nCol := obj_[ i,OBJ_COL ] + scn_[ SCN_COL_DIS ]
|
||||
|
||||
IF nOff < 0
|
||||
nCol := 0
|
||||
ENDIF
|
||||
|
||||
IF obj_[i,OBJ_TYPE] == OBJ_O_BOX
|
||||
DO CASE
|
||||
CASE VouchInArray(obj_[ i,OBJ_MDL_F_TYPE ], { 61,62,63,67,68 } )
|
||||
dispBox( obj_[ i,OBJ_ROW ] + scn_[ SCN_ROW_DIS ],;
|
||||
obj_[ i,OBJ_COL ] + scn_[ SCN_COL_DIS ],;
|
||||
obj_[ i,OBJ_TO_ROW ] + scn_[ SCN_ROW_DIS ],;
|
||||
obj_[ i,OBJ_TO_COL ] + scn_[ SCN_COL_DIS ],;
|
||||
substr( obj_[ i,OBJ_BOX_SHAPE ], 1, 8 ),;
|
||||
IF( scn_[ SCN_OBJ_HILITE ] == i, scn_[ SCN_CLR_HILITE ],;
|
||||
'w/b' /* obj_[i,OBJ_COLOR] */))
|
||||
CASE VouchInArray(obj_[i,OBJ_MDL_F_TYPE], {64,65} ) // Line
|
||||
@ obj_[i,OBJ_ROW] + scn_[SCN_ROW_DIS],;
|
||||
obj_[i,OBJ_COL] + scn_[SCN_COL_DIS] ;
|
||||
TO obj_[i,OBJ_TO_ROW] + scn_[SCN_ROW_DIS],;
|
||||
obj_[i,OBJ_TO_COL] + scn_[SCN_COL_DIS] ;
|
||||
COLOR IF(scn_[SCN_OBJ_HILITE]==i,scn_[SCN_CLR_HILITE],;
|
||||
'w/b' /* obj_[i,OBJ_COLOR] */)
|
||||
ENDCASE
|
||||
ENDIF
|
||||
|
||||
IF obj_[i,OBJ_TYPE] == OBJ_O_FIELD .OR. obj_[i,OBJ_TYPE] == OBJ_O_EXP
|
||||
cText := obj_[ i,OBJ_TEXT ]
|
||||
cColor := IF( scn_[ SCN_OBJ_SELECTED ] == i,scn_[ SCN_CLR_SELECT ],;
|
||||
IF( scn_[ SCN_OBJ_HILITE ] == i,scn_[ SCN_CLR_HILITE ],;
|
||||
'W+/W' /* obj_[i,OBJ_COLOR] */ ))
|
||||
IF nOff < 0
|
||||
cText := substr( obj_[ i,OBJ_TEXT ], abs( nOff ) + 1 )
|
||||
ENDIF
|
||||
@ nRow, nCol SAY cText COLOR cColor
|
||||
ENDIF
|
||||
|
||||
IF obj_[i,OBJ_TYPE] == OBJ_O_TEXT
|
||||
cText := obj_[ i,OBJ_EQN ]
|
||||
cColor := IF( scn_[SCN_OBJ_SELECTED]==i,scn_[SCN_CLR_SELECT],;
|
||||
IF( empty(obj_[i,OBJ_COLOR]),scn_[SCN_CLR_TEXT],;
|
||||
'W/B' /* obj_[i,OBJ_COLOR] */))
|
||||
IF nOff < 0
|
||||
cText := substr( obj_[ i,OBJ_EQN ], abs( nOff ) + 1 )
|
||||
ENDIF
|
||||
|
||||
@ nRow, nCol SAY cText COLOR cColor
|
||||
ENDIF
|
||||
ELSEIF ( obj_[ i,OBJ_ROW ] + scn_[ SCN_ROW_DIS ] > scn_[ SCN_BOTTOM ] )
|
||||
|
||||
ENDIF
|
||||
NEXT
|
||||
|
||||
ScrDispSelctd( obj_,scn_ ) // Display Selected Screen
|
||||
|
||||
IF scn_[ SCN_TOP ] > 0
|
||||
VouchWndRest(scrT)
|
||||
ENDIF
|
||||
IF scn_[ SCN_LEFT ] > 0
|
||||
VouchWndRest(scrL)
|
||||
ENDIF
|
||||
IF scn_[ SCN_BOTTOM ] < maxrow()
|
||||
VouchWndRest(scrB)
|
||||
ENDIF
|
||||
IF scn_[ SCN_RIGHT ] < maxcol()
|
||||
VouchWndRest(scrR)
|
||||
ENDIF
|
||||
|
||||
dispEnd()
|
||||
setcursor( crs )
|
||||
RETURN NIL
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
FUNCTION scrMoveLine(obj_,scn_)
|
||||
LOCAL scrL,scrR,i,crs, nRow, nCol, cText, nOff, cColor
|
||||
|
||||
crs := setCursor( 0 )
|
||||
|
||||
IF scn_[ SCN_ROW_PREV ] == scn_[ SCN_ROW_CUR ]
|
||||
dispbegin()
|
||||
dispBox(scn_[SCN_ROW_CUR ],;
|
||||
scn_[SCN_LEFT ],;
|
||||
scn_[SCN_ROW_CUR ],;
|
||||
scn_[SCN_RIGHT ],;
|
||||
scn_[SCN_DRAW_FILL],;
|
||||
scn_[SCN_CLR_PREV ] )
|
||||
|
||||
scrL := VouchWndSave(scn_[SCN_ROW_CUR],0,scn_[SCN_ROW_CUR],scn_[SCN_LEFT]-1)
|
||||
IF scn_[SCN_RIGHT] < maxcol()
|
||||
scrR := VouchWndSave( scn_[SCN_ROW_CUR],scn_[SCN_RIGHT]+1,scn_[SCN_ROW_CUR],maxcol() )
|
||||
ENDIF
|
||||
|
||||
FOR i := 1 TO len(obj_)
|
||||
nOff := obj_[i,OBJ_COL]+scn_[SCN_COL_DIS]
|
||||
nRow := obj_[i,OBJ_ROW]+scn_[SCN_ROW_DIS]
|
||||
nCol := nOff
|
||||
#ifdef __WVT__
|
||||
nCol := IF( nOff < 0, 0, nOff )
|
||||
#ENDIF
|
||||
|
||||
IF obj_[i,OBJ_TYPE] == OBJ_O_BOX
|
||||
DO CASE
|
||||
CASE VouchInArray(obj_[i,OBJ_MDL_F_TYPE],{64,65}) // Lines V.H
|
||||
@ obj_[i,OBJ_ROW] + scn_[SCN_ROW_DIS],;
|
||||
obj_[i,OBJ_COL] + scn_[SCN_COL_DIS] ;
|
||||
TO obj_[i,OBJ_TO_ROW] + scn_[SCN_ROW_DIS],;
|
||||
obj_[i,OBJ_TO_COL] + scn_[SCN_COL_DIS] ;
|
||||
COLOR IF(scn_[SCN_OBJ_HILITE]==i,scn_[SCN_CLR_HILITE],;
|
||||
'w/b' /* obj_[i,OBJ_COLOR] */)
|
||||
ENDCASE
|
||||
ENDIF
|
||||
|
||||
IF obj_[ i,OBJ_ROW ] == scn_[ SCN_ROW_REP ]
|
||||
IF obj_[i,OBJ_TYPE] == OBJ_O_FIELD .OR. obj_[i,OBJ_TYPE] == OBJ_O_EXP
|
||||
cText := obj_[i,OBJ_TEXT]
|
||||
cColor := IF(scn_[SCN_OBJ_SELECTED]==i,scn_[SCN_CLR_SELECT],;
|
||||
IF(scn_[SCN_OBJ_HILITE ]==i,scn_[SCN_CLR_HILITE],;
|
||||
'W+/W' /* obj_[i,OBJ_COLOR] */ ))
|
||||
#ifdef __WVT__
|
||||
IF nOff < 0
|
||||
cText := substr( cText, abs( nOff )+1 )
|
||||
ENDIF
|
||||
#ENDIF
|
||||
@ nRow, nCol SAY cText COLOR cColor
|
||||
ENDIF
|
||||
|
||||
IF obj_[i,OBJ_TYPE] == OBJ_O_TEXT
|
||||
cText := obj_[i,OBJ_EQN]
|
||||
cColor := IF(scn_[SCN_OBJ_SELECTED]==i,scn_[SCN_CLR_SELECT],;
|
||||
IF(empty(obj_[i,OBJ_COLOR]),scn_[SCN_CLR_TEXT],;
|
||||
'W/B' /* obj_[i,OBJ_COLOR] */))
|
||||
#ifdef __WVT__
|
||||
cText := IF( nOff < 0, substr( cText, abs( nOff )+1 ), cText )
|
||||
#ENDIF
|
||||
@ nRow, nCol SAY cText COLOR cColor
|
||||
ENDIF
|
||||
ENDIF
|
||||
NEXT
|
||||
|
||||
scrDispSelctd(obj_,scn_) // Display Selected Screen
|
||||
|
||||
VouchWndRest(scrL)
|
||||
IF scn_[SCN_RIGHT] < maxcol()
|
||||
VouchWndRest(scrR)
|
||||
ENDIF
|
||||
|
||||
dispEnd()
|
||||
ELSE
|
||||
scrMove(obj_,scn_)
|
||||
ENDIF
|
||||
setCursor(crs)
|
||||
RETURN NIL
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
FUNCTION scrMouse( obj_, scn_, nEvent )
|
||||
LOCAL nmRow, nmCol
|
||||
LOCAL aEvents_:= { K_LBUTTONUP, K_LBUTTONDOWN, K_MMLEFTDOWN }
|
||||
|
||||
STATIC nLastCol := 0
|
||||
STATIC nLastRow := 0
|
||||
STATIC lAnchored := .f.
|
||||
STATIC nCursor
|
||||
|
||||
IF !( VouchInArray( nEvent, aEvents_ ) )
|
||||
RETURN .f.
|
||||
ENDIF
|
||||
|
||||
nmRow := mRow()
|
||||
nmCol := mCol()
|
||||
|
||||
IF nmRow < scn_[ SCN_TOP ] .OR. nmRow > scn_[ SCN_BOTTOM ] .OR. ;
|
||||
nmCol < scn_[ SCN_LEFT ] .OR. nmCol > scn_[ SCN_RIGHT ]
|
||||
RETURN .f.
|
||||
ENDIF
|
||||
|
||||
scrToMouse( scn_, nmRow, nmCol )
|
||||
|
||||
IF nEvent == K_LDBLCLK
|
||||
|
||||
ELSEIF nEvent == K_MMLEFTDOWN /*K_LBUTTONDOWN */ .AND. !( lAnchored )
|
||||
IF scrChkObj( obj_,scn_ ) > 0 .AND. scn_[ SCN_MODE ] <> OBJ_MODE_SELECT
|
||||
nCursor := SetCursor( 0 )
|
||||
|
||||
lAnchored := .t.
|
||||
scn_[ SCN_LASTKEY ] := K_F6
|
||||
Wvt_SetPointer( WVT_IDC_SIZEALL )
|
||||
Wvt_SetMousePos( scn_[ SCN_ROW_CUR ],scn_[ SCN_COL_CUR ] )
|
||||
ENDIF
|
||||
|
||||
ELSEIF nEvent == K_MMLEFTDOWN .AND. lAnchored
|
||||
|
||||
ELSEIF nEvent == K_LBUTTONUP .AND. lAnchored
|
||||
Wvt_SetPointer( WVT_IDC_ARROW )
|
||||
Wvt_SetMousePos( scn_[ SCN_ROW_CUR ],scn_[ SCN_COL_CUR ] )
|
||||
SetCursor( nCursor )
|
||||
lAnchored := .f.
|
||||
__keyboard( chr( K_ENTER ) )
|
||||
|
||||
ELSEIF nEvent == K_LBUTTONUP
|
||||
|
||||
ENDIF
|
||||
|
||||
RETURN .t.
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
FUNCTION scrToMouse( scn_, nmRow, nmCol )
|
||||
LOCAL nRowOff, nColOff
|
||||
|
||||
nRowOff := nmRow - scn_[SCN_ROW_CUR]
|
||||
IF nRowOff <> 0
|
||||
scn_[ SCN_ROW_CUR ] += nRowOff
|
||||
scn_[ SCN_ROW_REP ] += nRowOff
|
||||
ENDIF
|
||||
|
||||
nColOff := nmCol - scn_[ SCN_COL_CUR ]
|
||||
IF nColOff <> 0
|
||||
scn_[ SCN_COL_CUR ] += nColOff
|
||||
scn_[ SCN_COL_REP ] += nColOff
|
||||
ENDIF
|
||||
|
||||
RETURN NIL
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
194
harbour/contrib/hbcuied/cu_prpty.prg
Normal file
194
harbour/contrib/hbcuied/cu_prpty.prg
Normal file
@@ -0,0 +1,194 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* CUI Forms Editor
|
||||
*
|
||||
* Copyright 2011 Pritpal Bedi <bedipritpal@hotmail.com>
|
||||
* http://harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
/*----------------------------------------------------------------------*/
|
||||
/*----------------------------------------------------------------------*/
|
||||
/*----------------------------------------------------------------------*/
|
||||
/*
|
||||
* EkOnkar
|
||||
* ( The LORD is ONE )
|
||||
*
|
||||
* Harbour CUI Editor Source
|
||||
*
|
||||
* Pritpal Bedi
|
||||
* 13Aug2011
|
||||
*/
|
||||
/*----------------------------------------------------------------------*/
|
||||
/*----------------------------------------------------------------------*/
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
#include "hbcuied.ch"
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
FUNCTION scrProperty( obj_,scn_ )
|
||||
LOCAL prp_
|
||||
|
||||
HB_SYMBOL_UNUSED( obj_ )
|
||||
|
||||
DO CASE
|
||||
CASE scn_[ SCN_DESIGN ] == DGN_MODULE
|
||||
prp_:= iif( empty( scn_[SCN_PROPERTY ] ), prpMdlBlank(), scn_[ SCN_PROPERTY ] )
|
||||
//prp_:= prpModule( prp_ ) /* Fetch actual values */
|
||||
scn_[SCN_PROPERTY] := prp_
|
||||
|
||||
ENDCASE
|
||||
|
||||
RETURN NIL
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
#IF 0
|
||||
FUNCTION prpRStr2Ar(s,s1,s2)
|
||||
LOCAL prp_:= array(REP_INIT_VRBLS)
|
||||
|
||||
IF empty(s) // IF no property is defined, defaults
|
||||
RETURN prpRepBlank()
|
||||
ENDIF
|
||||
|
||||
prp_[ REP_DESC ] := substr( s , REP_OS_DESC , REP_LEN_DESC )
|
||||
prp_[ REP_TYPE ] := val( substr( s , REP_OS_TYPE , REP_LEN_TYPE ) )
|
||||
prp_[ REP_IDX_NO ] := val( substr( s , REP_OS_IDX_NO , REP_LEN_IDX_NO ) )
|
||||
prp_[ REP_IDX_EXP ] := substr( s , REP_OS_IDX_EXP , REP_LEN_IDX_EXP )
|
||||
prp_[ REP_PG_SIZE ] := substr( s , REP_OS_PG_SIZE , REP_LEN_PG_SIZE )
|
||||
prp_[ REP_PG_LEN ] := val( substr( s , REP_OS_PG_LEN , REP_LEN_PG_LEN ) )
|
||||
prp_[ REP_PG_WID ] := val( substr( s , REP_OS_PG_WID , REP_LEN_PG_WID ) )
|
||||
prp_[ REP_LINES ] := val( substr( s , REP_OS_LINES , REP_LEN_LINES ) )
|
||||
prp_[ REP_MG_TOP ] := val( substr( s , REP_OS_MG_TOP , REP_LEN_MG_TOP ) )
|
||||
prp_[ REP_MG_LEFT ] := val( substr( s , REP_OS_MG_LEFT , REP_LEN_MG_LEFT ) )
|
||||
prp_[ REP_MG_BOTTOM ] := val( substr( s , REP_OS_MG_BOTTOM , REP_LEN_MG_BOTTOM ) )
|
||||
prp_[ REP_EJ_BEFORE ] := substr( s , REP_OS_EJ_BEFORE , REP_LEN_EJ_BEFORE ) == 'T'
|
||||
prp_[ REP_EJ_AFTER ] := substr( s , REP_OS_EJ_AFTER , REP_LEN_EJ_AFTER ) == 'T'
|
||||
prp_[ REP_PLAIN ] := val( substr( s , REP_OS_PLAIN , REP_LEN_PLAIN ) )
|
||||
prp_[ REP_FTR_PAG ] := substr( s , REP_OS_FTR_PAG , REP_LEN_FTR_PAG )
|
||||
prp_[ REP_SMR_NEXT ] := substr( s , REP_OS_SMR_NEXT , REP_LEN_SMR_NEXT ) == 'T'
|
||||
prp_[ REP_HDR_PAGES ] := substr( s , REP_OS_HDR_PAGES , REP_LEN_HDR_PAGES )
|
||||
prp_[ REP_BNK_LINES ] := val( substr( s , REP_OS_BNK_LINES , REP_LEN_BNK_LINES ) )
|
||||
prp_[ REP_BNK_AFTER ] := val( substr( s , REP_OS_BNK_AFTER , REP_LEN_BNK_AFTER ) )
|
||||
prp_[ REP_DATA_BOX ] := substr( s , REP_OS_DATA_BOX , REP_LEN_DATA_BOX ) == 'T'
|
||||
prp_[ REP_FILE ] := substr( s , REP_OS_FILE , REP_LEN_FILE )
|
||||
prp_[ REP_COPIES ] := val( substr( s , REP_OS_COPIES , REP_LEN_COPIES ) )
|
||||
prp_[ REP_TTL_PAGES ] := substr( s , REP_OS_TTL_PAGES , REP_LEN_TTL_PAGES )
|
||||
prp_[ REP_INIT_CPI ] := val( substr( s , REP_OS_INIT_CPI , REP_LEN_INIT_CPI ) )
|
||||
prp_[ REP_PRN_QLY ] := substr( s , REP_OS_PRN_QLY , REP_LEN_PRN_QLY )
|
||||
prp_[ REP_RECONFIRM ] := substr( s , REP_OS_RECONFIRM , REP_LEN_RECONFIRM ) == 'T'
|
||||
prp_[ REP_FTR_BOTTOM ] := substr( s , REP_OS_FTR_BOTTOM, REP_LEN_FTR_BOTTOM ) == 'T'
|
||||
prp_[ REP_HTML ] := substr( s , REP_OS_HTML , REP_LEN_HTML ) == 'T'
|
||||
prp_[ REP_PRINTER ] := substr( s , REP_OS_PRINTER , REP_LEN_PRINTER )
|
||||
prp_[ REP_ORIENT ] := substr( s , REP_OS_ORIENT , REP_LEN_ORIENT )
|
||||
prp_[ REP_PREVIEW ] := substr( s , REP_OS_PREVIEW , REP_LEN_PREVIEW ) == 'T'
|
||||
prp_[ REP_GRAY ] := substr( s , REP_OS_GRAY , REP_LEN_GRAY ) == 'T'
|
||||
prp_[ REP_WINDLG ] := substr( s , REP_OS_WINDLG , REP_LEN_WINDLG ) == 'T'
|
||||
prp_[ REP_DUPLEX ] := val( substr( s , REP_OS_DUPLEX , REP_LEN_DUPLEX ) )
|
||||
prp_[ REP_COLS ] := val( substr( s , REP_OS_COLS , REP_LEN_COLS ) )
|
||||
prp_[ REP_ROWS ] := val( substr( s , REP_OS_ROWS , REP_LEN_ROWS ) )
|
||||
|
||||
prp_[ REP_FOR ] := substr( s1, REP_OS_FOR , REP_LEN_FOR )
|
||||
prp_[ REP_WHILE ] := substr( s1, REP_OS_WHILE , REP_LEN_WHILE )
|
||||
prp_[ REP_FIRST ] := substr( s1, REP_OS_FIRST , REP_LEN_FIRST )
|
||||
prp_[ REP_EXE_PRE ] := substr( s2, REP_OS_EXE_PRE , REP_LEN_EXE_PRE )
|
||||
prp_[ REP_EXE_POST ] := substr( s2, REP_OS_EXE_POST , REP_LEN_EXE_POST )
|
||||
|
||||
prp_[ REP_ORIENT ] := iif( empty( prp_[ REP_ORIENT ] ), 'P', prp_[ REP_ORIENT ] )
|
||||
|
||||
RETURN prp_
|
||||
#ENDIF
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
FUNCTION prpRAr2Str(prp_,s,s1,s2) // Passed by reference
|
||||
|
||||
s := pad( prp_[ REP_DESC ] , REP_LEN_DESC ) +;
|
||||
pad( NTRIM( prp_[ REP_TYPE ] ), REP_LEN_TYPE ) +;
|
||||
pad( NTRIM( prp_[ REP_IDX_NO ] ), REP_LEN_IDX_NO ) +;
|
||||
pad( prp_[ REP_IDX_EXP ] , REP_LEN_IDX_EXP ) +;
|
||||
pad( prp_[ REP_PG_SIZE ] , REP_LEN_PG_SIZE ) +;
|
||||
pad( NTRIM( prp_[ REP_PG_LEN ] ), REP_LEN_PG_LEN ) +;
|
||||
pad( NTRIM( prp_[ REP_PG_WID ] ), REP_LEN_PG_WID ) +;
|
||||
pad( NTRIM( prp_[ REP_LINES ] ), REP_LEN_LINES ) +;
|
||||
pad( NTRIM( prp_[ REP_MG_TOP ] ), REP_LEN_MG_TOP ) +;
|
||||
pad( NTRIM( prp_[ REP_MG_LEFT ] ), REP_LEN_MG_LEFT ) +;
|
||||
pad( NTRIM( prp_[ REP_MG_BOTTOM ] ), REP_LEN_MG_BOTTOM ) +;
|
||||
iif( prp_[ REP_EJ_BEFORE ] , 'T','F' ) +;
|
||||
iif( prp_[ REP_EJ_AFTER ] , 'T','F' ) +;
|
||||
pad( NTRIM( prp_[ REP_PLAIN ] ), REP_LEN_PLAIN ) +;
|
||||
pad( prp_[ REP_FTR_PAG ] , REP_LEN_FTR_PAG ) +;
|
||||
iif( prp_[ REP_SMR_NEXT ] , 'T','F' ) +;
|
||||
pad( prp_[ REP_HDR_PAGES ] , REP_LEN_HDR_PAGES ) +;
|
||||
pad( NTRIM( prp_[ REP_BNK_LINES ] ), REP_LEN_BNK_LINES ) +;
|
||||
pad( NTRIM( prp_[ REP_BNK_AFTER ] ), REP_LEN_BNK_AFTER ) +;
|
||||
iif( prp_[ REP_DATA_BOX ] ,'T','F' ) +;
|
||||
pad( prp_[ REP_FILE ] , REP_LEN_FILE ) +;
|
||||
pad( NTRIM( prp_[ REP_COPIES ] ), REP_LEN_COPIES ) +;
|
||||
pad( prp_[ REP_TTL_PAGES ] , REP_LEN_TTL_PAGES ) +;
|
||||
pad( NTRIM( prp_[ REP_INIT_CPI ] ), REP_LEN_INIT_CPI ) +;
|
||||
pad( prp_[ REP_PRN_QLY ] , REP_LEN_PRN_QLY ) +;
|
||||
iif( prp_[ REP_RECONFIRM ] , 'T','F' ) +;
|
||||
iif( prp_[ REP_FTR_BOTTOM ] , 'T','F' ) +;
|
||||
iif( prp_[ REP_HTML ] , 'T','F' ) +;
|
||||
pad( prp_[ REP_PRINTER ] , REP_LEN_PRINTER ) +;
|
||||
pad( prp_[ REP_ORIENT ] , REP_LEN_ORIENT ) +;
|
||||
iif( prp_[ REP_PREVIEW ] , 'T','F' ) +;
|
||||
iif( prp_[ REP_GRAY ] , 'T','F' ) +;
|
||||
iif( prp_[ REP_WINDLG ] , 'T','F' ) +;
|
||||
pad( NTRIM( prp_[ REP_DUPLEX ] ), REP_LEN_DUPLEX ) +;
|
||||
pad( NTRIM( prp_[ REP_COLS ] ), REP_LEN_COLS ) +;
|
||||
pad( NTRIM( prp_[ REP_ROWS ] ), REP_LEN_ROWS )
|
||||
|
||||
s1 := pad( prp_[ REP_FOR ] , REP_LEN_FOR ) +;
|
||||
pad( prp_[ REP_WHILE ] , REP_LEN_WHILE ) +;
|
||||
pad( prp_[ REP_FIRST ] , REP_LEN_FIRST )
|
||||
|
||||
s2 := pad( prp_[ REP_EXE_PRE ] , REP_LEN_EXE_PRE ) +;
|
||||
pad( prp_[ REP_EXE_POST ] , REP_LEN_EXE_POST )
|
||||
|
||||
RETURN NIL
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
2140
harbour/contrib/hbcuied/cu_utlty.prg
Normal file
2140
harbour/contrib/hbcuied/cu_utlty.prg
Normal file
File diff suppressed because it is too large
Load Diff
610
harbour/contrib/hbcuied/hbcuied.ch
Normal file
610
harbour/contrib/hbcuied/hbcuied.ch
Normal file
@@ -0,0 +1,610 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* CUI Forms Editor
|
||||
*
|
||||
* Copyright 2011 Pritpal Bedi <bedipritpal@hotmail.com>
|
||||
* http://harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
/*----------------------------------------------------------------------*/
|
||||
/*----------------------------------------------------------------------*/
|
||||
/*----------------------------------------------------------------------*/
|
||||
/*
|
||||
* EkOnkar
|
||||
* ( The LORD is ONE )
|
||||
*
|
||||
* Harbour CUI Editor Source
|
||||
*
|
||||
* Pritpal Bedi
|
||||
* 13Aug2011
|
||||
*/
|
||||
/*----------------------------------------------------------------------*/
|
||||
/*----------------------------------------------------------------------*/
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
#ifndef __HBEDCUI_CH
|
||||
#define __HBEDCUI_CH
|
||||
|
||||
#define THE_FILL 'ø'
|
||||
#define CLR_GET 'W+/W'
|
||||
#define CLR_BOX 'W+/B'
|
||||
#define OBJ_CLR_FIELD 'W+/W'
|
||||
|
||||
|
||||
#define OBJ_TYPE 1 // N 1
|
||||
#define OBJ_ROW 2 // N 3
|
||||
#define OBJ_COL 3 // N 3
|
||||
#define OBJ_TEXT 4 // C 15
|
||||
#define OBJ_BOX_SHAPE 4 // C --
|
||||
#define OBJ_COLOR 5 // C 7
|
||||
#define OBJ_TO_ROW 6 // N 3
|
||||
#define OBJ_TO_COL 7 // N 3
|
||||
#define OBJ_ID 8 // C 15
|
||||
#define OBJ_SECTION 9 // N 4
|
||||
#define OBJ_ALIAS 10 // C 8
|
||||
#define OBJ_FIELD 11 // N 3
|
||||
#define OBJ_EQN 12 // C 240
|
||||
#define OBJ_F_TYPE 13 // C 1
|
||||
#define OBJ_F_LEN 14 // N 3
|
||||
#define OBJ_F_DEC 15 // N 2
|
||||
#define OBJ_F_PIC 16 // C 20
|
||||
#define OBJ_ALIGN 17 // C 1
|
||||
#define OBJ_PITCH 18 // N 2
|
||||
#define OBJ_FONT 19 // C 8
|
||||
#define OBJ_BOLD 20 // L 1
|
||||
#define OBJ_ITALIC 21 // L 1
|
||||
#define OBJ_UNDERLN 22 // L 1
|
||||
#define OBJ_S_SCRPT 23 // L 1
|
||||
#define OBJ_U_SCRPT 24 // L 1
|
||||
#define OBJ_HALF_H 25 // L 1
|
||||
#define OBJ_PRN_LEN 26 // N 3
|
||||
#define OBJ_ZERO 27 // L 1
|
||||
#define OBJ_REPEATED 28 // C 6
|
||||
#define OBJ_VERTICLE 29 // L 1
|
||||
#define OBJ_WRAP_SEMI 30 // L 1
|
||||
#define OBJ_FOR 31 // C 80
|
||||
#define OBJ_SEC_ROW 32 // N 3
|
||||
#define OBJ_ATTRB 33 // C 8
|
||||
#define OBJ_VAL 34 // C 1
|
||||
#define OBJ_OBJ_UNIQUE 35 // N 4
|
||||
#define OBJ_MDL_F_TYPE 36 // N 2
|
||||
#define OBJ_POINT 37 // N 2
|
||||
#define OBJ_COL_JUST 38 // N 2
|
||||
#define OBJ_PATTERN 39 // C 10
|
||||
#define OBJ_BORDER 40 // N 5 2
|
||||
|
||||
#define OBJ_INIT_VRBLS 40
|
||||
|
||||
// Run time addresses
|
||||
#define OBJ_PRINT 4
|
||||
#define OBJ_SECTOR 9
|
||||
#define OBJ_UNIQUE 32
|
||||
#define CAL_UNIQUE 1
|
||||
#define CAL_SECTOR 2
|
||||
#define CAL_OBJ 3
|
||||
#define CAL_ATTRB 4
|
||||
#define CAL_NONE 5
|
||||
#define CAL_COUNT 6
|
||||
#define CAL_SUM 7
|
||||
#define CAL_AVERAGE 8
|
||||
#define CAL_HIGHEST 9
|
||||
#define CAL_LOWEST 10
|
||||
|
||||
#define OBJ_LEN_TYPE 1
|
||||
#define OBJ_LEN_ROW 3
|
||||
#define OBJ_LEN_COL 3
|
||||
#define OBJ_LEN_TEXT 15
|
||||
#define OBJ_LEN_COLOR 7
|
||||
#define OBJ_LEN_TO_ROW 3
|
||||
#define OBJ_LEN_TO_COL 3
|
||||
#define OBJ_LEN_ID 15
|
||||
#define OBJ_LEN_SECTION 4
|
||||
#define OBJ_LEN_ALIAS 8
|
||||
#define OBJ_LEN_FIELD 3
|
||||
#define OBJ_LEN_EQN 240
|
||||
#define OBJ_LEN_F_TYPE 1
|
||||
#define OBJ_LEN_F_LEN 3
|
||||
#define OBJ_LEN_F_DEC 2
|
||||
#define OBJ_LEN_F_PIC 20
|
||||
#define OBJ_LEN_ALIGN 1
|
||||
#define OBJ_LEN_PITCH 2
|
||||
#define OBJ_LEN_FONT 8
|
||||
#define OBJ_LEN_BOLD 1
|
||||
#define OBJ_LEN_ITALIC 1
|
||||
#define OBJ_LEN_UNDERLN 1
|
||||
#define OBJ_LEN_S_SCRPT 1
|
||||
#define OBJ_LEN_U_SCRPT 1
|
||||
#define OBJ_LEN_HALF_H 1
|
||||
#define OBJ_LEN_PRN_LEN 3
|
||||
#define OBJ_LEN_ZERO 1
|
||||
#define OBJ_LEN_REPEATED 6
|
||||
#define OBJ_LEN_VERTICLE 1
|
||||
#define OBJ_LEN_WRAP_SEMI 1
|
||||
#define OBJ_LEN_FOR 80
|
||||
#define OBJ_LEN_SEC_ROW 3
|
||||
#define OBJ_LEN_ATTRB 8
|
||||
#define OBJ_LEN_VAL 1
|
||||
#define OBJ_LEN_OBJ_UNIQUE 4
|
||||
#define OBJ_LEN_MDL_F_TYPE 2
|
||||
#define OBJ_LEN_POINT 2
|
||||
#define OBJ_LEN_COL_JUST 3 // N 3
|
||||
#define OBJ_LEN_PATTERN 10 // C 10
|
||||
#define OBJ_LEN_BORDER 5 // N 5 2
|
||||
|
||||
#define OBJ_OS_TYPE 1 // N 1
|
||||
#define OBJ_OS_ROW 2 // N 3
|
||||
#define OBJ_OS_COL 5 // N 3
|
||||
#define OBJ_OS_TEXT 8 // C 15
|
||||
#define OBJ_OS_COLOR 23 // C 7
|
||||
#define OBJ_OS_TO_ROW 30 // N 3
|
||||
#define OBJ_OS_TO_COL 33 // N 3
|
||||
#define OBJ_OS_ID 36 // C 15
|
||||
#define OBJ_OS_SECTION 51 // N 4
|
||||
#define OBJ_OS_ALIAS 55 // C 8
|
||||
#define OBJ_OS_FIELD 63 // N 3
|
||||
#define OBJ_OS_EQN 66 // C 240
|
||||
#define OBJ_OS_F_TYPE 306 // C 1
|
||||
#define OBJ_OS_F_LEN 307 // N 3
|
||||
#define OBJ_OS_F_DEC 310 // N 2
|
||||
#define OBJ_OS_F_PIC 312 // C 20
|
||||
#define OBJ_OS_ALIGN 332 // C 1
|
||||
#define OBJ_OS_PITCH 333 // N 2
|
||||
#define OBJ_OS_FONT 335 // C 8
|
||||
#define OBJ_OS_BOLD 343 // L 1
|
||||
#define OBJ_OS_ITALIC 344 // L 1
|
||||
#define OBJ_OS_UNDERLN 345 // L 1
|
||||
#define OBJ_OS_S_SCRPT 346 // L 1
|
||||
#define OBJ_OS_U_SCRPT 347 // L 1
|
||||
#define OBJ_OS_HALF_H 348 // L 1
|
||||
#define OBJ_OS_PRN_LEN 349 // N 3
|
||||
#define OBJ_OS_ZERO 352 // L 1
|
||||
#define OBJ_OS_REPEATED 353 // C 6
|
||||
#define OBJ_OS_VERTICLE 359 // L 1
|
||||
#define OBJ_OS_WRAP_SEMI 360 // L 1
|
||||
#define OBJ_OS_FOR 361 // C 80
|
||||
#define OBJ_OS_SEC_ROW 441 // N 3
|
||||
#define OBJ_OS_ATTRB 444 // C 8
|
||||
#define OBJ_OS_VAL 452 // C 1
|
||||
#define OBJ_OS_OBJ_UNIQUE 453 // N 4
|
||||
#define OBJ_OS_MDL_F_TYPE 457 // N 2
|
||||
#define OBJ_OS_POINT 459 // N 2
|
||||
#define OBJ_OS_COL_JUST 461 // N 3
|
||||
#define OBJ_OS_PATTERN 464 // C 10
|
||||
#define OBJ_OS_BORDER 474 // N 5 2
|
||||
// ----
|
||||
// TOTAL 474
|
||||
|
||||
#define VV_ID 1 // N 1
|
||||
#define VV_FIELD 2 // N 3
|
||||
#define VV_F_TYPE 3 // C 1
|
||||
#define VV_F_LEN 4 // N 3
|
||||
#define VV_F_DEC 5 // N 2
|
||||
#define VV_ATTRB 6 // C 8
|
||||
#define VV_EQN 7 // C 240
|
||||
#define VV_PRN_LEN 8 // N 3
|
||||
#define VV_F_PIC 9 // C 20
|
||||
#define VV_PITCH 10 // N 2
|
||||
#define VV_FONT 11 // C 8
|
||||
#define VV_BOLD 12 // L 1
|
||||
#define VV_ITALIC 13 // L 1
|
||||
#define VV_UNDERLN 14 // L 1
|
||||
#define VV_S_SCRPT 15 // L 1
|
||||
#define VV_U_SCRPT 16 // L 1
|
||||
#define VV_HALF_H 17 // L 1
|
||||
#define VV_ALIGN 18 // C 1
|
||||
#define VV_COLOR 19 // C 7
|
||||
#define VV_ZERO 20 // L 1
|
||||
#define VV_REPEATED 21 // C 6
|
||||
#define VV_VERTICLE 22 // L 1
|
||||
#define VV_WRAP_SEMI 23 // L 1
|
||||
#define VV_FOR 24 // C 80
|
||||
#define VV_OBJ_UNIQUE 25 // N 4
|
||||
#define VV_MDL_F_TYPE 26 // N 2
|
||||
#define VV_POINT 27 // N 2
|
||||
#define VV_COL_JUST 28
|
||||
#define VV_PATTERN 29
|
||||
#define VV_BORDER 30
|
||||
|
||||
#define VV_INIT_VRBLS 30
|
||||
|
||||
#define OBJ_REFRESH_ALL 1
|
||||
#define OBJ_REFRESH_LINE 2
|
||||
#define OBJ_REFRESH_NIL 0
|
||||
|
||||
#define OBJ_O_BOX 1
|
||||
#define OBJ_O_LINE 2
|
||||
#define OBJ_O_TEXT 3
|
||||
#define OBJ_O_FIELD 4
|
||||
#define OBJ_O_EXP 5
|
||||
#define OBJ_O_BMP 6
|
||||
|
||||
// Properties will be based on these attributes
|
||||
#define DGN_MODULE 1
|
||||
#define DGN_REPORT 2
|
||||
#define DGN_DOCUMENT 3
|
||||
#define DGN_LABEL 4
|
||||
#define DGN_SCREEN 5
|
||||
|
||||
#define OBJ_MODE_SELECT 1
|
||||
#define OBJ_MODE_MOVE 2
|
||||
#define OBJ_MODE_IDLE 0
|
||||
|
||||
#define SCN_TOP 1
|
||||
#define SCN_LEFT 2
|
||||
#define SCN_BOTTOM 3
|
||||
#define SCN_RIGHT 4
|
||||
#define SCN_STATUS_ROW 5
|
||||
#define SCN_STATUS_COL 6
|
||||
#define SCN_STATUS_COL_TO 7
|
||||
#define SCN_MODE 8
|
||||
#define SCN_ROW_CUR 9
|
||||
#define SCN_COL_CUR 10
|
||||
#define SCN_ROW_REP 11
|
||||
#define SCN_COL_REP 12
|
||||
#define SCN_ROW_DIS 13
|
||||
#define SCN_COL_DIS 14
|
||||
#define SCN_ROW_RULER 15
|
||||
#define SCN_ROW_MENU 16
|
||||
#define SCN_COL_MAX 17
|
||||
#define SCN_ROW_PREV 18
|
||||
#define SCN_COL_PREV 19
|
||||
#define SCN_REP_LINES 20
|
||||
#define SCN_CLR_STATUS 21
|
||||
#define SCN_CLR_TEXT 22
|
||||
#define SCN_CLR_BOX 23
|
||||
#define SCN_CLR_FIELD 24
|
||||
#define SCN_CLR_HILITE 25
|
||||
#define SCN_CLR_WINDOW 26
|
||||
#define SCN_CLR_RULER 27
|
||||
#define SCN_CLR_MENU 28
|
||||
#define SCN_CLR_OVERALL 29
|
||||
#define SCN_CLR_PREV 30
|
||||
#define SCN_CLR_SELECT 31
|
||||
#define SCN_OBJ_HILITE 32
|
||||
#define SCN_OBJ_SELECTED 33
|
||||
#define SCN_FILE 34 // 'Untitled'
|
||||
#define SCN_RULER 35 // C
|
||||
#define SCN_DRAW_FILL 36 // C
|
||||
#define SCN_OBJ_ID_ 37 // {}
|
||||
#define SCN_REFRESH 38 // .F.
|
||||
#define SCN_OBJ_COPIED 39
|
||||
#define SCN_BOX_SHAPE 40
|
||||
#define SCN_CHR_PREV 41
|
||||
#define SCN_DESIGN 42
|
||||
#define SCN_DESIGN_ID 43
|
||||
#define SCN_PROPERTY 44
|
||||
#define SCN_GRAPHICS 45
|
||||
#define SCN_TEXT_BLOCK_ 46
|
||||
#define SCN_SECTORS_ 47
|
||||
#define SCN_FIELDS 48
|
||||
#define SCN_LASTKEY 49
|
||||
#define SCN_FOR_ROWS 50
|
||||
#define SCN_COBJECT 51 // fOR tHREADED uSE
|
||||
#define SCN_CRPT 52 // .
|
||||
#define SCN_NWHERE 53 // .
|
||||
#define SCN_LMSG 54 // .
|
||||
#define SCN_NMODE 55 // .
|
||||
|
||||
#define SCN_NUM_VAR 55
|
||||
|
||||
|
||||
#define REP_DESC 1 // C 70
|
||||
#define REP_TYPE 2 // N 3
|
||||
#define REP_IDX_NO 3 // N 3
|
||||
#define REP_IDX_EXP 4 // C 240
|
||||
#define REP_PG_SIZE 5 // C 12
|
||||
#define REP_PG_LEN 6 // N 5
|
||||
#define REP_PG_WID 7 // N 5
|
||||
#define REP_LINES 8 // N 2
|
||||
#define REP_MG_TOP 9 // N 3
|
||||
#define REP_MG_LEFT 10 // N 3
|
||||
#define REP_MG_BOTTOM 11 // N 3
|
||||
#define REP_EJ_BEFORE 12 // L 1
|
||||
#define REP_EJ_AFTER 13 // L 1
|
||||
#define REP_PLAIN 14 // N 2
|
||||
#define REP_FTR_PAG 15 // L 1
|
||||
#define REP_SMR_NEXT 16 // L 1
|
||||
#define REP_HDR_PAGES 17 // C 10
|
||||
#define REP_BNK_LINES 18 // N 3
|
||||
#define REP_BNK_AFTER 19 // N 3
|
||||
#define REP_DATA_BOX 20 // L 1
|
||||
#define REP_FILE 21 // C 80
|
||||
#define REP_COPIES 22 // N 3
|
||||
#define REP_TTL_PAGES 23 // C 10
|
||||
#define REP_INIT_CPI 24 // N 2
|
||||
#define REP_PRN_QLY 25 // C 1
|
||||
#define REP_RECONFIRM 26 // L 1
|
||||
#define REP_FTR_BOTTOM 27 // L 1
|
||||
#define REP_HTML 28 // L 1
|
||||
#define REP_PRINTER 29 // C 7
|
||||
#define REP_ORIENT 30 // C 1
|
||||
#define REP_PREVIEW 31 // L 1
|
||||
#define REP_GRAY 32 // L 1
|
||||
#define REP_WINDLG 33 // L 1
|
||||
#define REP_DUPLEX 34 // N 1
|
||||
#define REP_COLS 35 // N 3
|
||||
#define REP_ROWS 36 // N 3
|
||||
|
||||
#define REP_FOR 37 // C 240
|
||||
#define REP_WHILE 38 // C 125
|
||||
#define REP_FIRST 39 // C 125
|
||||
#define REP_EXE_PRE 40 // C 245
|
||||
#define REP_EXE_POST 41 // C 245
|
||||
|
||||
#define REP_INIT_VRBLS 41
|
||||
|
||||
#define REP_LEN_DESC 70
|
||||
#define REP_LEN_TYPE 3
|
||||
#define REP_LEN_IDX_NO 3
|
||||
#define REP_LEN_IDX_EXP 240
|
||||
#define REP_LEN_PG_SIZE 12
|
||||
#define REP_LEN_PG_LEN 5
|
||||
#define REP_LEN_PG_WID 5
|
||||
#define REP_LEN_LINES 2
|
||||
#define REP_LEN_MG_TOP 3
|
||||
#define REP_LEN_MG_LEFT 3
|
||||
#define REP_LEN_MG_BOTTOM 3
|
||||
#define REP_LEN_EJ_BEFORE 1
|
||||
#define REP_LEN_EJ_AFTER 1
|
||||
#define REP_LEN_PLAIN 2
|
||||
#define REP_LEN_FTR_PAG 1
|
||||
#define REP_LEN_SMR_NEXT 1
|
||||
#define REP_LEN_HDR_PAGES 10
|
||||
#define REP_LEN_BNK_LINES 3
|
||||
#define REP_LEN_BNK_AFTER 3
|
||||
#define REP_LEN_DATA_BOX 1
|
||||
#define REP_LEN_FILE 80
|
||||
#define REP_LEN_COPIES 3
|
||||
#define REP_LEN_TTL_PAGES 10
|
||||
#define REP_LEN_INIT_CPI 2
|
||||
#define REP_LEN_PRN_QLY 1
|
||||
#define REP_LEN_RECONFIRM 1
|
||||
#define REP_LEN_FTR_BOTTOM 1
|
||||
#define REP_LEN_HTML 1
|
||||
#define REP_LEN_PRINTER 7
|
||||
#define REP_LEN_ORIENT 1
|
||||
#define REP_LEN_PREVIEW 1
|
||||
#define REP_LEN_GRAY 1
|
||||
#define REP_LEN_WINDLG 1
|
||||
#define REP_LEN_DUPLEX 1
|
||||
#define REP_LEN_COLS 3
|
||||
#define REP_LEN_ROWS 3
|
||||
|
||||
#define REP_LEN_FOR 240
|
||||
#define REP_LEN_WHILE 125
|
||||
#define REP_LEN_FIRST 125
|
||||
#define REP_LEN_EXE_PRE 245
|
||||
#define REP_LEN_EXE_POST 245
|
||||
|
||||
#define REP_OS_DESC 1 // C 70
|
||||
#define REP_OS_TYPE 71 // N 3
|
||||
#define REP_OS_IDX_NO 74 // N 3
|
||||
#define REP_OS_IDX_EXP 77 // C 240
|
||||
#define REP_OS_PG_SIZE 317 // C 12
|
||||
#define REP_OS_PG_LEN 329 // N 5
|
||||
#define REP_OS_PG_WID 334 // N 5
|
||||
#define REP_OS_LINES 339 // N 2
|
||||
#define REP_OS_MG_TOP 341 // N 3
|
||||
#define REP_OS_MG_LEFT 344 // N 3
|
||||
#define REP_OS_MG_BOTTOM 347 // N 3
|
||||
#define REP_OS_EJ_BEFORE 350 // L 1
|
||||
#define REP_OS_EJ_AFTER 351 // L 1
|
||||
#define REP_OS_PLAIN 352 // N 2
|
||||
#define REP_OS_FTR_PAG 354 // L 1
|
||||
#define REP_OS_SMR_NEXT 355 // L 1
|
||||
#define REP_OS_HDR_PAGES 356 // C 10
|
||||
#define REP_OS_BNK_LINES 366 // N 3
|
||||
#define REP_OS_BNK_AFTER 369 // N 3
|
||||
#define REP_OS_DATA_BOX 372 // L 1
|
||||
#define REP_OS_FILE 373 // C 80
|
||||
#define REP_OS_COPIES 453 // N 3
|
||||
#define REP_OS_TTL_PAGES 456 // C 10
|
||||
#define REP_OS_INIT_CPI 466 // N 2
|
||||
#define REP_OS_PRN_QLY 468 // C 1
|
||||
#define REP_OS_RECONFIRM 469 // L 1
|
||||
#define REP_OS_FTR_BOTTOM 470 // L 1
|
||||
#define REP_OS_HTML 471 // L 1
|
||||
#define REP_OS_PRINTER 472 // C 7
|
||||
#define REP_OS_ORIENT 479 // C 1
|
||||
#define REP_OS_PREVIEW 480 // L 1
|
||||
#define REP_OS_GRAY 481 // L 1
|
||||
#define REP_OS_WINDLG 482 // L 1
|
||||
#define REP_OS_DUPLEX 483 // N 1
|
||||
#define REP_OS_COLS 484 // N 3
|
||||
#define REP_OS_ROWS 487 // N 3
|
||||
|
||||
|
||||
// TOTAL 490
|
||||
|
||||
#define REP_OS_FOR 1 // C 240
|
||||
#define REP_OS_WHILE 241 // C 125
|
||||
#define REP_OS_FIRST 366 // C 125
|
||||
|
||||
#define REP_OS_EXE_PRE 1 // C 245
|
||||
#define REP_OS_EXE_POST 246 // C 245
|
||||
|
||||
|
||||
#define SCT_ORDER 1
|
||||
#define SCT_ID 2
|
||||
#define SCT_SAY 3
|
||||
#define SCT_ROWS 4
|
||||
#define SCT_COLOR 5
|
||||
#define SCT_EQN 6
|
||||
#define SCT_EJECT 7
|
||||
#define SCT_RESET 8
|
||||
|
||||
#define SCT_INIT_VRBLS 8
|
||||
|
||||
#define SCT_LEN_ORDER 3
|
||||
#define SCT_LEN_ID 8
|
||||
#define SCT_LEN_SAY 5
|
||||
#define SCT_LEN_ROWS 3
|
||||
#define SCT_LEN_COLOR 7
|
||||
#define SCT_LEN_EQN 240
|
||||
#define SCT_LEN_EJECT 1
|
||||
#define SCT_LEN_RESET 1
|
||||
|
||||
#define SCT_OS_ORDER 1 // N 3
|
||||
#define SCT_OS_ID 4 // C 8
|
||||
#define SCT_OS_SAY 12 // C 5
|
||||
#define SCT_OS_ROWS 17 // N 3
|
||||
#define SCT_OS_COLOR 20 // C 7
|
||||
#define SCT_OS_EQN 27 // C 240
|
||||
#define SCT_OS_EJECT 267 // L 1
|
||||
#define SCT_OS_RESET 268 // L 1
|
||||
|
||||
#define SCT_ID_GRP01_H 200
|
||||
#define SCT_ID_GRP01_S 800
|
||||
|
||||
#define SCT_CLR_ {'W+/RB','W+/G','W+/R','W+/N','W+/GR'}
|
||||
|
||||
#define SCT_INIT_GROUPS 20
|
||||
|
||||
#define REP_FOR_MOD 1
|
||||
#define REP_FOR_RPT 2
|
||||
#define REP_FOR_BRW 3
|
||||
#define REP_FOR_MDL 4
|
||||
#define REP_FOR_DOC 5
|
||||
#define REP_FOR_LAB 6
|
||||
#define REP_FOR_SCR 7
|
||||
|
||||
#define REP_SRC_MOD 100
|
||||
#define REP_SRC_RPT 200
|
||||
#define REP_SRC_BRW 300
|
||||
#define REP_SRC_MDL 400
|
||||
#define REP_SRC_DOC 500
|
||||
#define REP_SRC_LAB 600
|
||||
#define REP_SRC_SCR 700
|
||||
|
||||
|
||||
#translate B_MSG ;
|
||||
[ <msg,...> ] ;
|
||||
[ AT <r1> [, <c1> ] ] ;
|
||||
[ TO <r2> [, <c2> ] ] ;
|
||||
[ WIDTH <w> ] ;
|
||||
[ DEPTH <d> ] ;
|
||||
[ COLOR <clr> ] ;
|
||||
[ CHOOSE <ch,...> ] ;
|
||||
[ CHOOSECOLOR <chClr> ] ;
|
||||
[ CHCOLOR <chClr> ] ;
|
||||
[ INTO <ret> ] ;
|
||||
[ WAIT <wait> ] ;
|
||||
[ <rest:RESTORE,REST> ] ;
|
||||
[ <paste:PASTE> ] ;
|
||||
[ <shadow:SHADOW> ] ;
|
||||
[ TRIGGER <trg> ] ;
|
||||
[ INITIAL <init> ] ;
|
||||
[ SELECTABLES <sel> ] ;
|
||||
[ ABORT <abr> ] ;
|
||||
[ <selections:SELECTIONS> ] ;
|
||||
[ <leftright:LEFTRIGHT> ] ;
|
||||
[ <cent:CENTER,CENTRE> ] ;
|
||||
[ TAGGED <tag_> ] ;
|
||||
[ <num:NUMERIC> ] ;
|
||||
[ HELP <hlp> ] ;
|
||||
[ EXECUTE <ex_> ] ;
|
||||
[ NUMBERED <num_> ] ;
|
||||
[ <lNoXpp:NOXPP> ] ;
|
||||
[ WINDOW <oWin> ] ;
|
||||
[ ICON <cIcon> ] ;
|
||||
[ WVT <lWvt> ] ;
|
||||
[ ALIGN <nAlign> ] ;
|
||||
=> ;
|
||||
[<ret> := ] VouchMsgBox (<r1>, <c1>, <r2>, <c2>, <w>, <d>, ;
|
||||
{<msg>}, <clr>, {<ch>}, <chClr>, <wait>, <.rest.>, ;
|
||||
<.paste.>, <.shadow.>, <trg>, <init>, <sel>, <abr>, ;
|
||||
<.selections.>, <.leftright.>, <.cent.>, <tag_>,<.num.>,;
|
||||
<hlp>,<ex_>,<num_>,<.lNoXpp.>,<oWin>,<cIcon>,<lWvt>,<nAlign> )
|
||||
|
||||
|
||||
#xtranslate B_GETS ;
|
||||
HEADERS <hed> VALUES <val> ;
|
||||
[ SELECTABLES <sel> ] ;
|
||||
[ AT <r1> [, <c1> ] ] ;
|
||||
[ TO <r2> [, <c2> ] ] ;
|
||||
[ TITLE <ttl> ] ;
|
||||
[ INTO <ret> ] ;
|
||||
[ WHEN <whn> ] ;
|
||||
[ VALID <vld> ] ;
|
||||
[ PICTURE <pic> ] ;
|
||||
[ HELP <hlp> ] ;
|
||||
[ ORDER <ord> ] ;
|
||||
=> ;
|
||||
[<ret> := ] VouchGetArray(<hed>, <val>, <sel>, <r1>, <c1>, <r2>, <c2>, ;
|
||||
<ttl>, <whn>, <vld>, <pic>, <hlp>, <ord> )
|
||||
|
||||
|
||||
#xtranslate B_CRT <nTop>,<nLeft>,<nBottom>,<nRight> ;
|
||||
[ TITLE <ttl> ] ;
|
||||
[ ICON <icon> ] ;
|
||||
[ <lModal:MODAL> ] ;
|
||||
[ <lRowCols:RESIZEROWCOLS> ] ;
|
||||
[ <lHidden:HIDDEN> ] ;
|
||||
[ <lCenter:CENTER> ] ;
|
||||
[ AT <nRow>,<nCol> ] ;
|
||||
[ <lNoTitleBar:NOTITLEBAR> ] ;
|
||||
INTO <oCrt> ;
|
||||
=> ;
|
||||
<oCrt> := Vou_CreateOCrt( <nTop>, <nLeft>, <nBottom>, <nRight>, <ttl>, <icon>, ;
|
||||
<.lModal.>, <.lRowCols.>, <.lHidden.>, <.lCenter.>, ;
|
||||
<nRow>, <nCol>, <.lNoTitleBar.> )
|
||||
|
||||
#define NTRIM( n ) ltrim( str( n ) )
|
||||
|
||||
#define COMPILE( cStr ) &( "{|v,w,x| " + cStr + " }" )
|
||||
|
||||
|
||||
#define K_MOVING 1001
|
||||
#define K_LEFT_DOWN 1002
|
||||
#define K_LEFT_DBLCLICK 1006
|
||||
#define K_LEFT_UP 1003
|
||||
#define K_RIGHT_DOWN 1004
|
||||
#define K_RIGHT_DBLCLICK 1007
|
||||
#define K_RIGHT_UP 1005
|
||||
|
||||
#define CHECKMARK chr( 251 )
|
||||
|
||||
#endif
|
||||
32
harbour/contrib/hbcuied/hbcuied.hbp
Normal file
32
harbour/contrib/hbcuied/hbcuied.hbp
Normal file
@@ -0,0 +1,32 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
-3rd=hbide_version=1.0
|
||||
-3rd=hbide_title=hbcuied
|
||||
-3rd=hbide_output=hbcuied
|
||||
|
||||
-w3
|
||||
-es2
|
||||
-inc
|
||||
-mt
|
||||
-gui
|
||||
|
||||
-gtwvg
|
||||
|
||||
..\gtwvg\gtwvg.hbc
|
||||
|
||||
cu_main.prg
|
||||
cu_desgn.prg
|
||||
cu_field.prg
|
||||
cu_menu.prg
|
||||
cu_outpt.prg
|
||||
cu_prpty.prg
|
||||
cu_utlty.prg
|
||||
cu_achoi.prg
|
||||
|
||||
-ohbcuied
|
||||
|
||||
-3rd=hbide_file=hbcuied.ch
|
||||
|
||||
|
||||
Reference in New Issue
Block a user