Commit 8209f16a authored by Sandro Camata Santana's avatar Sandro Camata Santana

Ajustes

parent 29d6d4f7
object ExplorerV2: TExplorerV2
Left = 523
Height = 871
Top = 77
Width = 1387
Left = -1230
Height = 697
Top = 112
Width = 1110
Caption = 'Model OQL Query'
ClientHeight = 871
ClientWidth = 1387
ClientHeight = 697
ClientWidth = 1110
Color = clWindow
DesignTimePPI = 120
Font.Color = clWindowText
Icon.Data = {
96A5050000000100060000000000010020002820040066000000101000000100
......@@ -11585,42 +11584,42 @@ object ExplorerV2: TExplorerV2
ShowInTaskBar = stAlways
LCLVersion = '2.0.10.0'
object splVertical: TSplitter
Left = 450
Height = 871
Left = 360
Height = 697
Top = 0
Width = 6
Width = 5
MinSize = 5
ResizeStyle = rsPattern
end
object pnlEditor: TPanel
Left = 456
Height = 871
Left = 365
Height = 697
Top = 0
Width = 931
Width = 745
Align = alClient
BevelOuter = bvNone
ClientHeight = 871
ClientWidth = 931
ClientHeight = 697
ClientWidth = 745
Font.Color = clWindowText
ParentFont = False
TabOrder = 0
object pnlResult: TPanel
Left = 0
Height = 231
Top = 611
Width = 931
Height = 185
Top = 489
Width = 745
Align = alBottom
BevelOuter = bvNone
ClientHeight = 231
ClientWidth = 931
ClientHeight = 185
ClientWidth = 745
Font.Color = clWindowText
ParentFont = False
TabOrder = 0
object pcResults: TPageControl
Left = 0
Height = 231
Height = 185
Top = 0
Width = 931
Width = 745
ActivePage = tsError
Align = alClient
Font.Color = clWindowText
......@@ -11696,16 +11695,16 @@ object ExplorerV2: TExplorerV2
end
object tsError: TTabSheet
Caption = 'tsError'
ClientHeight = 223
ClientWidth = 923
ClientHeight = 177
ClientWidth = 737
Font.Color = clWindowText
ImageIndex = 1
ParentFont = False
object memErrorText: TMemo
Left = 0
Height = 223
Height = 177
Top = 0
Width = 923
Width = 737
Align = alClient
BorderStyle = bsNone
Font.Color = clWindowText
......@@ -11720,9 +11719,9 @@ object ExplorerV2: TExplorerV2
end
object pcEditor: TPageControl
Left = 0
Height = 545
Top = 60
Width = 475
Height = 436
Top = 48
Width = 380
ActivePage = tsOQL
Align = alClient
Font.Color = clWindowText
......@@ -11734,27 +11733,29 @@ object ExplorerV2: TExplorerV2
Options = [nboMultiLine]
object tsOQL: TTabSheet
Caption = 'OQL - Object Query Language'
ClientHeight = 512
ClientWidth = 467
ClientHeight = 408
ClientWidth = 372
Font.Color = clWindowText
ParentFont = False
inline SynEditOQL: TSynEdit
Left = 0
Height = 512
Height = 408
Top = 0
Width = 467
Width = 372
Align = alClient
Font.Height = -16
Font.Height = -13
Font.Name = 'Courier New'
Font.Pitch = fpFixed
Font.Quality = fqNonAntialiased
ParentColor = False
ParentFont = False
TabOrder = 0
OnDragDrop = memOQLQuery2DragDrop
OnDragOver = memOQLQuery2DragOver
OnKeyUp = SynEditOQLKeyUp
OnUTF8KeyPress = SynEditOQLUTF8KeyPress
BorderStyle = bsNone
Gutter.Width = 42
Gutter.Width = 23
Gutter.MouseActions = <>
RightGutter.Width = 0
RightGutter.MouseActions = <>
......@@ -12213,12 +12214,12 @@ object ExplorerV2: TExplorerV2
OnCommandProcessed = SynEditOQLCommandProcessed
inline SynLeftGutterPartList1: TSynGutterPartList
object SynGutterMarks1: TSynGutterMarks
Width = 30
Width = 24
Visible = False
MouseActions = <>
end
object SynGutterLineNumber1: TSynGutterLineNumber
Width = 21
Width = 17
MouseActions = <>
MarkupInfo.Background = clBtnFace
MarkupInfo.Foreground = clNone
......@@ -12228,19 +12229,18 @@ object ExplorerV2: TExplorerV2
LeadingZeros = False
end
object SynGutterChanges1: TSynGutterChanges
Width = 5
Width = 4
MouseActions = <>
ModifiedColor = 59900
SavedColor = clGreen
end
object SynGutterSeparator1: TSynGutterSeparator
Width = 3
Width = 2
MouseActions = <>
MarkupInfo.Background = clWhite
MarkupInfo.Foreground = clGray
end
object SynGutterCodeFolding1: TSynGutterCodeFolding
Width = 13
Visible = False
MouseActions = <>
MarkupInfo.Background = clNone
......@@ -12263,7 +12263,7 @@ object ExplorerV2: TExplorerV2
Top = 0
Width = 467
Align = alClient
Font.Height = -16
Font.Height = -13
Font.Name = 'Courier New'
Font.Pitch = fpFixed
Font.Quality = fqNonAntialiased
......@@ -12271,7 +12271,7 @@ object ExplorerV2: TExplorerV2
ParentFont = False
TabOrder = 0
BorderStyle = bsNone
Gutter.Width = 42
Gutter.Width = 23
Gutter.MouseActions = <>
RightGutter.Width = 0
RightGutter.MouseActions = <>
......@@ -12730,12 +12730,12 @@ object ExplorerV2: TExplorerV2
LineHighlightColor.Foreground = clNone
inline SynLeftGutterPartList1: TSynGutterPartList
object SynGutterMarks1: TSynGutterMarks
Width = 30
Width = 24
Visible = False
MouseActions = <>
end
object SynGutterLineNumber1: TSynGutterLineNumber
Width = 21
Width = 17
MouseActions = <>
MarkupInfo.Background = clBtnFace
MarkupInfo.Foreground = clNone
......@@ -12745,19 +12745,18 @@ object ExplorerV2: TExplorerV2
LeadingZeros = False
end
object SynGutterChanges1: TSynGutterChanges
Width = 5
Width = 4
MouseActions = <>
ModifiedColor = 59900
SavedColor = clGreen
end
object SynGutterSeparator1: TSynGutterSeparator
Width = 3
Width = 2
MouseActions = <>
MarkupInfo.Background = clWhite
MarkupInfo.Foreground = clGray
end
object SynGutterCodeFolding1: TSynGutterCodeFolding
Width = 13
Visible = False
MouseActions = <>
MarkupInfo.Background = clNone
......@@ -12771,24 +12770,24 @@ object ExplorerV2: TExplorerV2
end
object pnlActionBar: TPanel
Left = 0
Height = 60
Height = 48
Top = 0
Width = 931
Width = 745
Align = alTop
AutoSize = True
BevelOuter = bvNone
ClientHeight = 60
ClientWidth = 931
ClientHeight = 48
ClientWidth = 745
Font.Color = clWindowText
ParentFont = False
TabOrder = 2
object ToolBar1: TToolBar
Left = 0
Height = 60
Height = 48
Top = 0
Width = 931
ButtonHeight = 50
ButtonWidth = 62
Width = 745
ButtonHeight = 40
ButtonWidth = 50
Caption = 'ToolBar1'
Color = clBtnFace
Font.Color = clWindowText
......@@ -12798,41 +12797,41 @@ object ExplorerV2: TExplorerV2
ShowCaptions = True
TabOrder = 0
object ToolButton1: TToolButton
Left = 68
Left = 55
Top = 2
Action = actModelPanel
end
object ToolButton2: TToolButton
Left = 130
Left = 105
Top = 2
Action = actResultsPanel
end
object ToolButton3: TToolButton
Left = 63
Height = 50
Left = 51
Height = 40
Top = 2
Caption = 'ToolButton3'
Style = tbsDivider
end
object ToolButton4: TToolButton
Left = 197
Left = 159
Top = 2
Action = actExecute
end
object ToolButton5: TToolButton
Left = 259
Left = 209
Top = 2
Action = actCancel
end
object ToolButton6: TToolButton
Left = 321
Height = 50
Left = 259
Height = 40
Top = 2
Caption = 'ToolButton6'
Style = tbsDivider
end
object ToolButton7: TToolButton
Left = 326
Left = 263
Top = 2
Action = OQLQuery
AutoSize = True
......@@ -12840,7 +12839,7 @@ object ExplorerV2: TExplorerV2
Style = tbsCheck
end
object ToolButton8: TToolButton
Left = 414
Left = 336
Top = 2
Action = XMLQuery
Grouped = True
......@@ -12852,8 +12851,8 @@ object ExplorerV2: TExplorerV2
Action = ReconnectDB
end
object ToolButton10: TToolButton
Left = 192
Height = 50
Left = 155
Height = 40
Top = 2
Caption = 'ToolButton10'
Style = tbsDivider
......@@ -12861,32 +12860,30 @@ object ExplorerV2: TExplorerV2
end
end
object spResultObject: TSplitter
Left = 475
Height = 545
Top = 60
Width = 6
Left = 380
Height = 436
Top = 48
Width = 5
Align = alRight
ResizeAnchor = akRight
ResizeStyle = rsPattern
end
inline OQLObjects: TObjectExplorer
Left = 481
Height = 545
Top = 60
Width = 450
Left = 385
Height = 436
Top = 48
Width = 360
Align = alRight
ClientHeight = 545
ClientWidth = 450
ClientHeight = 436
ClientWidth = 360
TabOrder = 4
Visible = False
DesignLeft = 3089
DesignTop = 631
inherited tvExplorer: TTreeView
Height = 545
Width = 450
ExpandSignSize = 14
Height = 436
Width = 360
ExpandSignSize = 11
Images = ilModel
Indent = 28
Indent = 22
ParentColor = True
PopupMenu = pmCopiar
RightClickSelect = True
......@@ -12896,33 +12893,33 @@ object ExplorerV2: TExplorerV2
object spResultXML: TSplitter
Cursor = crVSplit
Left = 0
Height = 6
Top = 605
Width = 931
Height = 5
Top = 484
Width = 745
Align = alBottom
ResizeAnchor = akBottom
ResizeStyle = rsPattern
end
object sbStatusBar: TStatusBar
Left = 0
Height = 29
Top = 842
Width = 931
Height = 23
Top = 674
Width = 745
AutoSize = False
Font.Color = clWindowText
Panels = <
item
Width = 500
Width = 400
end
item
Width = 188
Width = 150
end
item
Width = 125
Width = 100
end
item
Alignment = taRightJustify
Width = 375
Width = 300
end>
ParentFont = False
SimplePanel = False
......@@ -12930,33 +12927,33 @@ object ExplorerV2: TExplorerV2
end
object pnlModel: TPanel
Left = 0
Height = 871
Height = 697
Top = 0
Width = 450
Width = 360
Align = alLeft
BevelOuter = bvNone
ClientHeight = 871
ClientWidth = 450
ClientHeight = 697
ClientWidth = 360
Font.Color = clWindowText
ParentFont = False
TabOrder = 1
object tvModelExplorer: TTreeView
Left = 0
Height = 751
Top = 120
Width = 450
Height = 601
Top = 96
Width = 360
Align = alClient
BorderStyle = bsNone
DragMode = dmAutomatic
ExpandSignSize = 12
ExpandSignSize = 10
Font.CharSet = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -15
Font.Height = -12
Font.Name = 'Segoe UI'
Font.Pitch = fpVariable
Font.Quality = fqDraft
Images = ilModel
Indent = 22
Indent = 18
ParentColor = True
ParentFont = False
ReadOnly = True
......@@ -12969,67 +12966,85 @@ object ExplorerV2: TExplorerV2
end
object pnFiltroClasse: TPanel
Left = 0
Height = 120
Height = 96
Top = 0
Width = 450
Width = 360
Align = alTop
ClientHeight = 120
ClientWidth = 450
ClientHeight = 96
ClientWidth = 360
Font.Color = clWindowText
ParentFont = False
TabOrder = 1
object edtClasse: TEdit
Left = 11
Height = 28
Top = 83
Width = 419
Left = 9
Height = 23
Top = 66
Width = 335
Font.Color = clWindowText
OnChange = edtClasseChange
ParentFont = False
TabOrder = 0
end
object gbAgrupamento: TGroupBox
Left = 11
Height = 56
Top = 3
Width = 419
Left = 9
Height = 45
Top = 2
Width = 335
Caption = 'Group'
ClientHeight = 31
ClientWidth = 415
ClientHeight = 25
ClientWidth = 331
Font.CharSet = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -15
Font.Height = -12
Font.Name = 'Segoe UI'
Font.Pitch = fpVariable
Font.Quality = fqDraft
ParentFont = False
TabOrder = 1
object rbHieraquia: TRadioButton
Left = 200
Height = 24
Left = 160
Height = 19
Top = 0
Width = 87
Width = 71
Caption = 'Hierarchy'
Font.CharSet = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -12
Font.Name = 'Segoe UI'
Font.Pitch = fpVariable
Font.Quality = fqDraft
OnClick = edtClasseChange
ParentFont = False
TabOrder = 0
end
object rbSequencial: TRadioButton
Left = 16
Height = 24
Left = 13
Height = 19
Top = 0
Width = 48
Width = 39
Caption = 'Flat'
Checked = True
Font.CharSet = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -12
Font.Name = 'Segoe UI'
Font.Pitch = fpVariable
Font.Quality = fqDraft
OnClick = edtClasseChange
ParentFont = False
TabOrder = 1
TabStop = True
end
end
object Label2: TLabel
Left = 15
Height = 20
Top = 61
Width = 33
Left = 12
Height = 15
Top = 49
Width = 27
Caption = 'Class'
Font.CharSet = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -15
Font.Height = -12
Font.Name = 'Segoe UI'
Font.Pitch = fpVariable
Font.Quality = fqDraft
......@@ -13041,8 +13056,8 @@ object ExplorerV2: TExplorerV2
object il1: TImageList
Height = 24
Width = 24
Left = 1190
Top = 10
Left = 952
Top = 8
Bitmap = {
4C690C0000001800000018000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
......@@ -13912,16 +13927,16 @@ object ExplorerV2: TExplorerV2
}
end
object pmCopiar: TPopupMenu
Left = 1190
Top = 110
Left = 952
Top = 88
object Copia: TMenuItem
Caption = 'Copiar Dados'
OnClick = CopiaDadosObjeto
end
end
object ActionList1: TActionList
Left = 1300
Top = 110
Left = 1040
Top = 88
object actModelPanel: TAction
Checked = True
Hint = 'Show/Hide Persistence Model'
......@@ -13965,12 +13980,12 @@ object ExplorerV2: TExplorerV2
DefaultFilter = 'Arquivos SQL (*.sql)|*.sql'
Enabled = False
SQLDialect = sqlSybase
Left = 1400
Top = 10
Left = 1120
Top = 8
end
object ilModel: TImageList
Left = 140
Top = 210
Left = 112
Top = 168
Bitmap = {
4C69090000001000000010000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
......
......@@ -2224,17 +2224,39 @@ begin
end;
procedure TExplorerV2.memOQLQuery2DragDrop(Sender, Source: TObject; X,Y: Integer);
function FromClause(piNode: TTreeNode; var poPath: string): string;
function IsRoot(piNode: TTreeNode): Boolean;
begin
if piNode.Level = 1
if (piNode.Level > 1) then
begin
if ((TObject(piNode.Data) is acClassTicket) and (piNode.ImageIndex = 6))
then Result := IsRoot(piNode.Parent)
else Result := False;
end
else Result := True;
end;
function FromClause(piNode: TTreeNode; piCast:String; var poPath: string): string;
begin
if IsRoot(piNode) //((piNode.Level = 1) or ((TObject(piNode.Data) is acClassTicket) and (piNode.ImageIndex = 6)))
then begin
poPath := acClassTicket(piNode.Data).PersistentObjectClassName;
result := poPath;
end
else begin
result := FromClause(piNode.Parent, poPath);
poPath := poPath + '.' + copy(piNode.Text, 1, pred(pos(':', piNode.Text)));
result := result + ', ' + #13#10 + ' ' + poPath;
if ((TObject(piNode.Data) is acClassTicket) and (piNode.ImageIndex = 6)) then
begin
if piCast <> ''
then result := FromClause(piNode.Parent, piCast, poPath)
else result := FromClause(piNode.Parent, acClassTicket(piNode.Data).PersistentObjectClassName, poPath);
end
else
begin
result := FromClause(piNode.Parent, '', poPath);
poPath := poPath + '.' + copy(piNode.Text, 1, pred(pos(':', piNode.Text)));
if piCast <> ''
then result := result + ', ' + #13#10 + ' ' + '('+ piCast +')' + poPath
else result := result + ', ' + #13#10 + ' ' + poPath;
end;
end;
end;
var lCaption: string;
......@@ -2260,7 +2282,7 @@ begin
if GetKeyState(VK_CONTROL) < 0
then begin
lCaption := (TObject(lNode.Parent.data) as acClassTicket).PersistentObjectClassName;
lFrom := FromClause(lNode.Parent, lPath);
lFrom := FromClause(lNode.Parent, '', lPath);
lSelect := copy(lPath, 1, pred(pos('.', lPath)));
if lSelect = '' then lSelect := lPath;
SynEditOQL.SelText := #13#10 +
......@@ -2347,16 +2369,22 @@ begin
end;
end;
end;
fLastExecErrorFlag := False;
sbStatusBar.Panels[0].Text := '';
sbStatusBar.Panels[1].Text := '';
sbStatusBar.Panels[2].Text := '';
if actResultsPanel.Checked then actResultsPanel.Execute;
except
on e: Exception do
begin
if not actResultsPanel.Checked then actResultsPanel.Execute;
fLastExecErrorFlag := True;
memErrorText.Text := e.Message;
pcResults.ActivePageIndex := 1;
pcEditor.ActivePageIndex := 0;
sbStatusBar.Panels[0].Text := 'OQL translation to SQL failed.';
sbStatusBar.Panels[1].Text := '';
sbStatusBar.Panels[2].Text := '';
if not actResultsPanel.Checked then actResultsPanel.Execute;
end;
end;
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment