Tick mark pada tabel

Mengubah kondisi aktif tidaknya data dengan tik mark, dapat dilakukan dengan merubah gridcolums, dalam hal ini gridcoloumn2 di add menggunakan checkbox, yang berfungsi secara logical true, atau false. (dalam visual foxpro) moga membantu

DEFINE CLASS FileA3LoadObj AS FORM
autocenter = .T. && disable display at center of the screen
height = 500
width = 500
borderstyle = 0 && no border (unsizeable)
caption = “Setting Stock Aktive”
closable = .T. &&close disable ok
desktop = .T.
maxbutton = .F. && Disable Maximize Button on the upper right corner
minbutton = .F.
MDIform = .F.
showwindow = 1 && In Top Level Form
windowtype = 1 && modeless
windowstate = 0 && normal
showtips = .T. && This property will effect controls to show the tooltiptext if available
icon = ‘arppm.ico’

ADD OBJECT Buff_grid AS Buff_gridObj

*** Control Button ***
ADD OBJECT UEGB AS COMMANDGROUP;
WITH;
top = 470,;
left = 5,;
width = 162,;
height = 25,;
borderstyle = 0,;
visible=.T.
*** End of Control Button ***

* ====================
* event init / hendler
* ——————–
*** Init Event of COMMAND GROUP ***
PROC UEGB.init()
this.addobject(‘searchbutton’,’searchObj’)
this.addobject(‘resetbutton’,’resetObj’)
this.addobject(‘exitbutton’,’exitObj’)
ENDPROC

* INITIAL PROC *

ENDDEFINE

DEFINE CLASS searchObj AS COMMANDBUTTON
caption = ‘\<Search’
top = 0
left = 0
width = 50
height = 25
fontname = ‘Arial’
fontsize = 8
fontbold = .T.
tooltiptext = ‘Update Table….’
mousepointer = 99
mouseicon = ‘H_point.cur’
visible = .T.

PROCEDURE click()
SELECT inv
GO top
DO WHILE !EOF()
SELECT iv_buff
xpn = inv.pn
SEEK xpn
IF EOF()
APPEND BLANK
REPLACE aktif WITH .F.
REPLACE pn WITH xpn
REPLACE desc WITH inv.desc
ELSE
REPLACE desc WITH inv.desc
ENDIF
SELECT inv
skip
ENDDO
SELECT iv_buff
GO top
this.Parent.parent.buff_grid.refresh
ENDPROC
ENDDEFINE

DEFINE CLASS ResetObj AS COMMANDBUTTON
caption = ‘R\<eset’
top = 0
left = 52
width = 50
height = 25
fontname = ‘Arial’
fontsize = 8
fontbold = .T.
tooltiptext = ‘Reset All…’
mousepointer = 99
mouseicon = ‘H_point.cur’
visible = .T.

PROCEDURE click()
msx1 = messagebox(“Reset semua ke kondisi tidak ditampilkan (false) ?”,4,”Tanya?”)
IF msx1 = 6
SELECT iv_buff
REPLACE ALL aktif WITH .F.
ENDIF
msx2 = messagebox(“Reset semua ke kondisi akan ditampilkan (true) ?”,4,”Tanya?”)
IF msx2 = 6
SELECT iv_buff
REPLACE ALL aktif WITH .T.
ENDIF
SELECT iv_buff
GO top
this.Parent.parent.buff_grid.refresh
ENDPROC
ENDDEFINE

DEFINE CLASS ExitObj AS COMMANDBUTTON
caption = ‘E\<xit’
top = 0
left = 102
width = 50
height = 25
fontname = ‘Arial’
fontsize = 8
fontbold = .T.
tooltiptext = ‘Exit…’
mousepointer = 99
mouseicon = ‘H_point.cur’
visible = .T.

PROCEDURE click()
this.parent.parent.release()
ENDPROC
ENDDEFINE

DEFINE CLASS Buff_gridObj AS GRID
top = 10
left = 5
width = 490
height = 450
columncount = 0 && start setting the columncount property with 0
allowaddnew = .F. && disallow adding new record to the table
allowheadersizing = .F. && disallow resizing the header at run time
allowrowsizing = .F. && disallow resizing the row size at run time
headerheight = 18
rowheight = 18
scrollbars = 2 && Vertical only
recordmark = .F. && hide record mark column on the grid
deletemark = .F. && hide delete mark column on the grid
recordsourcetype = 1 && Use Alias to specified the table
recordsource = ‘iv_buff’

PROCEDURE init
this.addobject(‘column1′,’gridcolumn2’)
WITH this.column1
.controlsource = ‘iv_buff.aktif’
.sparse = .F. && untuk mengaktifkan bound property
.bound = .T. && membuat data duplicate add object – di sparce = .f.
.width = 40
.alignment = 0
.backcolor = RGB(192,192,192)
.readonly = .F. && Read Only Column
.enabled = .T. && enabled the column to get focus
WITH .header1 && Header
.caption = ‘Aktif’
.alignment = 2 && center
.fontname = ‘Arial’
.fontsize = 8
.fontbold = .T.
ENDWITH
ENDWITH

this.addobject(‘column2′,’gridcolumn1’)
WITH this.column2
.controlsource = ‘iv_buff.pn’
.width = 100
.alignment = 0
.readonly = .T. && Read Only Column
.enabled = .T. && enabled the column to get focus
WITH .header1
.caption = ‘Part Id’
.alignment = 2
.fontname = ‘Arial’
.fontsize = 8
.fontbold = .T.
ENDWITH
ENDWITH

this.addobject(‘column3′,’gridcolumn1’)
WITH this.column3
.controlsource = ‘iv_buff.desc’
.width = 300
.alignment = 0
.readonly = .T. && Read Only Column
.enabled = .T. && enabled the column to get focus
WITH .header1
.caption = ‘Description’
.alignment = 2
.fontname = ‘Arial’
.fontsize = 8
.fontbold = .T.
ENDWITH
ENDWITH

ENDDEFINE

DEFINE CLASS gridcolumn1 AS COLUMN
bound = .T.
resizable = .F.
fontname = ‘Arial’
fontsize = 8
fontbold = .F.
selectonentry = .T.
visible = .T.

ADD OBJECT text1 AS TEXTBOX

PROCEDURE text1.init
this.margin = 0
this.borderstyle = 0
this.fontname = this.parent.fontname
this.fontsize = this.parent.fontsize
this.fontbold = this.parent.fontbold
ENDPROC
ENDDEFINE

DEFINE CLASS gridcolumn2 AS COLUMN
bound = .T.
resizable = .F.
fontname = ‘Arial’
fontsize = 8
fontbold = .F.
selectonentry = .T.
visible = .T.

ADD OBJECT check1 AS CHECKBOX

PROCEDURE check1.init
this.fontname = this.parent.fontname
this.fontsize = this.parent.fontsize
this.fontbold = this.parent.fontbold
this.caption = ”
ENDPROC

ENDDEFINE

This entry was posted in Programming. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s