Skip to content

Commit

Permalink
update for issues #24
Browse files Browse the repository at this point in the history
update for #24 and
settings dialog short freezing problem
  • Loading branch information
Jun committed Mar 31, 2017
1 parent 7a66a43 commit decd4d6
Show file tree
Hide file tree
Showing 6 changed files with 148 additions and 169 deletions.
130 changes: 64 additions & 66 deletions frmMSAAV.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -229,22 +229,22 @@ object wndMSAAV: TwndMSAAV
Constraints.MinWidth = 12
TabOrder = 1
TabStop = True
object PB1: TPanelButton
object PB1: TAccClrBtn
Left = 327
Top = 0
Width = 10
Height = 660
Align = alRight
ButtonStyle = bsSpBtnLike
Caption = 'Collapse TreeView'
FocusStyle = bfsStdButton
TabOrder = 1
TabStop = True
OnClick = acTVcolExecute
Picture.Data = {07544269746D617000000000}
InColor = clBtnFace
CaptionLeft = -100
CaptionTop = -100
Stretch = False
TabOrder = 1
TabStop = True
OnClick = acTVcolExecute
PickerColor = clBtnFace
AccName = 'Collapse Button'
CtrlNext = PB2
CtrlPrev = TreeView1
Expand Down Expand Up @@ -310,25 +310,24 @@ object wndMSAAV: TwndMSAAV
BevelOuter = bvNone
TabOrder = 1
TabStop = True
object PB3: TPanelButton
object PB3: TAccClrBtn
Left = 0
Top = 0
Width = 582
Height = 10
Align = alTop
ButtonStyle = bsSpBtnLike
Caption = 'Collapse CodeEdit'
FocusStyle = bfsStdButton
CaptionLeft = -100
CaptionTop = -100
Stretch = False
TabOrder = 0
TabStop = True
OnClick = acMMColExecute
Picture.Data = {07544269746D617000000000}
InColor = clBtnFace
CaptionLeft = -100
CaptionTop = -100
Stretch = False
PickerColor = clBtnFace
AccName = 'Collapse Button'
CtrlNext = Memo1
CtrlPrev = TreeList1
CtrlUp = TreeList1
CtrlDown = Memo1
end
object Memo1: TAccMemo
Expand All @@ -354,88 +353,67 @@ object wndMSAAV: TwndMSAAV
BevelOuter = bvNone
TabOrder = 0
TabStop = True
object PB2: TPanelButton
object PB2: TAccClrBtn
Left = 0
Top = 0
Width = 582
Height = 10
Align = alTop
ButtonStyle = bsSpBtnLike
Caption = 'Collapse TreeList'
FocusStyle = bfsStdButton
CaptionLeft = -100
CaptionTop = -100
Stretch = False
TabOrder = 0
TabStop = True
OnClick = acTLColExecute
Picture.Data = {07544269746D617000000000}
InColor = clBtnFace
CaptionLeft = -100
CaptionTop = -100
Stretch = False
PickerColor = clBtnFace
AccName = 'Collapse Button'
CtrlNext = TreeList1
CtrlPrev = PB1
CtrlUp = Toolbar1
CtrlDown = TreeList1
end
object TreeList1: TAccTreeList
object TreeList1: TVirtualStringTree
Left = 0
Top = 26
Top = 10
Width = 582
Height = 364
Height = 380
Align = alClient
DoubleBuffered = True
HideSelection = False
Indent = 19
MultiSelectStyle = [msControlSelect, msShiftSelect]
ParentDoubleBuffered = False
ReadOnly = True
RowSelect = True
Header.AutoSizeIndex = 0
Header.Font.Charset = DEFAULT_CHARSET
Header.Font.Color = clWindowText
Header.Font.Height = -11
Header.Font.Name = 'Tahoma'
Header.Font.Style = []
Header.Height = 27
Header.Options = [hoColumnResize, hoDrag, hoShowSortGlyphs, hoVisible]
TabOrder = 1
Visible = True
OnChange = TreeList1Change
TreeOptions.PaintOptions = [toShowButtons, toShowDropmark, toShowRoot, toShowTreeLines, toThemeAware, toUseBlendedImages, toUseExplorerTheme]
TreeOptions.SelectionOptions = [toFullRowSelect, toAlwaysSelectNode]
OnClick = TreeList1Click
OnDeletion = TreeList1Deletion
OnGetText = TreeList1GetText
OnKeyDown = TreeList1KeyDown
Columns = <
item
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = 'Tahoma'
Font.Style = []
Image = True
Width = 50
MinWidth = 100
Position = 0
Width = 280
WideText = 'Interface'
end
item
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = 'Tahoma'
Font.Style = []
Width = 50
MinWidth = 100
Position = 1
Width = 294
WideText = 'Value'
end>
Separator = ';'
ItemHeight = 16
HeaderSettings.AllowResize = True
HeaderSettings.Color = clBtnFace
HeaderSettings.Flat = True
HeaderSettings.Font.Charset = DEFAULT_CHARSET
HeaderSettings.Font.Color = clWindowText
HeaderSettings.Font.Height = -11
HeaderSettings.Font.Name = 'Tahoma'
HeaderSettings.Font.Style = []
HeaderSettings.Height = 18
Version = '1.1.1.2'
CtrlNext = PB3
CtrlPrev = PB2
CtrlLeft = PB1
CtrlUp = PB2
end
end
end
object ImageList1: TImageList
Left = 176
Top = 400
Bitmap = {
494C01010E008C01B00710001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
494C01010E008C01A40810001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
0000000000003600000028000000400000004000000001002000000000000040
0000000000000000000000000000000000000000000000000000BDBDBD007A7A
7A007A7A7A007A7A7A007A7A7A007A7A7A007A7A7A007A7A7A007A7A7A007A7A
Expand Down Expand Up @@ -1048,6 +1026,26 @@ object wndMSAAV: TwndMSAAV
Caption = 'Settings'
OnExecute = acSettingExecute
end
object acTreeFocus: TAction
Caption = 'acTreeFocus'
ShortCut = 8304
OnExecute = acTreeFocusExecute
end
object acListFocus: TAction
Caption = 'acListFocus'
ShortCut = 8305
OnExecute = acListFocusExecute
end
object acMemoFocus: TAction
Caption = 'acMemoFocus'
ShortCut = 8306
OnExecute = acMemoFocusExecute
end
object acTriFocus: TAction
Caption = 'acTriFocus'
ShortCut = 8307
OnExecute = acTriFocusExecute
end
end
object Timer1: TTimer
Interval = 500
Expand Down Expand Up @@ -1212,7 +1210,7 @@ object wndMSAAV: TwndMSAAV
Left = 256
Top = 200
Bitmap = {
494C01013E005000C0010F000F00FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
494C01013E005000B4020F000F00FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
00000000000036000000280000003C000000F0000000010020000000000000E1
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
Expand Down
84 changes: 55 additions & 29 deletions frmMSAAV.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1635,12 +1635,11 @@ function TwndMSAAV.ShowMSAAText:boolean;
iRes := iAcc.QueryInterface(IID_IServiceProvider, iSP);
if SUCCEEDED(iRes) and Assigned(iSP) then
begin
//caption := 'ISP';

GetNaviState(True);
iRes := iSP.QueryService(IID_ISIMPLEDOMNODE, IID_ISIMPLEDOMNODE, isEle);
if SUCCEEDED(iRes) and Assigned(isEle) then
begin
//caption := 'SimpleDOM';
SDom := isEle;
// GetNaviState;
if mnuARIA.Checked then ARIAText;
Expand All @@ -1650,7 +1649,6 @@ function TwndMSAAV.ShowMSAAText:boolean;
iRes := iSP.QueryService(IID_ISIMPLEDOMNODE, IID_ISIMPLEDOMNODE, isEle);
if SUCCEEDED(iRes) and Assigned(isEle) then
begin
//caption := 'SimpleDOM2';
isEle.get_nodeInfo(PC, SI, PC2, PU, PU2, WD);
TempEle := isEle;
i := 0;
Expand Down Expand Up @@ -3786,7 +3784,7 @@ function TwndMSAAV.GetSameAcc: boolean;

Result := True;
TreeView1.OnChange := nil;
TreeView1.SetFocus;
//TreeView1.SetFocus;
TreeView1.TopItem := rNode;
rNode.Expanded := True;
rNode.Selected := True;
Expand Down Expand Up @@ -4685,22 +4683,17 @@ function TwndMSAAV.UIAText: string;
end;
if Assigned(UIArray) and SUCCEEDED(ires) then
begin
//caption := '1';
if SUCCEEDED(UIArray.Get_Length(iLen)) then
begin
//caption := '2-a / ' + inttostr(ilen);
for t := 0 to iLen - 1 do
begin
//cNode := nodes.AddChild(Node, inttostr(t));
cNode := SetNodeData(Node, inttostr(t), '', nil, 0);
//caption := '2-b';
ResEle := nil;
if SUCCEEDED(UIArray.GetElement(t, ResEle)) then
begin
//caption := '3';
if Assigned(ResEle) then
begin
//caption := '4';
ws := none;
if not UIAMode then
begin
Expand Down Expand Up @@ -5411,7 +5404,6 @@ procedure TwndMSAAV.Timer1Timer(Sender: TObject);
begin
UIEle.Get_CurrentBoundingRectangle(RC);
ShowRectWnd2(clRed, Rect(rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top));
//caption := inttostr(RC.Left) + ' - ' + inttostr(RC.Top) + ' - ' + inttostr(RC.Right) + ' - ' + inttostr(RC.Bottom);
end;
ShowText4UIA;
oldPT := arPT[0];
Expand Down Expand Up @@ -6412,6 +6404,8 @@ procedure TwndMSAAV.acSettingExecute(Sender: TObject);

ini: TMemINiFile;
begin
FormStyle := fsNormal;
timer1.Enabled := false;
WndSet := TWndSet.Create(self);
try
WndSet.Load_Str(TransPath);
Expand All @@ -6422,7 +6416,7 @@ procedure TwndMSAAV.acSettingExecute(Sender: TObject);
WndSet.ScaleX := ScaleX;
WndSet.ScaleY := ScaleY;
WndSet.SizeChange;
FormStyle := fsNormal;

WndSet.cbExTip.Checked := Extip;
WndSet.ChkList.Items.Add(lMSAA[0]);
WndSet.ChkList.Header[WndSet.ChkList.Items.Count - 1] := True;
Expand Down Expand Up @@ -6547,6 +6541,7 @@ procedure TwndMSAAV.acSettingExecute(Sender: TObject);
finally
WndSet.Free;
FormStyle := fsStayOnTop;
timer1.Enabled := true;
end;
end;

Expand Down Expand Up @@ -6606,24 +6601,6 @@ procedure TwndMSAAV.acTLColExecute(Sender: TObject);
Splitter2.Enabled := True;
acMMCol.Enabled := True;
end;
//caption := inttostr(P4H) + '/' + inttostr(Panel4.Height - 12);
end;

procedure TwndMSAAV.acTreeFocusExecute(Sender: TObject);
begin
TreeView1.SetFocus;
end;

procedure TwndMSAAV.acTriFocusExecute(Sender: TObject);
begin
if TreeView1.Focused then
TreeList1.SetFocus
else if TreeList1.Focused then
Memo1.SetFocus
else if Memo1.Focused then
TreeView1.SetFocus
else
TreeView1.SetFocus;
end;

procedure TwndMSAAV.acTVcolExecute(Sender: TObject);
Expand All @@ -6644,6 +6621,25 @@ procedure TwndMSAAV.acTVcolExecute(Sender: TObject);
end;
end;

procedure TwndMSAAV.acTreeFocusExecute(Sender: TObject);
begin
TreeView1.SetFocus;
end;

procedure TwndMSAAV.acTriFocusExecute(Sender: TObject);
begin
if TreeView1.Focused then
TreeList1.SetFocus
else if TreeList1.Focused then
Memo1.SetFocus
else if Memo1.Focused then
TreeView1.SetFocus
else
TreeView1.SetFocus;
end;



procedure TwndMSAAV.GetNaviState(AllFalse: boolean = false);
var
iDis: IDispatch;
Expand Down Expand Up @@ -6834,6 +6830,35 @@ procedure TwndMSAAV.mnuLangChildClick(Sender: TObject);
end;
end;

function GetFileVersionString(FileName: string): String;
var
dwHandle : Cardinal;
pInfo : Pointer;
InfoSize : DWORD;
pFileInfo : PVSFixedFileInfo;
iVer : array[0..3] of Cardinal;
begin
Result := '';

InfoSize := GetFileVersionInfoSize(PChar(FileName), dwHandle);
if InfoSize = 0 then exit;

GetMem(pInfo, InfoSize);
try
GetFileVersionInfo(PChar(FileName), 0, InfoSize, pInfo);
VerQueryValue(pInfo, PathDelim, Pointer(pFileInfo), InfoSize);

iVer[0] := pFileInfo.dwFileVersionMS shr 16;
iVer[1] := pFileInfo.dwFileVersionMS and $FFFF;
iVer[2] := pFileInfo.dwFileVersionLS shr 16;
iVer[3] := pFileInfo.dwFileVersionLS and $FFFF;
Result := Format('%d.%d.%d.%d', [iVer[0], iVer[1], iVer[2], iVer[3]]);
finally
FreeMem(pInfo, InfoSize);
end;
end;


function TwndMSAAV.LoadLang: string;
var
ini: TMemIniFile;
Expand Down Expand Up @@ -6961,6 +6986,7 @@ function TwndMSAAV.LoadLang: string;

HelpURL := ini.ReadString('General', 'Help_URL', 'http://www.google.com/');
Caption := ini.ReadString('General', 'MSAA_Caption', 'Accessibility Viewer');
Caption := Caption + ' - ' + GetFileVersionString(application.ExeName);
Font.Name := ini.ReadString('General', 'FontName', 'Arial');
Font.Size := ini.ReadInteger('General', 'FontSize', 9);
d := ini.ReadString('General', 'Charset', 'ASCII_CHARSET');
Expand Down
Loading

0 comments on commit decd4d6

Please sign in to comment.