New - PBObjet - StandardVisual - DataWindow - Name: n_dw
Instance Variables
public: // 옵션
Boolean ib_PriView = false // DW PriView
Boolean ib_PriViewRulers = false // DW PriViewRulers
Boolean ib_DataStoreBuffer = false // Retrieve DataStore Buffer 사용하기
private: // 내부용
window iw_parent
powerobject ipo_object
Nvo_DataStore inds_Buffer
transaction ds_trans
Long il_row
/* 메시지 박스 표시
integer of_message ( as_message )
*/
String ls_title
if IsValid(iw_parent) then
ls_title = iw_parent.Title
else
if IsValid(ipo_object) then
ls_title = ipo_object.ClassName()
else
ls_title = '에러'
end if
end if
return Messagebox(ls_title, as_message)
/* 부모가 윈도인것을 찾는다.
window of_getparent() */
window lwin
powerobject lpo
lpo = GetParent()
do while IsValid(lpo) and lpo.Typeof() <> window!
lpo = lpo.Getparent( )
Loop
if IsValid(lpo) then
lwin = lpo
else
setNull(lwin)
end if
return lwin
Constructor Event
iw_parent = of_GetParent() // 상위 윈도
ipo_object = GetParent() // 상위 오브젝트
dberror Event
String ls_msg
if ib_DBError then
ls_msg = 'SQLDBCODE: ' + String(sqldbcode) + '~r~n'
choose case sqldbcode
Case -1;ls_msg += 'PBErrTEXT: 트랜잭션의 값을 잃어버리기 때문에 데이타베이스로 연결 할수 없습니다.~r~n'
//Cannot connect to the database because of missing values in the transaction object.
case -2;ls_msg += 'PBErrTEXT: 데이타베이스와 연결되지 안았습니다.~r~n'
//Cannot connect to the database.
case -3;ls_msg += 'PBErrTEXT: Update나 Retrieve에 명시된 Primary Key 현존하는 Column과 맞지 않습니다.~r~n' + &
'다른 사용자가 해당 Column을 작업하여 완료 되지 않았습니다.~r~n'
//The key specified in an Update or Retrieve no longer matches an existing row.
//This can happen when another user has changed the row after you retrieved it.
case -4;ls_msg += 'PBErrTEXT: 데이타베이스에 BLOB자료 넣기가 실패했습니다.~r~n'
//Writing a blob to the database failed.
end choose
/* 번역이 잘못되었더도 용서 하세요 (원문 참조) */
ls_msg += 'ErrorRow : ' + String(Row) + '~r~n'
ls_msg += 'SQLSyntax: ' + SQLSyntax + '~r~n'
ls_msg += 'SQLErrText:' + SQLErrText + '~r~n~r~n'
ls_msg += '------------SQL Message----------~r~n'
ls_msg += "SQLCODE:" + string(sqlca.sqlcode) + '~r~n'
ls_msg += "SQLNROW:" + string(sqlca.sqlnrows) + '~r~n'
ls_msg += "SQLTEXT:" + sqlca.sqlerrtext + '~r~n'
of_message (ls_msg)
end if
return 1
butt[안내]태그제한으로등록되지않습니다-xx[안내]태그제한으로등록되지않습니다-xxonClicked Event
// 윈도(또는 상위 Object)의 이벤트를 호출한다.
// 윈도(또는 상위 Object) 이벤트 규칙 : ue_Eventname
// Botton Name 규칙 : b_EventName
String ls_Event
ls_Event = dwo.name
if Describe(ls_Event+".Type") = 'button' then
ls_Event = 'ue_' + Mid(ls_Event, 3)
if IsValid( iw_parent ) then
iw_parent.Dynamic PostEvent ( ls_Event )
else
if IsValid( ipo_object ) then
ipo_object.Dynamic PostEvent ( ls_Event )
end if
end if
end if
Clicked Event
String ls_Object
IF row > 0 THEN
if ib_MultiSelect then
Choose case True
Case keydown(keyshift!)
long i, ll_row[]
if il_row > row then
ll_row[1] = row
ll_row[2] = il_row
else
ll_row[1] = il_row
ll_row[2] = row
end if
for i = ll_row[1] to ll_row[2]
THIS.selectrow(i, TRUE)
next
Case keydown(KeyControl!)
IF THIS.isselected(row) then
THIS.selectrow(row, FALSE)
else
THIS.selectrow(row, TRUE)
end if
Case Else
This.Event rowfocuschanged ( row )
end choose
THIS.setrow(row)
il_row = row
else
This.Post Event rowfocuschanged ( row )
end if
else
ls_Object = dwo.name
choose case Describe(ls_Object+".Type")
Case 'text'
if ib_HSort then
Post of_dw_sort( this, row, dwo )
end if
end choose
END IF
RowFocusChanged Event
IF currentrow > 0 THEN
if ib_MultiSelect then
Choose case True
Case keydown(keyshift!)
THIS.selectrow(currentrow, TRUE)
Case keydown(KeyControl!)
Case Else
if ib_SelectRow then
THIS.selectrow(0, FALSE)
THIS.selectrow(currentrow, TRUE)
end if
end choose
else
if ib_SelectRow then
THIS.selectrow(0, FALSE)
THIS.selectrow(currentrow, TRUE)
end if
end if
END IF
=== 내용이 상당히 많습니다. ====
첨부파일을 참조 바랍니다.
n_dw.sru
첫댓글 naming rules 에서 nvo하고 n은 뭔가요? uo는 user object같은데요~
nonVisual Object의 약어로 파워빌더 Naming Rule 입니다.
window(또는 userobject), datawindow 편집화면을 열고 메뉴에서 option을 보세요
거기에 파워빌더 naming rule이 있습니다.
네네.. 충성!
n_ 이건 없네요.. n_dw에서 n은 그냥 NonVisual의 약자인가요?
여기저기서 n_로 시작하는 userobject(?) 많이 본듯해서요..
nvo_datawindow 하시면 알아보기 좋겠죠
여기소스를 그대로 사용하지 마시고 님의 명명규칙을 적용하세요
여기의 소스는 알고리즘 개념정도로 생각 하세요
학습을 위하여 실제 프로그램을 하는 순서대로 작성이 된것이지
이대로 프로그램이 될수는 없습니다.
확인차 말씀드린겁니다. 감사합니다! ^^
첨부파일 에러가 있네요~ 의도적인건가요?
파일 받기가 안되는건가요?
파일 받기는 되는데 import 에러인가요?
Import안되는거면 소스를 에디터로 열어 제코딩 해야 하고요
지금 받아 Import 했는데 문제 없습니다.( PB 10.5 7599 )
---------- Compiler: Errors
pbs_base.pbl(n_dw).n_dw.of_backdatasorteretrieve.6: Error C0084: Bad number of arguments for function: of_retrievestatus
pbs_base.pbl(n_dw).n_dw.of_backdatasorteretrieve.7: Error C0051: Unknown function name: of_setparentdatawindow
---------- Finished Errors
of_backdatasorteretrieve 함수에서 사용할 datastore가 없군요
nvo_datastore 라는 userobject가 있어하는데 없군요
http://cafe.daum.net/SWShin/OVy9/9 여기 소스에서
참조 하세요
감사합니다.
저두 같은 파빌 버전입니다!