Rev 85 | Rev 87 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 85 | Rev 86 | ||
---|---|---|---|
Line 9... | Line 9... | ||
9 | "Microsoft Internet Controls" |
9 | "Microsoft Internet Controls" |
10 | - SynEdit |
10 | - SynEdit |
11 | You can obtain SynEdit via Embarcadero GetIt |
11 | You can obtain SynEdit via Embarcadero GetIt |
12 | *) |
12 | *) |
13 | 13 | ||
- | 14 | // TODO: "DragAcceptFiles" does not work with Delphi Dark Design Template !!! |
|
- | 15 | ||
14 | // TODO: if a scrapfile is already open, create a new scrap file (scrap2.php) |
16 | // TODO: if a scrapfile is already open, create a new scrap file (scrap2.php) |
15 | // TODO: localize |
17 | // TODO: localize |
16 | // TODO: wieso geht copy paste im twebbrowser nicht??? |
18 | // TODO: wieso geht copy paste im twebbrowser nicht??? |
17 | // TODO: Wieso dauert webbrowser1 erste kompilierung so lange??? |
19 | // TODO: Wieso dauert webbrowser1 erste kompilierung so lange??? |
18 | // TODO: wieso kommt syntax fehler zweimal? einmal stderr einmal stdout? |
20 | // TODO: wieso kommt syntax fehler zweimal? einmal stderr einmal stdout? |
Line 181... | Line 183... | ||
181 | FileModLast: TDateTime; |
183 | FileModLast: TDateTime; |
182 | procedure Help; |
184 | procedure Help; |
183 | function InputRequestCallback(var data: AnsiString): boolean; |
185 | function InputRequestCallback(var data: AnsiString): boolean; |
184 | function OutputNotifyCallback(const data: AnsiString): boolean; |
186 | function OutputNotifyCallback(const data: AnsiString): boolean; |
185 | procedure RightTrimAll; |
187 | procedure RightTrimAll; |
- | 188 | procedure WMDropFiles(var Msg: TWMDropFiles); message WM_DROPFILES; |
|
186 | protected |
189 | protected |
187 | ChmIndex: TMemIniFile; |
190 | ChmIndex: TMemIniFile; |
188 | FScrapFile: string; |
191 | FScrapFile: string; |
189 | FSaveAsFilename: string; |
192 | FSaveAsFilename: string; |
190 | codeExplorer: TRunCodeExplorer; |
193 | codeExplorer: TRunCodeExplorer; |
Line 817... | Line 820... | ||
817 | ShowMessage(LNG_CLOSE_REQUEST); |
820 | ShowMessage(LNG_CLOSE_REQUEST); |
818 | TWebBrowser(ASender).Clear; |
821 | TWebBrowser(ASender).Clear; |
819 | Cancel := true; |
822 | Cancel := true; |
820 | end; |
823 | end; |
821 | 824 | ||
- | 825 | procedure TForm1.WMDropFiles(var Msg: TWMDropFiles); |
|
- | 826 | var |
|
- | 827 | DropH: HDROP; // drop handle |
|
- | 828 | DroppedFileCount: Integer; // number of files dropped |
|
- | 829 | FileNameLength: Integer; // length of a dropped file name |
|
- | 830 | FileName: string; // a dropped file name |
|
- | 831 | I: Integer; // loops thru all dropped files |
|
- | 832 | DropPoint: TPoint; // point where files dropped |
|
- | 833 | begin |
|
- | 834 | inherited; |
|
- | 835 | // Store drop handle from the message |
|
- | 836 | DropH := Msg.Drop; |
|
- | 837 | try |
|
- | 838 | // Get count of files dropped |
|
- | 839 | DroppedFileCount := DragQueryFile(DropH, $FFFFFFFF, nil, 0); |
|
- | 840 | // Get name of each file dropped and process it |
|
- | 841 | for I := 0 to Pred(DroppedFileCount) do |
|
- | 842 | begin |
|
- | 843 | // get length of file name |
|
- | 844 | FileNameLength := DragQueryFile(DropH, I, nil, 0); |
|
- | 845 | // create string large enough to store file |
|
- | 846 | SetLength(FileName, FileNameLength); |
|
- | 847 | // get the file name |
|
- | 848 | DragQueryFile(DropH, I, PChar(FileName), FileNameLength + 1); |
|
- | 849 | // process file name (application specific) |
|
- | 850 | // ... processing code here |
|
- | 851 | ShellExecute(0, 'open', PChar(ParamStr(0)), PChar('"' + FileName + '"'), '', SW_NORMAL); |
|
- | 852 | end; |
|
- | 853 | // Optional: Get point at which files were dropped |
|
- | 854 | DragQueryPoint(DropH, DropPoint); |
|
- | 855 | // ... do something with drop point here |
|
- | 856 | finally |
|
- | 857 | // Tidy up - release the drop handle |
|
- | 858 | // don't use DropH again after this |
|
- | 859 | DragFinish(DropH); |
|
- | 860 | end; |
|
- | 861 | // Note we handled message |
|
- | 862 | Msg.Result := 0; |
|
- | 863 | end; |
|
- | 864 | ||
822 | procedure TForm1.BeforeNavigate(const URL: OleVariant; var Cancel: WordBool); |
865 | procedure TForm1.BeforeNavigate(const URL: OleVariant; var Cancel: WordBool); |
823 | var |
866 | var |
824 | s, myURL: string; |
867 | s, myURL: string; |
825 | lineno: integer; |
868 | lineno: integer; |
826 | p: integer; |
869 | p: integer; |
Line 926... | Line 969... | ||
926 | FileModTimer.Enabled := true; |
969 | FileModTimer.Enabled := true; |
927 | end; |
970 | end; |
928 | 971 | ||
929 | procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction); |
972 | procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction); |
930 | begin |
973 | begin |
- | 974 | DragAcceptFiles(Handle, False); |
|
931 | TFastPHPConfig.FontSize := SynEdit1.Font.Size; |
975 | TFastPHPConfig.FontSize := SynEdit1.Font.Size; |
932 | end; |
976 | end; |
933 | 977 | ||
934 | procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean); |
978 | procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean); |
935 | var |
979 | var |
Line 1060... | Line 1104... | ||
1060 | SynEdit1.SetFocus; |
1104 | SynEdit1.SetFocus; |
1061 | 1105 | ||
1062 | DoubleBuffered := true; |
1106 | DoubleBuffered := true; |
1063 | StartCodeExplorer; |
1107 | StartCodeExplorer; |
1064 | 1108 | ||
- | 1109 | DragAcceptFiles(Handle, True); |
|
- | 1110 | ||
1065 | StartupTimer.Enabled := true; |
1111 | StartupTimer.Enabled := true; |
1066 | end; |
1112 | end; |
1067 | 1113 | ||
1068 | procedure TForm1.Save1Click(Sender: TObject); |
1114 | procedure TForm1.Save1Click(Sender: TObject); |
1069 | begin |
1115 | begin |