Senin, 27 Oktober 2008
Windows Search
If you want to make windows seacrh with user object control you can use windows object and put the user object control in centre of the windows and then you can use single line edit for search the word and so the button for execute. if you use this windows design you can use this script and put into this script in user event.
// Entry_Chosen Script for UO_1
string ls_selected_value,ls_ret
ls_selected_value = left(return_selected (),6)
if Len (ls_selected_value) = 0 then
RETURN
END IF
// ls_selected_value = "Nothing"
ls_ret = trim(ls_selected_value)
CloseWithReturn(parent,ls_ret)
Minggu, 05 Oktober 2008
Using User Event ( ue_add) to define or adding rows
I usually use this script in windows ancestor by define custom event ( user event), this script prepare the windows for adding rows
If dw_1.AcceptText() = -1 then
MessageBox('Message','Header not complete...')
return
end if
dw_1.enabled=true
dw_1.Object.DataWindow.ReadOnly = false
If (dw_1.modifiedcount() > 0 Or dw_1.deletedCount() > 0) and &
imn_mymenu.m_file.m_save.enabled then
if messagebox("Informasi","Data harus disimpan terlebih "+&
"dahulu...Simpan?", Question!,YesNo!,2) = 1 then
triggerevent("ue_save")
end if
end if
dw_1.reset()
dw_1.scrolltorow(dw_1.insertrow(0))
if hdr_autoinc = true then
header_id ++
dw_1.SetItem(dw_1.GetRow(),hdr_pk1,header_id)
dw_1.SetTabOrder(hdr_pk1,0)
dw_1.SetColumn(hdr_set)
Else
dw_1.SetTabOrder(hdr_pk1,10)
If hdr_pk2 <> '' then
dw_1.SetTabOrder(hdr_pk2,20)
End if
If hdr_pk3 <> '' then
dw_1.SetTabOrder(hdr_pk3,30)
End if
dw_1.SetColumn(hdr_pk1)
dw_1.SetFocus()
End if
ibl_add = true
If dw_1.AcceptText() = -1 then
MessageBox('Message','Header not complete...')
return
end if
dw_1.enabled=true
dw_1.Object.DataWindow.ReadOnly = false
If (dw_1.modifiedcount() > 0 Or dw_1.deletedCount() > 0) and &
imn_mymenu.m_file.m_save.enabled then
if messagebox("Informasi","Data harus disimpan terlebih "+&
"dahulu...Simpan?", Question!,YesNo!,2) = 1 then
triggerevent("ue_save")
end if
end if
dw_1.reset()
dw_1.scrolltorow(dw_1.insertrow(0))
if hdr_autoinc = true then
header_id ++
dw_1.SetItem(dw_1.GetRow(),hdr_pk1,header_id)
dw_1.SetTabOrder(hdr_pk1,0)
dw_1.SetColumn(hdr_set)
Else
dw_1.SetTabOrder(hdr_pk1,10)
If hdr_pk2 <> '' then
dw_1.SetTabOrder(hdr_pk2,20)
End if
If hdr_pk3 <> '' then
dw_1.SetTabOrder(hdr_pk3,30)
End if
dw_1.SetColumn(hdr_pk1)
dw_1.SetFocus()
End if
ibl_add = true
Change Data Window and Drop Down Data Window with Radio Button
If you want to change data window and drop down data window using sintax in any radio button or else with even click by that , you can using this script for that before you retriving data, this script usually using in the many reporting.
dw_2.dataobject = 'dw_drop_down'
dw_1.dataobject = 'dw_report'
dw_2.settransobject(sqlca)
dw_1.settransobject(sqlca)
DataWindowChild ldw_child1
dw_2.GetChild('uk', ldw_child1)
ldw_child1.SetTransObject(SQLCA)
ldw_child1.Retrieve()
dw_2.dataobject = 'dw_drop_down'
dw_1.dataobject = 'dw_report'
dw_2.settransobject(sqlca)
dw_1.settransobject(sqlca)
DataWindowChild ldw_child1
dw_2.GetChild('uk', ldw_child1)
ldw_child1.SetTransObject(SQLCA)
ldw_child1.Retrieve()
Langganan:
Postingan (Atom)