IF cWSshow = "W"
add to oLbvm header sLbl[1] data oUnt:vehlic ALIGN LEFT ORDER "evelic" SIZE 180
add to oLbvm Header "Client" data oUnt:clicom ALIGN LEFT ORDER "evecom" SIZE 300
add to oLbvm Header "Account" data oUnt:acrnum ALIGN CENTER ORDER "evenum" SIZE 130
add to oLbvm Header sLbl[2] data oUnt:vehidn ALIGN LEFT ORDER "eveidn" SIZE 300
add to oLbvm Header "Year" data oUnt:vehyer ALIGN CENTER SIZE 80
add to oLbvm header "Make" data oUnt:vehmak ALIGN LEFT ORDER "evemod" SIZE 250
add to oLbvm Header "Model" data oUnt:vehmod ALIGN LEFT SIZE 250
add to oLbvm Header "SubModel" data oUnt:vehsmd ALIGN LEFT SIZE 250
ELSE
add to oLbvm header sLbl[1] data oUnt:vehlic ALIGN LEFT ORDER "evelic"
add to oLbvm Header "Client" data oUnt:clicom ALIGN LEFT ORDER "evecom"
add to oLbvm Header sLbl[2] data oUnt:vehidn ALIGN LEFT ORDER "eveidn"
add to oLbvm Header "Year" data oUnt:vehyer ALIGN LEFT
add to oLbvm header "Make" data oUnt:vehmak ALIGN LEFT ORDER "evemod"
add to oLbvm Header "Model" data oUnt:vehmod ALIGN LEFT
ENDIF
#include "fivewin.ch"
REQUEST DBFCDX
static oUnt
function Main()
OpenDBF()
BrowseData()
return nil
static function OpenDbf
CreateDBF()
oUnt := TDataBase():New( nil, "UNT.DBF", "DBFCDX", .t. )
oUnt:Use()
return nil
static function CreateDBF()
local n
local aCols := { ;
{ "VEHLIC", "C", 10, 0 }, ;
{ "CLICOM", "C", 25, 0 }, ;
{ "ACRNUM", "C", 10, 0 }, ;
{ "VEHIDN", "C", 10, 0 }, ;
{ "VEHYER", "C", 4, 0 }, ;
{ "VEHMAK", "C", 10, 0 }, ;
{ "VEHMOD", "C", 10, 0 }, ;
{ "VEHSMD", "C", 10, 0 } }
DBCREATE( "UNT.DBF", aCols, "DBFCDX", .T., "UNT" )
APPEND BLANK
for n := 1 to Len( aCols )
FieldPut( n, Replicate( Chr( n + 64 ), FieldLen( n ) ) )
next
CLOSE UNT
return nil
static function BrowseData()
local oDlg, oLbvm, sLbl[2]
local cWSShow := 'S'
sLbl[ 1 ] := "Lab-1"
sLbl[ 2 ] := "Lab-2"
DEFINE DIALOG oDlg SIZE 700,200 PIXEL TITLE FWVERSION
@ 10,10 XBROWSE oLbvm SIZE -10,-10 PIXEL OF oDlg ;
DATASOURCE oUnt CELL LINES NOBORDER
IF cWSshow = "W"
add to oLbvm header sLbl[1] data oUnt:vehlic ALIGN LEFT ORDER "evelic" SIZE 180
add to oLbvm Header "Client" data oUnt:clicom ALIGN LEFT ORDER "evecom" SIZE 300
add to oLbvm Header "Account" data oUnt:acrnum ALIGN CENTER ORDER "evenum" SIZE 130
add to oLbvm Header sLbl[2] data oUnt:vehidn ALIGN LEFT ORDER "eveidn" SIZE 300
add to oLbvm Header "Year" data oUnt:vehyer ALIGN CENTER SIZE 80
add to oLbvm header "Make" data oUnt:vehmak ALIGN LEFT ORDER "evemod" SIZE 250
add to oLbvm Header "Model" data oUnt:vehmod ALIGN LEFT SIZE 250
add to oLbvm Header "SubModel" data oUnt:vehsmd ALIGN LEFT SIZE 250
ELSE
add to oLbvm header sLbl[1] data oUnt:vehlic ALIGN LEFT ORDER "evelic"
add to oLbvm Header "Client" data oUnt:clicom ALIGN LEFT ORDER "evecom"
add to oLbvm Header sLbl[2] data oUnt:vehidn ALIGN LEFT ORDER "eveidn"
add to oLbvm Header "Year" data oUnt:vehyer ALIGN LEFT
add to oLbvm header "Make" data oUnt:vehmak ALIGN LEFT ORDER "evemod"
add to oLbvm Header "Model" data oUnt:vehmod ALIGN LEFT
ENDIF
oLbvm:CreateFromCode()
ACTIVATE DIALOG oDlg CENTERED
return nil
// Create the dialog to get type of workorder, search type , browse list
DEFINE DIALOG oDpw0 BRUSH oBrush TRANSPARENT RESOURCE "PRO100r" OF oWdlg FONT oMFont
// Create radio controls
REDEFINE RADIO aRadio[1] VAR aRadOpts[1] ID 417, 418, 419 OF oDpw0 ON CLICK oLbwlu:setfocus( )
REDEFINE RADIO aRadio[2] VAR aRadOpts[2] ID 427, 429, 430 OF oDpw0 ;
ON CLICK ( IIF( aRadOpts[2] = 3, oUnt:setOrder("evecom") , oUnt:setOrder("evelic") ), oUnt:gotop(), oLbwlu:setfocus( ) )
// Create button control
REDEFINE BTNBMP RESOURCE "HROK" ID 416 OF oDpw0 TOOLTIP "Create workorder" PROMPT "Accept" ;
ACTION oDpw0:end() NOBORDER TRANSPARENT
REDEFINE BTNBMP RESOURCE "APPT" ID 415 OF oDpw0 TOOLTIP "Create from an appointment" PROMPT "Appointment" ;
ACTION ( aAppt := ShowAppts( aAppt ), lByAppt := .T. , oDpw0:end() ) NOBORDER TRANSPARENT
// Create the browse
REDEFINE XBROWSE oLbwlu ID 440 OF oDpw0
// Attach the database
oLbwlu:setoDBF( oUnt )
// Add the columns
add to oLbwlu Header "Client" data oUnt:clicom ALIGN LEFT
add to oLbwlu header sLbl[4] data oUnt:VehLic ALIGN LEFT
add to oLbwlu Header "Year" data oUnt:VehYer ALIGN LEFT
add to oLbwlu Header "Make" data oUnt:VehMak ALIGN LEFT
add to oLbwlu Header "Model" data oUnt:VehMod ALIGN LEFT
// Provide the header gradient
oLbwlu:bClrGrad := { | lInvert | If( ! lInvert, { { 0.50,16776960,16777215 }, ;
{ 0.50,16777215,16776960 } }, { { 0.50,128,16777215 }, { 0.50,16777215,128 } } ) }
// Set the header and row heights
oLbwlu:nHeaderHeight := 30
oLbwlu:nRowHeight := 24
oLbwlu:nStretchCol := STRETCHCOL_WIDEST
// Turn off horizontal scrolling
oLbwlu:lHScroll := .F.
// Set the styles
oLbwlu:nMarqueeStyle := MARQSTYLE_HIGHLROW
oLbwlu:nColDividerStyle := LINESTYLE_RAISED
oLbwlu:nRowDividerStyle := LINESTYLE_RAISED
// Use for incremental search on opened database
oLbwlu:bSeek := { |c| oUnt:Seek( Upper( c )) }
FOR nCCol := 1 TO LEN( oLbwlu:acols )
oLbwlu:aCols[nCCol]:nHeadStrAlign := AL_CENTER
NEXT
// Activate dialog
ACTIVATE DIALOG oDpw0 ON PAINT oLbwlu:setfocus( ) ON INIT oDpw0:center(wndmain())
PRO100R DIALOG DISCARDABLE 0, 0, 650, 245
STYLE WS_POPUP|DS_MODALFRAME|WS_CAPTION|WS_VISIBLE
CAPTION "Start Workorder"
FONT 8, "Arial"
BEGIN
CONTROL "", 440, "TXBROWSE", WS_TABSTOP|0x00a00000, 10, 40, 630, 130
CONTROL "Estimate", 417, "Button", BS_RADIOBUTTON, 10, 6, 60, 10
CONTROL "Invoice", 418, "Button", BS_RADIOBUTTON, 80, 6, 60, 10
CONTROL "Counter Sale", 419, "Button", BS_RADIOBUTTON, 150, 6, 60, 10
CONTROL "Cash Sale", 427, "Button", BS_RADIOBUTTON, 10, 20, 60, 10
CONTROL "Search by License", 429, "Button", BS_RADIOBUTTON, 150, 20, 100, 10
CONTROL "Search by Client", 430, "Button", BS_RADIOBUTTON, 260, 20, 100, 10
CONTROL "", 416, "Button", WS_TABSTOP, 195, 175, 60, 60
CONTROL "", 415, "Button", WS_TABSTOP, 245, 175, 60, 60
END
VEHLIC C 12 0 License
VEHYER C 4 0 Model year
VEHMAK C 25 0 Make
VEHMOD C 25 0 Model
CLICOM C 25 0 Client name
#include "fivewin.ch"
REQUEST DBFCDX
static oUnt
function Main()
OpenDBF()
BrowseData()
return nil
static function OpenDbf
CreateDBF()
oUnt := TDataBase():New( nil, "UNT.DBF", "DBFCDX", .t. )
oUnt:Use()
return nil
static function CreateDBF()
local n
local aCols := { ;
{ "VEHLIC", "C", 12, 0 }, ;
{ "CLICOM", "C", 25, 0 }, ;
{ "ACRNUM", "C", 10, 0 }, ;
{ "VEHIDN", "C", 10, 0 }, ;
{ "VEHYER", "C", 4, 0 }, ;
{ "VEHMAK", "C", 25, 0 }, ;
{ "VEHMOD", "C", 25, 0 }, ;
{ "VEHSMD", "C", 25, 0 } }
DBCREATE( "UNT.DBF", aCols, "DBFCDX", .T., "UNT" )
APPEND BLANK
for n := 1 to Len( aCols )
FieldPut( n, Replicate( Chr( n + 64 ), FieldLen( n ) ) )
next
CLOSE UNT
return nil
static function BrowseData()
local oDpw0, oLbwlu
local aRadio[2]
local aRadOpts := { 1, 1 }
local oBrush, oMFont,nccol
local slbl := { "lab-1", "lab-2", "lab-3", "lab-4" }
DEFINE FONT oMfont NAME "TAHOMA" SIZE 0,-10
DEFINE BRUSH oBrush FILE "c:\fwh\bitmaps\backgrnd\stone.bmp"
// Create the dialog to get type of workorder, search type , browse list
DEFINE DIALOG oDpw0 BRUSH oBrush TRANSPARENT RESOURCE "PRO100r" /* OF oWdlg */ FONT oMFont
// Create radio controls
REDEFINE RADIO aRadio[1] VAR aRadOpts[1] ID 417, 418, 419 OF oDpw0 ON CLICK oLbwlu:setfocus( )
REDEFINE RADIO aRadio[2] VAR aRadOpts[2] ID 427, 429, 430 OF oDpw0 ;
ON CLICK ( IIF( aRadOpts[2] = 3, oUnt:setOrder("evecom") , oUnt:setOrder("evelic") ), oUnt:gotop(), oLbwlu:setfocus( ) )
// Create button control
REDEFINE BTNBMP RESOURCE "HROK" ID 416 OF oDpw0 TOOLTIP "Create workorder" PROMPT "Accept" ;
ACTION oDpw0:end() NOBORDER TRANSPARENT
REDEFINE BTNBMP RESOURCE "APPT" ID 415 OF oDpw0 TOOLTIP "Create from an appointment" PROMPT "Appointment" ;
ACTION ( /*aAppt := ShowAppts( aAppt ), lByAppt := .T. , */ oDpw0:end() ) NOBORDER TRANSPARENT
// Create the browse
REDEFINE XBROWSE oLbwlu ID 440 OF oDpw0
// Attach the database
oLbwlu:setoDBF( oUnt )
// Add the columns
add to oLbwlu Header "Client" data oUnt:clicom ALIGN LEFT
add to oLbwlu header sLbl[4] data oUnt:VehLic ALIGN LEFT
add to oLbwlu Header "Year" data oUnt:VehYer ALIGN LEFT
add to oLbwlu Header "Make" data oUnt:VehMak ALIGN LEFT
add to oLbwlu Header "Model" data oUnt:VehMod ALIGN LEFT
// Provide the header gradient
oLbwlu:bClrGrad := { | lInvert | If( ! lInvert, { { 0.50,16776960,16777215 }, ;
{ 0.50,16777215,16776960 } }, { { 0.50,128,16777215 }, { 0.50,16777215,128 } } ) }
// Set the header and row heights
oLbwlu:nHeaderHeight := 30
oLbwlu:nRowHeight := 24
oLbwlu:nStretchCol := STRETCHCOL_WIDEST
// Turn off horizontal scrolling
oLbwlu:lHScroll := .F.
// Set the styles
oLbwlu:nMarqueeStyle := MARQSTYLE_HIGHLROW
oLbwlu:nColDividerStyle := LINESTYLE_RAISED
oLbwlu:nRowDividerStyle := LINESTYLE_RAISED
// Use for incremental search on opened database
oLbwlu:bSeek := { |c| oUnt:Seek( Upper( c )) }
FOR nCCol := 1 TO LEN( oLbwlu:acols )
oLbwlu:aCols[nCCol]:nHeadStrAlign := AL_CENTER
NEXT
// Activate dialog
ACTIVATE DIALOG oDpw0 ON PAINT oLbwlu:setfocus( ) ON INIT oDpw0:center(wndmain())
RELEASE BRUSH oBrush
RELEASE FONT oMFont
return nil
#include "fivewin.ch"
REQUEST DBFCDX
function testa()
local oDlg, oBrw, oDbf, oFont
FWNumFormat( 'A', .t. )
oDbf := TDataBase():New( nil, "CUSTOMER", "DBFCDX" )
oDbf:Use()
oDbf:GoTop()
DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-16
DEFINE DIALOG oDlg SIZE 700,500 PIXEL FONT oFont
@ 10,10 XBROWSE oBrw SIZE -10,-10 PIXEL OF oDlg ;
DATASOURCE oDbf ;
COLUMNS "MARRIED", "Trim(First) + ', ' + Last", "HireDate", ;
"IF(YEAR(HIREDATE) < 1990, 'VERYOLD', 'RECENT' )", "Salary" ;
HEADERS "Status", "Name", nil, "HowOld" ;
SORT nil, "First", nil, "hiredate" ;
AUTOSORT ;
CELL LINES NOBORDER FOOTERS
WITH OBJECT oBrw
:nEditTypes := EDIT_GET
:aCols[ 1 ]:SetCheck( nil, .t. )
:Salary:nFooterType := AGGR_SUM
:MakeTotals()
//
:CreateFromCode()
END
ACTIVATE DIALOG oDlg CENTERED
RELEASE FONT oFont
return nil
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 56 guests