Histórico da Página
CONTEÚDO
- Visão Geral
- Procedures do Include ut-4gltreeview.i (facilitador)
- Procedures e Funções do Componente
- Exemplo de Utilização
- Dicas de Conversão do OCX para o utl4gltreeview
- Telas do TreeView
- Documentação Complementar do Componente
01. VISÃO GERAL Âncora visao_geral visao_geral
visao_geral | |
visao_geral |
Este componente 4glTreeView, feito em progress, tem como objetivo substituir o componente TreeView fornecido pela Microsoft (mscomctrl.ocx), pois este OCX não possui compatibilidade com o OpenEdge 64Bits.
...
Segue abaixo uma tabela com algumas dicas para facilitar o processo de conversão dos programas que atualmente utilizar o TreeView OCX.
Processo | OCX | 4glTreeView |
---|---|---|
Definição de Variáveis | define variable chTreeView as com-handle no-undo. DEFINE VARIABLE CtrlFrame AS WIDGET-HANDLE NO-UNDO. | // Definições Treeview {utp/ut-4gltreeview.i} |
Carregar o Treeview | PROCEDURE control_load : | RUN carregaTreeView. |
Posicionar a Treeview na tela | CREATE CONTROL-FRAME CtrlFrame ASSIGN FRAME = FRAME fpage0:HANDLE ROW = 2.46 COLUMN = 1 HEIGHT = 13.5 WIDTH = 31 HIDDEN = no SENSITIVE = yes. | RUN repositionObject IN h-4gltreeview (2.46, 1.00). RUN resizeObject IN h-4gltreeview ( 13.5, 31.00). |
Menu Popup | define variable pop-menu as widget-handle no-undo. create menu pop-menu CtrlFrame:popup-menu = pop-menu | PROCEDURE pi-CtrlPopupTreeview : .... END PROCEDURE. |
Jogar o foco para o TreeView | APPLY "Entry":U TO CtrlFrame. | |
Apagar os nós do TreeView | ChTreeView:Nodes:Clear(). | RUN emptyTree IN h-4gltreeview. |
Expandir o nós e filhos | do i-cont = 1 to chTreeView:Nodes:Count: assign chTreeView:Nodes(i-cont):Expanded = l-expande. end. | RUN expandBranch IN h-4gltreeview (c-codigo-node). RUN pi-atualizaTreeview. |
Seleciontar um nó | assign chTreeView:SelectedItem = chTreeView:Nodes(1). if not error-status:error then | |
Verificar se existem nós | IF chTreeView:Nodes:COUNT > 0 THEN DO: RUN piExcel IN THIS-PROCEDURE. END. | IF DYNAMIC-FUNCTION('hasNodes' IN h-4gltreeview) THEN DO: RUN piExcel IN THIS-PROCEDURE. END. APPLY "ENTRY":U TO btExcel IN FRAME fPage0. |
Verificar se o nó está expandido | assign exp-con:label = if chTreeView:SelectedItem:Expanded = false then cExpande | |
Pegar a chave do nó selecionado | c-tag-tree = chTreeView:SelectedItem:key(). | assign rRow = to-rowid(c-codigo-node). |
Monitorar o evento de click | PROCEDURE CtrlFrame.TreeView.NodeClick : ... END PROCEDURE. | PROCEDURE pi-ClickTreeView : .... END PROCEDURE. |
Incluir um nó | chTreeView:Nodes:Add (,, "i" + string(i-cont), string(ttDados.cod-oficial) + " - " + ttDados.desc-dimensao, i-img) . | RUN pi-create-node (cNodeId, cNodeIdPai, string(ttDados.cod-oficial) + " - " + ttDados.desc-dimensao, cImage, "") NO-ERROR. |
Gravar e recuperar a TAG | assign chTreeView:Nodes:Item ("i" + string(i-cont)):Tag = string(rowid(ttDados)) + ",1," + string(ttDados.r-rowid). assign rRowid = to-rowid(entry(1,chTreeView:SelectedItem:Tag)). | DYNAMIC-FUNCTION('setNodeTag' IN h-4gltreeview, cNodeId, ttDados.p-image). assign rRow = to-rowid(entry(1,DYNAMIC-FUNCTION('getNodeTag' IN h-4gltreeview, c-codigo-node))). |
Criar um relacionamento entre a TreeView e a TempTable de Negócio | assign rRow = to-rowid(entry(1,chTreeView:SelectedItem:Tag)) | assign rRow = to-rowid(c-codigo-node). |
Definir a imagem do nó |
06. TELAS DO TREEVIEW
07. DOCUMENTAÇÃO COMPLEMENTAR DO COMPONENTE
...