[출처] [PB10] 템플릿 만들기 -6 (파워빌더 모임) |작성자 또치
순수 PB만 가지고 만들기로 했으니..
canvas로 만든 툴바말고 순수 PB만 가지고 툴바 오브젝트를 만들어 봅시다 ㅎㅎ
화면사이즈별로 현재 툴바를 0,0 위치로 이동하여 처리할수도 있지만 화살표 버튼을 통해서 툴바를 이동하게 하기 위해
5에서 만든 픽쳐버튼을 통해 >>, >, < , << 4개를 넣습니다.
그리고 Rect로 감쌌습니다.
그리고 DataWindow하나를 추가합니다.
--; 크롬에서 쓰는중이라 이미지 처리가 Active-X라 한개도 안되는군요 쩝
Datawindow는 dw_top으로 명명합니다.
<< 이벤트
/*-------------------------------------------------------
오브젝트명 : p_mleft
이 벤 트 : Clicked
비 고 : 2008.10.09 By JH
-------------------------------------------------------*/
dw_top.Object.DataWindow.HorizontalScrollPosition = 1
< 이벤트
/*-------------------------------------------------------
오브젝트명 : p_left
이 벤 트 : Clicked
비 고 : 2008.10.09 By JH
-------------------------------------------------------*/
Long ll_position
ll_position = Long(dw_top.Object.DataWindow.HorizontalScrollPosition ) - 50
IF ll_position < 1 Then ll_position = 1
dw_top.Object.DataWindow.HorizontalScrollPosition = ll_position
> 이벤트
/*-------------------------------------------------------
오브젝트명 : p_right
이 벤 트 : Clicked
비 고 : 2008.10.09 By JH
-------------------------------------------------------*/
Long ll_position, ll_max
ll_max = Long(dw_top.Describe("DataWindow.HorizontalScrollMaximum "))
ll_position = Long(dw_top.Describe("DataWindow.HorizontalScrollPosition "))
If ll_max > ll_position Then
dw_top.Object.DataWindow.HorizontalScrollPosition = ll_position + 50
End IF
>> 이벤트
/*-------------------------------------------------------
오브젝트명 : p_mright
이 벤 트 : Clicked
비 고 : 2008.10.09 By JH
-------------------------------------------------------*/
Long ll_max
ll_max = Long(dw_top.Describe("DataWindow.HorizontalScrollMaximum "))
dw_top.Object.DataWindow.HorizontalScrollPosition = ll_max
>나 <일경우 마우스를 누르고 있으면 주르륵 움직이게 만들기 위해
API의 SetTimer와 Killtimer를 이용해서 마우스를 누르고 있으면 클릭 이벤트가 동작하도록 추가해줍니다.
FUNCTION UINT SetTimer( uint hwin, uint idtimer, uint timeout, long tmprc ) library "user32.dll" alias for "SetTimer;Ansi"
FUNCTION BOOLEAN KillTimer( uint hwin, uint idtimer ) library "user32.dll" alias for "KillTimer;Ansi"
Instance Varibles
Integer ii_select_type = 0 //1 : Left, 2: Right
< 이벤트
/*-------------------------------------------------------
오브젝트명 : p_left
이 벤 트 : ue_lbuttondown
비 고 : 2008.10.22 By JH
-------------------------------------------------------*/
ii_select_type = 1
of_timer(True)
/*-------------------------------------------------------
오브젝트명 : p_left
이 벤 트 : ue_lbuttonup
비 고 : 2008.10.22 By JH
-------------------------------------------------------*/
ii_select_type = 0
of_timer(False)
> 이벤트
/*-------------------------------------------------------
오브젝트명 : p_right
이 벤 트 : ue_lbuttondown
비 고 : 2008.10.22 By JH
-------------------------------------------------------*/
ii_select_type = 2
of_timer(True)
/*-------------------------------------------------------
오브젝트명 : p_right
이 벤 트 : ue_lbuttonup
비 고 : 2009.03.05 By JH
-------------------------------------------------------*/
ii_select_type = 0
of_timer(False)
Object 이벤트
/*-------------------------------------------------------
오브젝트명 : uo_tpo_tools
이 벤 트 : ue_timer
비 고 : 2008.10.22 By JH
-------------------------------------------------------*/
Choose Case ii_select_type
Case 1
p_left.Event Clicked()
Case 2
p_right.Event Clicked()
End Choose
자 이동하는게 끝났네요 ㅎㅎ
Datawindow Object를 하나 만들면 됩니다.
Nember Type의 view_cot라는 External Datawindow를 하나 만듭니다.
기본적인건 다 끝났으니 툴바를 어떻게 만들건가 나눠봐야 합니다.
Tool Bar는 기본적으로 [---] 이런 구조입니다. 앞과 가운데 그리고 텍스트 마지막.. 이미지로 나누면 3개가 되겠군요
닫기는 흠.. 그냥 마지막에 같이 붙여버리죠 .. 귀찮으니까 ㅡㅡ;;
자 그냥 소스를 쭉 보세요 ㅡㅡ;;
forward
global type uo_top_tools from vo_base
end type
type p_mright from u_p_btn within uo_top_tools
end type
type p_right from u_p_btn within uo_top_tools
end type
type p_mleft from u_p_btn within uo_top_tools
end type
type p_left from u_p_btn within uo_top_tools
end type
type st_text from statictext within uo_top_tools
end type
type dw_top from datawindow within uo_top_tools
end type
type r_1 from rectangle within uo_top_tools
end type
end forward
global type uo_top_tools from vo_base
integer width = 2354
integer height = 100
long backcolor = 15778976
string text = ""
event ue_timer pbm_timer
p_mright p_mright
p_right p_right
p_mleft p_mleft
p_left p_left
st_text st_text
dw_top dw_top
r_1 r_1
end type
global uo_top_tools uo_top_tools
type prototypes
FUNCTION UINT SetTimer( uint hwin, uint idtimer, uint timeout, long tmprc ) library "user32.dll" alias for "SetTimer;Ansi"
FUNCTION BOOLEAN KillTimer( uint hwin, uint idtimer ) library "user32.dll" alias for "KillTimer;Ansi"
function ulong GetDC(ulong hWnd) Library "USER32.DLL" alias for "GetDC;Ansi"
function long ReleaseDC(ulong hWnd, ulong hdcr) Library "USER32.DLL" alias for "ReleaseDC;Ansi"
function ulong SelectObject(ulong hdc, ulong hWnd) Library "GDI32.DLL" alias for "SelectObject;Ansi"
function boolean GetTextExtentPoint32(ulong hdcr, string lpString, long nCount, ref str_size size) Library "GDI32.DLL" alias for "GetTextExtentPoint32A;Ansi"
FUNCTION boolean ShowWindow (ulong hWnd, int nCmdShow) Library "USER32.DLL" alias for "ShowWindow;Ansi"
FUNCTION Long CreateFont ( Long H, Long W, Long E, Long O, Long W, Long I, Long u, Long S, Long C, Long OP, Long CP, Long Q, Long PAF, String F) LIBRARY "gdi32" ALIAS FOR "CreateFontA"
FUNCTION Long SelectObject ( Long hdc, Long hObject) LIBRARY "gdi32" alias for "SelectObject;Ansi"
FUNCTION Long DeleteObject ( Long hObject) LIBRARY "gdi32" alias for "DeleteObject;Ansi"
FUNCTION Long TextOut ( Long hdc, Long xpos, Long ypos, String lpString, Long nCount) LIBRARY "gdi32" ALIAS FOR "TextOutA;Ansi"
SUBROUTINE GlobalMemoryStatus(ref memory mem2) LIBRARY "kernel32.dll" Alias For "GlobalMemoryStatus;Ansi"
end prototypes
type variables
Public:
Integer #Memory
Private:
DataStore ids_buffer
str_open_window_check lstr_window[]
Integer ii_scrollpos = 1
Integer ii_scrollmax
Long ii_open_menu = 0
Integer ii_select_type = 0 //1 : Left, 2: Right
Long il_max_witdt = 0
Constant String S_P = 'p_s'
Constant String C_P = 'p_c'
Constant String E_P = 'p_e'
Constant String M_TEXT = 't_m'
end variables
forward prototypes
public subroutine of_resize ()
public subroutine of_add_menu (string as_window)
protected subroutine of_scrolltotab (long al_scrollpos)
protected function long of_max_position ()
protected function string of_window_title (readonly string as_window)
public subroutine of_select_tab ()
public subroutine of_active_tab (string as_window)
private subroutine of_select_tab_color (readonly long al_brow, readonly long al_row)
public function window of_window_find (readonly string as_window)
public subroutine of_all_close ()
protected subroutine of_timer (readonly boolean ab_timer)
public function long of_getcolumnwidth (string as_text)
private subroutine of_add_tab (readonly integer ai_menu, readonly string as_title)
public subroutine of_close_win (string as_win)
public function integer of_mem_chk ()
public subroutine of_active_sheet ()
private subroutine of_close_menu (readonly long ai_menu)
end prototypes
event ue_timer;/*-------------------------------------------------------
오브젝트명 : uo_tpo_tools
이 벤 트 : ue_timer
비 고 : 2008.10.22 By JH
-------------------------------------------------------*/
Choose Case ii_select_type
Case 1
p_left.Event Clicked()
Case 2
p_right.Event Clicked()
End Choose
end event
public subroutine of_resize ();/*-------------------------------------------------
함 수 명 : of_resize
개 요 : Tools Resize
매개 변수 : None
리 턴 값 : None
작성 내역 : 2008.09.23 By JH
-------------------------------------------------*/
dw_top.width = This.Width - (p_mright.X + p_mright.Width + 10)
end subroutine
public subroutine of_add_menu (string as_window);/*-------------------------------------------------
함 수 명 : of_add_menu
개 요 : Menu ADD
매개 변수 : ReadOnly String as_window
리 턴 값 : None
작성 내역 : 2008.09.25 By JH
-------------------------------------------------*/
String ls_window, ls_title
String ls_s_nm, ls_c_nm, ls_e_nm, ls_text
Long ll_find, ll_max, ll_buf, ll_upperbound
Window lw_window
/* FREE Memory Check */
IF of_mem_chk() = Cret.FAILURE Then Return
ls_window = Upper(as_window)
ll_find = ids_buffer.Find("window_nm='" + ls_window + "'", 1, ids_buffer.Rowcount())
IF ll_find < 1 Then
IF ids_Buffer.RowCount() > cConfig.Menu_Max Then
MessageBox("알림", "메뉴창의 갯수가 많습니다." + '~r~n' + '창을 닫아 주십시요', StopSign!)
Return
End IF
//Choose Change & OpenSheet [Create]
IF OpenSheet(lw_window, as_window, gw_main, 8, Original!) <> 1 Then Return
ii_open_menu ++
ls_s_nm = S_P + String(ii_open_menu)
ls_c_nm = C_P + String(ii_open_menu)
ls_e_nm = E_P + String(ii_open_menu)
ls_text = M_TEXT + String(ii_open_menu)
ll_max = of_max_position()
ls_title = of_window_title(ls_window)
//Buffer ADD
ids_Buffer.InsertRow(1)
ids_Buffer.Object.Window_nm[1] = ls_window
ids_Buffer.Object.Seq[1] = ii_open_menu
ids_Buffer.Object.P_s_NM[1] = ls_s_nm
ids_Buffer.Object.P_c_NM[1] = ls_c_nm
ids_Buffer.Object.P_e_NM[1] = ls_e_nm
ids_Buffer.Object.T_NM[1] = ls_text
//Tab ADD
of_add_tab(ii_open_menu, ls_title)
ids_Buffer.AcceptText()
lw_window.Title = ls_title
ll_upperbound = UpperBound(lstr_window[]) + 1
lstr_window[ll_upperbound].window_name = as_window
lstr_window[ll_upperbound].window_get = lw_window
Else
//Buffer Change
ll_buf = ids_buffer.Find("set_yn='Y'", 1, ids_buffer.Rowcount())
If ll_buf > 0 Then
ids_buffer.Object.Set_Yn[ll_buf] = 'N'
Else
ll_buf = 0
End IF
//Choose Change
ids_Buffer.Object.set_yn[ll_find] = 'Y'
of_select_tab_color(ll_buf, ll_find)
//Open [select]
of_select_tab()
Long ll_ps
ll_ps = Long(ids_buffer.Object.p_s[ll_find])
dw_top.Object.DataWindow.HorizontalScrollPosition = ll_ps
lw_window = of_window_find(as_window)
End IF
lw_window.Dynamic Function wf_link_other()
end subroutine
protected subroutine of_scrolltotab (long al_scrollpos);/*-------------------------------------------------
함 수 명 : of_scrolltotab
개 요 : Scroll Tab Move
매개 변수 : Value Long al_scrollpos
리 턴 값 : None
작성 내역 : 2008.09.25 By JH
-------------------------------------------------*/
IF al_scrollpos > 0 AND al_scrollpos < ii_scrollmax THEN
dw_top.width = This.width - (p_mright.X + p_mright.Width + 10)
ii_scrollpos = al_scrollpos
END IF
end subroutine
protected function long of_max_position ();/*-------------------------------------------------
함 수 명 : of_max_position
개 요 : Max Position Value Return
매개 변수 : None
리 턴 값 : Long
작성 내역 : 2008.09.25 By JH
-------------------------------------------------*/
Long ll_row, ll_position
ll_row = ids_buffer.RowCount()
If ll_row < 1 Then
il_max_witdt = 0
Return 0
End IF
ids_buffer.SetSort("Seq Desc")
ids_buffer.Sort()
ll_position = ids_buffer.Object.p_e[1]
il_max_witdt = ll_position + 104
Return ll_position
end function
protected function string of_window_title (readonly string as_window);/*-------------------------------------------------
함 수 명 : of_window_title
개 요 : Window Title Return
매개 변수 : ReadOnly String as_window
리 턴 값 : String
작성 내역 : 2008.09.25 By JH
-------------------------------------------------*/
String ls_pgm_name
SELECT NVL(pgm_name, 'No Title')
INTO :ls_pgm_name
FROM prgadmin
WHERE pgm_id = :as_window;
IF SQLCA.SQLCODE <> 0 Then
Return 'No Title'
Else
Return ls_pgm_name
End IF
end function
public subroutine of_select_tab ();/*-------------------------------------------------
함 수 명 : of_select_tab
개 요 : Tab Select
매개 변수 : None
리 턴 값 : None
작성 내역 : 2008.09.25 By JH
-------------------------------------------------*/
Long ll_find
Window lw
ll_find = ids_buffer.Find("Set_yn = 'Y'", 1, ids_buffer.RowCount())
If ll_find < 1 Then Return
lw = of_window_find(ids_buffer.Object.Window_nm[ll_find])
IF IsValid(lw) OR Handle(lw) > 0 Then
Open(lw)
lw.SetFocus()
lw.width = gw_main.Dynamic wf_getwidth()
lw.Height = gw_main.Dynamic wf_getHeight()
lw.Dynamic Post Event activate()
End IF
end subroutine
public subroutine of_active_tab (string as_window);/*-------------------------------------------------
함 수 명 : of_active_tab
개 요 : Active Tab
매개 변수 : None
리 턴 값 : None
작성 내역 : 2008.09.25 By JH
-------------------------------------------------*/
Long ll_find, ll_buf
ll_find = ids_buffer.Find("window_nm = '" + Upper(as_window) + "'", 1, ids_buffer.RowCount())
If ll_find < 1 Then Return
ll_buf = ids_buffer.Find("set_yn='Y'", 1, ids_buffer.Rowcount())
If ll_buf > 0 Then ids_buffer.Object.Set_Yn[ll_buf] = 'N'
ids_buffer.Object.Set_Yn[ll_find] = 'Y'
ids_buffer.AcceptText()
of_select_tab_color(ll_buf, ll_find)
end subroutine
private subroutine of_select_tab_color (readonly long al_brow, readonly long al_row);/*-------------------------------------------------
함 수 명 : of_select_tab_color
개 요 : Object Construct Control
매개 변수 : ReadOnly Long al_brow
ReadOnly Long al_row
리 턴 값 : None
작성 내역 : 2008.09.25 By JH
-------------------------------------------------*/
IF al_brow > 0 Then dw_top.Modify(ids_buffer.Object.t_nm[al_brow] + '.font.weight="400"')
IF al_row > 0 Then dw_top.Modify(ids_buffer.Object.t_nm[al_row] + '.font.weight="700"')
end subroutine
public function window of_window_find (readonly string as_window);/*-------------------------------------------------
함 수 명 : of_window_find
개 요 : Window Find Return
매개 변수 : ReadOnly String as_window
리 턴 값 : None
작성 내역 : 2008.10.08 By JH
-------------------------------------------------*/
Window lw
Long ll_find, i, ll_upperbound
String ls_window
ids_buffer.SetFilter("" )
ids_buffer.Filter()
ls_window = Upper(as_window)
ll_find = ids_buffer.Find("window_nm='" + ls_window + "'", 1, ids_buffer.Rowcount())
If ll_find < 1 Then Return lw
ll_upperbound = upperBound(lstr_window[])
For i = 1 To ll_upperbound
IF Upper(lstr_window[i].window_name) = Upper(as_window) Then
Return lstr_window[i].window_get
Exit;
End IF
Next
Return lw
end function
public subroutine of_all_close ();/*-------------------------------------------------
함 수 명 : of_all_close
개 요 : All Sheet Close
매개 변수 : None
리 턴 값 : None
작성 내역 : 2008.10.09 By JH
-------------------------------------------------*/
Long i, ll_upperbound
Window lw
ll_upperbound = upperBound(lstr_window[])
For i = 1 To ll_upperbound
do while yield() ; loop
Try
Close( lstr_window[i].window_get )
CATCH (runtimeerror err)
End Try
Next
end subroutine
protected subroutine of_timer (readonly boolean ab_timer);/*-------------------------------------------------[Protected]
함 수 명 : of_timer
개 요 : Timer 처리
매개 변수 : ReadOnly Boolean ab_timer
리 턴 값 : None
작성 내역 : 2008.10.22 By JH
-------------------------------------------------*/
Choose Case ab_timer
Case True
This.SetTimer(Handle(this), 0, 25,0)
Case False
This.KillTimer(Handle(This), 0)
End Choose
end subroutine
public function long of_getcolumnwidth (string as_text);/*-------------------------------------------------
함 수 명 : of_GetColumnWidth
개 요 : Text String Width Return
매개 변수 : Value String as_text
리 턴 값 : Long
작성 내역 : 2008.09.10 By JH
-------------------------------------------------*/
constant integer WM_GETFONT = 49 // hex 0x0031
Long ll_len
Integer li_err = 0
Long ll_hFont, ll_hOldfont, ll_hDC, ll_handle
str_size lstr_Size
ll_len = Lena(as_text) * 4
ll_hDC = GetDC(Handle(st_text))
Try
ll_hFont = CreateFont(cConfig.MENU_FONT_SIZE, 0, 0, 0, 400, 0, 0, 0, 1, 0, 0, 2, 0, cConfig.MENU_FONT)
TextOut(ll_hDC, 0, 0, as_text, Len(as_text))
If Not GetTextExtentpoint32(ll_hDC, as_text, ll_len, lstr_Size ) Then
lstr_Size.cx = -1
End If
DeleteObject(ll_hFont)
ReleaseDC(Handle(Parent), ll_hDC)
Catch (runtimeerror err)
lstr_Size.cx = Lena(Trim(as_text)) * 32
END TRY
lstr_Size.Cx = lstr_Size.Cx + 20
Return lstr_Size.cx
end function
private subroutine of_add_tab (readonly integer ai_menu, readonly string as_title);/*-------------------------------------------------
함 수 명 : of_add_tab
개 요 : Tab Page ADD
매개 변수 : ReadOnly Integer ai_menu
ReadOnly String as_title
리 턴 값 : None
작성 내역 : 2008.09.25 By JH
-------------------------------------------------*/
String ls_modi
Long ll_x, ll_width
dw_top.SetReDraw(False)
ll_width = of_GetColumnWidth(as_title)
ll_x = il_max_witdt
ls_modi = 'Create bitmap(band=detail filename=".\img\tab_s.gif" x="' + String(ll_x) + '" y="0" height="104" width="59" border="0" '
ls_modi += 'name=' + S_P + String(ai_menu) + ' visible="1" )'
dw_top.Modify(ls_modi)
ids_Buffer.Object.p_s[1] = ll_x
ll_x = ll_x + 59
ls_modi = 'Create bitmap(band=detail filename=".\img\tab_c.gif" x="' + String(ll_x) + '" y="0" height="104" width="' + String(ll_width + 10) + '" border="0" '
ls_modi += 'name=' + C_P + String(ai_menu) + ' visible="1" )'
dw_top.Modify(ls_modi)
ids_Buffer.Object.p_c[1] = ll_x
ls_modi = 'Create text(band=detail alignment="0" text="' + as_title + '" border="0" color="33554432" x="' + String(ll_x) + '" y="40" height="52" width="' + String(ll_width) + '" '
ls_modi += 'html.valueishtml="0" name=t_m' + String(ai_menu) + ' visible="1" font.face="굴림체" font.height="-8" font.weight="400" font.family="1" '
ls_modi += 'font.pitch="1" font.charset="129" background.mode="1" background.color="553648127" )'
dw_top.Modify(ls_modi)
ll_x = ll_x + ll_width
ls_modi = 'Create bitmap(band=detail filename=".\img\tab_e.gif" x="' + String(ll_x) + '" y="0" height="104" width="119" border="0" '
ls_modi += 'name=' + E_P + String(ai_menu) + ' pointer="HyperLink!" visible="1" )'
dw_top.Modify(ls_modi)
ids_Buffer.Object.p_e[1] = ll_x
il_max_witdt = ll_x + 104
ids_Buffer.Object.text_width[1] = ll_width
Long ll_width2
ll_width2 = dw_top.Width
dw_top.Width = 1
dw_top.Width = ll_width2
dw_top.SetReDraw(True)
dw_top.SetPosition(E_P + String(ai_menu), "detail", True )
dw_top.SetPosition('t_m' + String(ai_menu), "detail", True )
dw_top.Object.DataWindow.HorizontalScrollPosition = Long(dw_top.Describe("DataWindow.HorizontalScrollMaximum "))
end subroutine
public subroutine of_close_win (string as_win);/*-------------------------------------------------
함 수 명 : of_close_win
개 요 : Close_window
매개 변수 : Value String as_win
리 턴 값 : None
작성 내역 : 2008.11.06 By JH
-------------------------------------------------*/
Long ll_find
String ls_title
Integer li_menu
Window lw
ll_find = ids_buffer.Find("window_nm='" + Upper(as_win) + "'", 1, ids_buffer.Rowcount())
IF ll_find < 1 Then Return
ls_title = ids_buffer.Object.Window_nm[ll_find]
li_menu = ids_buffer.Object.Seq[ll_find]
lw = of_window_find(ls_title)
IF IsValid(lw) And Handle(lw) > 0 Then
IF close(lw) = 1 Then
lw = of_window_find(ls_title)
IF IsValid(lw) And Handle(lw) > 0 Then Return
of_close_menu(ll_find)
End IF
End IF
end subroutine
public function integer of_mem_chk ();/*-------------------------------------------------
함 수 명 : of_mem_chk
개 요 : Free Memory Check
매개 변수 : None
리 턴 값 : Integer
작성 내역 : 2008.10.31 By JH
-------------------------------------------------*/
memory sysmem
Constant Long Conv_GB = (1024 * 1024 * 1024)
GlobalMemoryStatus(sysmem)
/* sysmem.m_length 메모리 길이
sysmem.m_loaded 로드 메모리
sysmem.m_totalphys 전체 메모리
sysmem.m_totalpagefile 사용가능한 전체 메모리
sysmem.m_availphys 전체 사용가능 메모리
sysmem.m_availpagefile 전체 페이지 사이즈
sysmem.m_totalvirtual 전체 가상 메모리
sysmem.m_availvirtual 사용가능한 가상 메모리 */
IF sysmem.m_loaded > cConfig.Memory Then
MessageBox("경고", "전체 메모리 : " + String(sysmem.m_totalphys / Conv_GB, '#.##') + "GB 중 " + &
String(sysmem.m_loaded) + "% 가 현재 사용 중입니다." + '~r' + &
"메모리 용량을 확보하시기 바립니다.", StopSign!)
Return Cret.FAILURE
End IF
Return Cret.SUCCESS
end function
public subroutine of_active_sheet ();/*-------------------------------------------------
함 수 명 : of_active_sheet
개 요 : Active Sheet Resize
매개 변수 : None
리 턴 값 : String
작성 내역 : 2008.10.31 By JH
-------------------------------------------------*/
Long ll_find
Window lw
IF Not IsValid(ids_buffer) Then Return
ll_find = ids_buffer.Find("Set_yn = 'Y'", 1, ids_buffer.RowCount())
If ll_find < 1 Then Return
lw = of_window_find(ids_buffer.Object.Window_nm[ll_find])
IF IsValid(lw) And Handle(lw) > 0 Then
lw.width = gw_main.Dynamic wf_getwidth()
lw.Height = gw_main.Dynamic wf_getHeight()
End IF
end subroutine
private subroutine of_close_menu (readonly long ai_menu);/*-------------------------------------------------
함 수 명 : of_close_menu
개 요 : Menu Close
매개 변수 : ReadOnly Long ai_menu
리 턴 값 : None
작성 내역 : 2008.09.25 By JH
-------------------------------------------------*/
Long ll_find, ll_row, i, ll_x, li_seq, ll_text_width, ll_seq
String ls_set_yn, ls_col, ls_window, ls_des_obj[4]
ll_find = ai_menu
If ll_find < 1 Then Return
ls_des_obj[1] = ids_buffer.Object.P_s_nm[ll_find]
ls_des_obj[2] = ids_buffer.Object.P_c_nm[ll_find]
ls_des_obj[3] = ids_buffer.Object.P_e_nm[ll_find]
ls_des_obj[4] = ids_buffer.Object.T_nm[ll_find]
ll_seq = ids_buffer.Object.Seq[ll_find]
ls_set_yn = ids_buffer.Object.Set_YN[ll_find]
ls_window = ids_Buffer.Object.Window_nm[ll_find]
ll_x = ids_buffer.Object.text_width[ll_find] + 59 + 104
ids_buffer.DeleteRow(ll_find)
ids_buffer.AcceptText()
ids_buffer.SetFilter("seq>" + String(ll_seq) )
ids_buffer.Filter()
ll_row = ids_buffer.RowCount()
ids_buffer.SetSort("seq A")
ids_buffer.Sort()
dw_top.SetRedraw(False)
dw_top.Modify("Destroy " + ls_des_obj[1])
dw_top.Modify("Destroy " + ls_des_obj[2])
dw_top.Modify("Destroy " + ls_des_obj[3])
dw_top.Modify("Destroy " + ls_des_obj[4])
For i = 1 To ll_row
do while yield() ; loop
li_seq = ids_buffer.Object.Seq[i]
ids_buffer.Object.Seq[i] = li_seq - 1
ids_buffer.Object.p_s[i] = ids_buffer.Object.p_s[i] - ll_x
ids_buffer.Object.p_c[i] = ids_buffer.Object.p_c[i] - ll_x
ids_buffer.Object.p_e[i] = ids_buffer.Object.p_e[i] - ll_x
ids_buffer.AcceptText()
ls_col = ids_buffer.Object.p_s_nm[i]
dw_top.Modify(ls_col + '.x="' + String(ids_buffer.Object.p_s[i] ) + '" ')
dw_top.SetPosition(ls_col, "detail", True)
ls_col = ids_buffer.Object.p_c_nm[i]
dw_top.Modify(ls_col + '.x="' + String(ids_buffer.Object.p_c[i]) + '" ')
dw_top.SetPosition(ls_col, "detail", True)
ls_col = ids_buffer.Object.p_e_nm[i]
dw_top.Modify(ls_col + '.x="' + String(ids_buffer.Object.p_e[i]) + '" ')
dw_top.SetPosition(ls_col, "detail", True)
ls_col = ids_buffer.Object.t_nm[i]
dw_top.Modify(ls_col + '.x="' + String(ids_buffer.Object.p_c[i]) + '" ')
dw_top.SetPosition(ls_col, "detail", True)
Next
ids_buffer.SetSort("")
ids_buffer.Sort()
ids_buffer.SetFilter("")
ids_buffer.Filter()
str_open_window_check lstr
ll_row = UpperBound(lstr_window[])
For i = 1 To ll_row
IF Not(Upper(lstr_window[i].window_name) = Upper(ls_window)) Then Continue;
lstr_window[i] = lstr
Exit;
Next
dw_top.SetRedraw(True)
of_max_position()
dw_top.Object.DataWindow.HorizontalScrollPosition = ii_scrollmax
end subroutine
on uo_top_tools.create
int iCurrent
call super::create
this.p_mright=create p_mright
this.p_right=create p_right
this.p_mleft=create p_mleft
this.p_left=create p_left
this.st_text=create st_text
this.dw_top=create dw_top
this.r_1=create r_1
iCurrent=UpperBound(this.Control)
this.Control[iCurrent+1]=this.p_mright
this.Control[iCurrent+2]=this.p_right
this.Control[iCurrent+3]=this.p_mleft
this.Control[iCurrent+4]=this.p_left
this.Control[iCurrent+5]=this.st_text
this.Control[iCurrent+6]=this.dw_top
this.Control[iCurrent+7]=this.r_1
end on
on uo_top_tools.destroy
call super::destroy
destroy(this.p_mright)
destroy(this.p_right)
destroy(this.p_mleft)
destroy(this.p_left)
destroy(this.st_text)
destroy(this.dw_top)
destroy(this.r_1)
end on
event constructor;call super::constructor;/*-------------------------------------------------------
오브젝트명 : uo_top_tools
이 벤 트 : Constructor
비 고 : 2008.09.24 By JH
-------------------------------------------------------*/
ids_buffer = Create DataStore
ids_buffer.DataObject = "d_tap_tool_buffer"
end event
type p_mright from u_p_btn within uo_top_tools
integer x = 311
integer y = 12
integer width = 96
integer height = 80
boolean originalsize = false
string picturename = "D:\JIHO\PB\N_Template\Common_Image\tool_mright.gif"
end type
event clicked;call super::clicked;/*-------------------------------------------------------
오브젝트명 : p_mright
이 벤 트 : Clicked
비 고 : 2008.10.09 By JH
-------------------------------------------------------*/
Long ll_max
ll_max = Long(dw_top.Describe("DataWindow.HorizontalScrollMaximum "))
dw_top.Object.DataWindow.HorizontalScrollPosition = ll_max
end event
event constructor;call super::constructor;/*-------------------------------------------------------
오브젝트명 : p_right
이 벤 트 : Constructor
비 고 : 2009.03.05 By JH
-------------------------------------------------------*/
SetPicture('.\Common_Image\tool_mright.gif', +&
'.\Common_Image\tool_mright_on.gif', +&
'.\Common_Image\tool_mright_on.gif', +&
'.\Common_Image\tool_mright_on.gif')
end event
type p_right from u_p_btn within uo_top_tools
integer x = 210
integer y = 12
integer width = 96
integer height = 80
boolean originalsize = false
string picturename = "D:\JIHO\PB\N_Template\Common_Image\tool_right.gif"
end type
event clicked;call super::clicked;/*-------------------------------------------------------
오브젝트명 : p_right
이 벤 트 : Clicked
비 고 : 2008.10.09 By JH
-------------------------------------------------------*/
Long ll_position, ll_max
ll_max = Long(dw_top.Describe("DataWindow.HorizontalScrollMaximum "))
ll_position = Long(dw_top.Describe("DataWindow.HorizontalScrollPosition "))
If ll_max > ll_position Then
dw_top.Object.DataWindow.HorizontalScrollPosition = ll_position + 50
End IF
end event
event ue_lbuttondown;call super::ue_lbuttondown;/*-------------------------------------------------------
오브젝트명 : p_right
이 벤 트 : ue_lbuttondown
비 고 : 2008.10.22 By JH
-------------------------------------------------------*/
ii_select_type = 2
of_timer(True)
end event
event ue_lbuttonup;call super::ue_lbuttonup;/*-------------------------------------------------------
오브젝트명 : p_right
이 벤 트 : ue_lbuttonup
비 고 : 2009.03.05 By JH
-------------------------------------------------------*/
ii_select_type = 0
of_timer(False)
end event
event constructor;call super::constructor;/*-------------------------------------------------------
오브젝트명 : p_right
이 벤 트 : Constructor
비 고 : 2009.03.05 By JH
-------------------------------------------------------*/
SetPicture('.\Common_Image\tool_right.gif', +&
'.\Common_Image\tool_right_on.gif', +&
'.\Common_Image\tool_right_on.gif', +&
'.\Common_Image\tool_right_on.gif')
end event
type p_mleft from u_p_btn within uo_top_tools
integer x = 9
integer y = 12
integer width = 96
integer height = 80
boolean originalsize = false
string picturename = "D:\JIHO\PB\N_Template\Common_Image\tool_mleft.gif"
end type
event clicked;call super::clicked;/*-------------------------------------------------------
오브젝트명 : p_mleft
이 벤 트 : Clicked
비 고 : 2008.10.09 By JH
-------------------------------------------------------*/
dw_top.Object.DataWindow.HorizontalScrollPosition = 1
end event
event constructor;call super::constructor;/*-------------------------------------------------------
오브젝트명 : p_mleft
이 벤 트 : Constructor
비 고 : 2009.03.05 By JH
-------------------------------------------------------*/
SetPicture('.\Common_Image\tool_mleft.gif', +&
'.\Common_Image\tool_mleft_on.gif', +&
'.\Common_Image\tool_mleft_on.gif', +&
'.\Common_Image\tool_mleft_on.gif')
end event
type p_left from u_p_btn within uo_top_tools
integer x = 110
integer y = 12
integer width = 96
integer height = 80
boolean originalsize = false
string picturename = ".\Common_Image\tool_left.gif"
end type
event clicked;call super::clicked;/*-------------------------------------------------------
오브젝트명 : p_left
이 벤 트 : Clicked
비 고 : 2008.10.09 By JH
-------------------------------------------------------*/
Long ll_position
ll_position = Long(dw_top.Object.DataWindow.HorizontalScrollPosition ) - 50
IF ll_position < 1 Then ll_position = 1
dw_top.Object.DataWindow.HorizontalScrollPosition = ll_position
end event
event ue_lbuttondown;call super::ue_lbuttondown;/*-------------------------------------------------------
오브젝트명 : p_left
이 벤 트 : ue_lbuttondown
비 고 : 2008.10.22 By JH
-------------------------------------------------------*/
ii_select_type = 1
of_timer(True)
end event
event ue_lbuttonup;call super::ue_lbuttonup;/*-------------------------------------------------------
오브젝트명 : p_left
이 벤 트 : ue_lbuttonup
비 고 : 2008.10.22 By JH
-------------------------------------------------------*/
ii_select_type = 0
of_timer(False)
end event
event constructor;call super::constructor;/*-------------------------------------------------------
오브젝트명 : p_left
이 벤 트 : Constructor
비 고 : 2009.03.05 By JH
-------------------------------------------------------*/
SetPicture('.\Common_Image\tool_left.gif', +&
'.\Common_Image\tool_left_on.gif', +&
'.\Common_Image\tool_left_on.gif', +&
'.\Common_Image\tool_left_on.gif')
end event
type st_text from statictext within uo_top_tools
boolean visible = false
integer x = 750
integer y = 28
integer width = 457
integer height = 52
integer textsize = -10
integer weight = 400
fontcharset fontcharset = hangeul!
fontpitch fontpitch = fixed!
fontfamily fontfamily = modern!
string facename = "굴림체"
long textcolor = 33554432
long backcolor = 67108864
boolean enabled = false
string text = "none"
boolean focusrectangle = false
end type
type dw_top from datawindow within uo_top_tools
integer x = 421
integer width = 1938
integer height = 108
integer taborder = 10
string dataobject = "dw_tap_tools"
boolean border = false
end type
event constructor;/*-------------------------------------------------------
오브젝트명 : dw_top
이 벤 트 : Constructor
비 고 : 2008.09.25 By JH
-------------------------------------------------------*/
InsertRow(1)
end event
event clicked;/*-------------------------------------------------------
오브젝트명 : dw_top
이 벤 트 : Clicked
비 고 : 2008.09.25 By JH
-------------------------------------------------------*/
Integer li_menu
String ls_title, ls_name
Long ll_find, ll_buf
window lw
IF Row < 1 Then Return
ls_name = dwo.name
IF Upper(ls_name) = 'DATAWINDOW' Then Return
IF Left(ls_name, Len(E_P)) = E_P Then
ll_find = ids_buffer.Find("p_e_nm='" + ls_name + "'", 1, ids_buffer.Rowcount())
IF ll_find < 1 Then Return
Try
ls_title = ids_buffer.GetItemString(ll_find, 'window_nm')
li_menu = ids_buffer.GetItemNumber(ll_find, 'seq')
Catch (runtimeerror err)
Return
End Try
lw = of_window_find(ls_title)
IF IsValid(lw) And Handle(lw) > 0 Then
IF close(lw) = 1 Then
lw = of_window_find(ls_title)
IF IsValid(lw) And Handle(lw) > 0 Then Return
of_close_menu(ll_find)
End IF
End IF
Return
End IF
IF Left(ls_name, Len(S_P)) =S_P Then
ll_find = ids_buffer.Find("p_s_nm='" + ls_name + "'", 1, ids_buffer.Rowcount())
ElseIF Left(ls_name, Len(C_P)) = C_P Then
ll_find = ids_buffer.Find("p_c_nm='" + ls_name + "'", 1, ids_buffer.Rowcount())
ElseIF Left(ls_name, Len(E_P)) = E_P Then
ll_find = ids_buffer.Find("p_e_nm='" + ls_name + "'", 1, ids_buffer.Rowcount())
ElseIF Left(ls_name, Len(M_TEXT)) = M_TEXT Then
ll_find = ids_buffer.Find("t_nm='" + ls_name + "'", 1, ids_buffer.Rowcount())
Else
Return
End IF
IF ll_find < 0 Then Return
ll_buf = ids_buffer.Find("set_yn='Y'", 1, ids_buffer.Rowcount())
If ll_buf > 0 Then ids_buffer.Object.Set_Yn[ll_buf] = 'N'
ids_Buffer.Object.set_yn[ll_find] = 'Y'
ids_Buffer.AcceptText()
of_select_tab()
of_select_tab_color(ll_buf, ll_find)
end event
type r_1 from rectangle within uo_top_tools
long linecolor = 33554432
integer linethickness = 4
long fillcolor = 1073741824
integer y = 4
integer width = 416
integer height = 96
end type
다음검색