Changeset 244
- Timestamp:
- 05/14/08 19:58:35 (5 years ago)
- Files:
-
- trunk/current/poseidon/CodeAnalyzer/lexical/identifiersLex.d (modified) (1 diff)
- trunk/current/poseidon/CodeAnalyzer/syntax/declarations.d (modified) (3 diffs)
- trunk/current/poseidon/config.xml (modified) (3 diffs)
- trunk/current/poseidon/nls/english.ini (modified) (5 diffs)
- trunk/current/poseidon/poseidon.exe (modified) (previous)
- trunk/current/poseidon/poseidon/controller/actionmanager.d (modified) (2 diffs)
- trunk/current/poseidon/poseidon/controller/ddoc (added)
- trunk/current/poseidon/poseidon/controller/ddoc/ddocparser.d (added)
- trunk/current/poseidon/poseidon/controller/debugcontrol/debugPanel.d (modified) (2 diffs)
- trunk/current/poseidon/poseidon/controller/debugcontrol/debugger.d (modified) (6 diffs)
- trunk/current/poseidon/poseidon/controller/debugcontrol/debugparser.d (modified) (2 diffs)
- trunk/current/poseidon/poseidon/controller/debugcontrol/pipe.d (modified) (1 diff)
- trunk/current/poseidon/poseidon/controller/debugcontrol/watch.d (modified) (4 diffs)
- trunk/current/poseidon/poseidon/controller/dialog/aboutbox.d (modified) (1 diff)
- trunk/current/poseidon/poseidon/controller/edititem.d (modified) (9 diffs)
- trunk/current/poseidon/poseidon/controller/menumanager.d (modified) (5 diffs)
- trunk/current/poseidon/poseidon/controller/packageexplorer.d (modified) (1 diff)
- trunk/current/poseidon/poseidon/controller/property/compilerpage.d (modified) (4 diffs)
- trunk/current/poseidon/poseidon/controller/property/generalpage.d (modified) (5 diffs)
- trunk/current/poseidon/poseidon/controller/property/preference.d (modified) (3 diffs)
- trunk/current/poseidon/poseidon/controller/property/rescompilerpage.d (modified) (5 diffs)
- trunk/current/poseidon/poseidon/globals.d (modified) (8 diffs)
- trunk/current/poseidon/poseidon/intellisense/autocomplete.d (modified) (1 diff)
- trunk/current/poseidon/poseidon/model/project.d (modified) (4 diffs)
- trunk/current/poseidon/poseidon/style/dstyle.d (modified) (20 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/current/poseidon/CodeAnalyzer/lexical/identifiersLex.d
r240 r244 22 22 else 23 23 { 24 switch( ident ) 25 { 26 case "__FILE__": 27 case "__DATA__": 28 case "__TIME__": 29 case "__TIMESTAMP__": 30 case "__VENDOR__": 31 return TOK.Tstring; 32 33 case "__LINE__": 34 case "__VERSION__": 35 return TOK.Tnumber; 36 37 default: break; 38 } 24 39 return TOK.Identifier; 25 40 } trunk/current/poseidon/CodeAnalyzer/syntax/declarations.d
r240 r244 171 171 { 172 172 char[] paramString = std.string.strip( s ); 173 int posAssign = std.string.rfind( paramString, "=" ); 174 if( posAssign > 2 ) paramString = paramString[0..posAssign]; 175 173 176 int spacePos = std.string.rfind( paramString, " " ); 174 177 if( spacePos > 0 ) 175 178 if( spacePos < paramString.length - 1 ) 176 activeNode.addLeaf( 0, D_PARAMETER, paramString[spacePos + 1..length], paramString[0..spacePos], lineNumber ); 179 { 180 char[] ident = paramString[spacePos + 1..length]; 181 char[] typeIdent = paramString[0..spacePos]; 182 183 paramString = paramString[0..spacePos]; 184 spacePos = std.string.rfind( paramString, " " ); 185 if( spacePos > 0 ) typeIdent = paramString[spacePos+1..length]; // include inout..... 186 187 activeNode.addLeaf( 0, D_PARAMETER, ident, typeIdent, lineNumber ); 188 } 177 189 } 178 190 } … … 877 889 parseR!(Declarator); 878 890 879 globalParams ~= globalIdentifier; // Kuan Hsu 880 891 globalParams ~= tokenText; // Kuan Hsu 881 892 882 893 if( ts.next( TOK.Tassign ) ) … … 884 895 parseTerminal(); 885 896 parseR!(Initializer); 897 886 898 } 887 899 else if( ts.next( TOK.Openparen ) ) trunk/current/poseidon/config.xml
r241 r244 14 14 </customtools> 15 15 <hotkeys> 16 <key name="box_comment" mask="262144" code="98" mask_def="262144" code_def="98" comment="CTRL+B" /> 17 <key name="build_project" mask="0" code="16777234" mask_def="0" code_def="16777234" comment="CTRL+M" /> 18 <key name="build_run_project" mask="131072" code="16777230" mask_def="131072" code_def="16777230" comment="CTRL+M" /> 19 <key name="buildtool" mask="131072" code="16777232" mask_def="131072" code_def="16777232" comment="CTRL+M" /> 20 <key name="close_file" mask="262144" code="119" mask_def="262144" code_def="119" comment="CTRL+W" /> 21 <key name="compile" mask="0" code="16777232" mask_def="0" code_def="16777232" comment="CTRL+M" /> 22 <key name="copy" mask="262144" code="99" mask_def="262144" code_def="99" comment="CTRL+C" /> 23 <key name="cut" mask="262144" code="120" mask_def="262144" code_def="120" comment="CTRL+X" /> 24 <key name="debug_build_project" mask="131072" code="16777233" mask_def="131072" code_def="16777233" comment="CTRL+M" /> 25 <key name="debug_clean_bps" mask="131072" code="16777234" mask_def="131072" code_def="16777234" comment="CTRL+M" /> 26 <key name="debug_in" mask="131072" code="16777226" mask_def="131072" code_def="16777226" comment="CTRL+M" /> 27 <key name="debug_over" mask="131072" code="16777227" mask_def="131072" code_def="16777227" comment="CTRL+M" /> 28 <key name="debug_project" mask="0" code="16777233" mask_def="0" code_def="16777233" comment="CTRL+M" /> 29 <key name="debug_return" mask="131072" code="16777228" mask_def="131072" code_def="16777228" comment="CTRL+M" /> 30 <key name="debug_run" mask="131072" code="16777229" mask_def="131072" code_def="16777229" comment="CTRL+M" /> 31 <key name="debug_stop" mask="131072" code="16777235" mask_def="131072" code_def="16777235" comment="CTRL+M" /> 32 <key name="document0" mask="0" code="16777226" mask_def="0" code_def="16777226" comment="CTRL+B" /> 33 <key name="document1" mask="0" code="16777236" mask_def="0" code_def="16777236" comment="CTRL+B" /> 34 <key name="document2" mask="0" code="16777237" mask_def="0" code_def="16777237" comment="CTRL+B" /> 35 <key name="document3" mask="262144" code="16777226" mask_def="262144" code_def="16777226" comment="CTRL+B" /> 36 <key name="document4" mask="262144" code="16777236" mask_def="262144" code_def="16777236" comment="CTRL+B" /> 37 <key name="find" mask="262144" code="102" mask_def="262144" code_def="102" comment="CTRL+F" /> 38 <key name="find_back" mask="0" code="16777229" mask_def="0" code_def="16777229" comment="F4" /> 39 <key name="find_forward" mask="0" code="16777228" mask_def="0" code_def="16777228" comment="F3" /> 40 <key name="force_complete" mask="262144" code="101" mask_def="262144" code_def="101" comment="CTRL+E" /> 41 <key name="goto_line" mask="262144" code="103" mask_def="262144" code_def="103" comment="CTRL+G" /> 42 <key name="jump_to_defintion" mask="65536" code="103" mask_def="65536" code_def="103" comment="ALT+G" /> 43 <key name="line_copy" mask="393216" code="116" mask_def="393216" code_def="116" comment="CTRL+SHIFT+T" /> 44 <key name="line_cut" mask="262144" code="108" mask_def="262144" code_def="108" comment="CTRL+L" /> 45 <key name="line_del" mask="262144" code="100" mask_def="262144" code_def="100" comment="CTRL+D" /> 46 <key name="line_dup" mask="393216" code="108" mask_def="393216" code_def="108" comment="CTRL+SHIFT+L" /> 47 <key name="line_swap" mask="262144" code="116" mask_def="262144" code_def="116" comment="CTRL+T" /> 48 <key name="lowercase" mask="262144" code="117" mask_def="262144" code_def="117" comment="CTRL+U" /> 49 <key name="mark_next" mask="262144" code="16777232" mask_def="0" code_def="16777232" comment="F7" /> 50 <key name="mark_prev" mask="262144" code="16777233" mask_def="0" code_def="16777233" comment="F8" /> 51 <key name="mark_toggle" mask="262144" code="16777234" mask_def="0" code_def="16777234" comment="F9" /> 52 <key name="nav_back" mask="262144" code="16777231" mask_def="0" code_def="16777231" comment="F6" /> 53 <key name="nav_forward" mask="262144" code="16777230" mask_def="0" code_def="16777230" comment="F5" /> 54 <key name="nest_comment" mask="262144" code="110" mask_def="262144" code_def="110" comment="CTRL+B" /> 55 <key name="paste" mask="262144" code="118" mask_def="262144" code_def="118" comment="CTRL+V" /> 56 <key name="rebuild_project" mask="0" code="16777235" mask_def="0" code_def="16777235" comment="CTRL+M" /> 57 <key name="redo" mask="393216" code="122" mask_def="393216" code_def="122" comment="CTRL+Y" /> 58 <key name="run_project" mask="0" code="16777230" mask_def="0" code_def="16777230" comment="CTRL+B" /> 59 <key name="save" mask="262144" code="115" mask_def="262144" code_def="115" comment="CTRL+S" /> 60 <key name="save_allfiles" mask="393216" code="115" mask_def="393216" code_def="115" comment="CTRL+S" /> 61 <key name="search" mask="262144" code="104" mask_def="262144" code_def="104" comment="CTRL+H" /> 62 <key name="select_all" mask="262144" code="97" mask_def="262144" code_def="97" comment="CTRL+A" /> 63 <key name="stream_comment" mask="393216" code="113" mask_def="393216" code_def="113" comment="CTRL+SHIFT+Q" /> 64 <key name="toggle_comment" mask="262144" code="113" mask_def="262144" code_def="113" comment="CTRL+Q" /> 65 <key name="undo" mask="262144" code="122" mask_def="262144" code_def="122" comment="CTRL+Z" /> 16 66 <key name="uppercase" mask="393216" code="117" mask_def="393216" code_def="117" comment="CTRL+SHIFT+U" /> 17 <key name="undo" mask="0" code="16777226" mask_def="262144" code_def="122" comment="CTRL+Z" />18 <key name="toggle_comment" mask="262144" code="113" mask_def="262144" code_def="113" comment="CTRL+Q" />19 <key name="stream_comment" mask="393216" code="113" mask_def="393216" code_def="113" comment="CTRL+SHIFT+Q" />20 <key name="select_all" mask="262144" code="97" mask_def="262144" code_def="97" comment="CTRL+A" />21 <key name="search" mask="262144" code="104" mask_def="262144" code_def="104" comment="CTRL+H" />22 <key name="save_allfiles" mask="393216" code="115" mask_def="393216" code_def="115" comment="CTRL+S" />23 <key name="save" mask="262144" code="115" mask_def="262144" code_def="115" comment="CTRL+S" />24 <key name="run_project" mask="0" code="16777230" mask_def="0" code_def="16777230" comment="CTRL+B" />25 <key name="redo" mask="0" code="16777227" mask_def="262144" code_def="121" comment="CTRL+Y" />26 <key name="rebuild_project" mask="0" code="16777235" mask_def="0" code_def="16777235" comment="CTRL+M" />27 <key name="paste" mask="262144" code="118" mask_def="262144" code_def="118" comment="CTRL+V" />28 <key name="nest_comment" mask="262144" code="110" mask_def="262144" code_def="110" comment="CTRL+B" />29 <key name="nav_forward" mask="262144" code="16777230" mask_def="0" code_def="16777230" comment="F5" />30 <key name="nav_back" mask="262144" code="16777231" mask_def="0" code_def="16777231" comment="F6" />31 <key name="mark_toggle" mask="262144" code="16777234" mask_def="0" code_def="16777234" comment="F9" />32 <key name="mark_prev" mask="262144" code="16777233" mask_def="0" code_def="16777233" comment="F8" />33 <key name="mark_next" mask="262144" code="16777232" mask_def="0" code_def="16777232" comment="F7" />34 <key name="lowercase" mask="262144" code="117" mask_def="262144" code_def="117" comment="CTRL+U" />35 <key name="line_swap" mask="262144" code="116" mask_def="262144" code_def="116" comment="CTRL+T" />36 <key name="line_dup" mask="393216" code="108" mask_def="393216" code_def="108" comment="CTRL+SHIFT+L" />37 <key name="line_del" mask="262144" code="100" mask_def="262144" code_def="100" comment="CTRL+D" />38 <key name="line_cut" mask="262144" code="108" mask_def="262144" code_def="108" comment="CTRL+L" />39 <key name="line_copy" mask="393216" code="116" mask_def="393216" code_def="116" comment="CTRL+SHIFT+T" />40 <key name="jump_to_defintion" mask="65536" code="103" mask_def="65536" code_def="103" comment="ALT+G" />41 <key name="goto_line" mask="262144" code="103" mask_def="262144" code_def="103" comment="CTRL+G" />42 <key name="force_complete" mask="262144" code="101" mask_def="262144" code_def="101" comment="CTRL+E" />43 <key name="find_forward" mask="0" code="16777228" mask_def="0" code_def="16777228" comment="F3" />44 <key name="find_back" mask="0" code="16777229" mask_def="0" code_def="16777229" comment="F4" />45 <key name="find" mask="262144" code="102" mask_def="262144" code_def="102" comment="CTRL+F" />46 <key name="debug_stop" mask="131072" code="16777235" mask_def="131072" code_def="16777235" comment="CTRL+M" />47 <key name="debug_run" mask="131072" code="16777229" mask_def="131072" code_def="16777229" comment="CTRL+M" />48 <key name="debug_return" mask="131072" code="16777228" mask_def="131072" code_def="16777228" comment="CTRL+M" />49 <key name="debug_project" mask="0" code="16777233" mask_def="0" code_def="16777233" comment="CTRL+M" />50 <key name="debug_over" mask="131072" code="16777227" mask_def="131072" code_def="16777227" comment="CTRL+M" />51 <key name="debug_in" mask="131072" code="16777226" mask_def="131072" code_def="16777226" comment="CTRL+M" />52 <key name="debug_clean_bps" mask="131072" code="16777234" mask_def="131072" code_def="16777234" comment="CTRL+M" />53 <key name="debug_build_project" mask="131072" code="16777233" mask_def="131072" code_def="16777233" comment="CTRL+M" />54 <key name="cut" mask="262144" code="120" mask_def="262144" code_def="120" comment="CTRL+X" />55 <key name="copy" mask="262144" code="99" mask_def="262144" code_def="99" comment="CTRL+C" />56 <key name="compile" mask="0" code="16777232" mask_def="0" code_def="16777232" comment="CTRL+M" />57 <key name="close_file" mask="262144" code="119" mask_def="262144" code_def="119" comment="CTRL+W" />58 <key name="buildtool" mask="131072" code="16777232" mask_def="131072" code_def="16777232" comment="CTRL+M" />59 <key name="build_run_project" mask="131072" code="16777230" mask_def="131072" code_def="16777230" comment="CTRL+M" />60 <key name="build_project" mask="0" code="16777234" mask_def="0" code_def="16777234" comment="CTRL+M" />61 <key name="box_comment" mask="262144" code="98" mask_def="262144" code_def="98" comment="CTRL+B" />62 67 </hotkeys> 63 68 <recentprjs /> … … 68 73 <searchstyle id="" name="" value="ft:Book Antiqua|fg:0|bg:16777215|sz:8|b:0|i:0|u:0" defvalue="ft:Tahoma|fg:0|bg:16777215|sz:10|b:0|i:0|u:0" /> 69 74 </editorsettings> 70 <ide showsplash="0" loadworkspaceatstart="0" isshellmaximized="1" shellbounds="-4 -4 1288 998" desktopweight="209 790 697 302 0 0" explorerfilters="*.c;*.cpp;*.h;*.xml;*.txt;*.def" />75 <ide showsplash="0" loadworkspaceatstart="0" isshellmaximized="1" shellbounds="-4 -4 1288 998" desktopweight="209 790 697 302 0 0" sendabspath="1" document="" explorerfilters="*.c;*.cpp;*.h;*.xml;*.txt;*.def" /> 71 76 <recentdir name="" /> 72 77 <language value="english" /> … … 76 81 <BUD path="" /> 77 82 <DEBUGGER path="" /> 78 <DDOCUMENT path="" />79 83 <BUILDTYPE thread="1" /> 80 84 <output wrap="64" /> 85 <debuggerSearch path="" /> 81 86 </compilersetting> 82 87 <parsersetting> 83 <codecompletion use="1" onlybrowser="0" a ll="0" live="1" member="0" showtype="0" casesensitive="0" lettercount="3" defaultparser="0" backgroundload="1" ed="0" el="0" />88 <codecompletion use="1" onlybrowser="0" auto="0" all="0" live="1" member="0" showtype="0" jumptop="0" casesensitive="0" lettercount="3" defaultparser="0" backgroundload="1" ed="0" el="0" /> 84 89 <defaultparserpaths /> 85 90 </parsersetting> trunk/current/poseidon/nls/english.ini
r242 r244 246 246 gp.wrap = Use Output Wrap ( Need Restart Poseidon ) 247 247 gp.filter = Package Explorer File Filter( File Open On Poseidon, Except *.d;*.di ) 248 gp.absolute = Send Files To Compiler Using Absolute Path 249 gp.doc_title = Help Document Fullpath 250 gp.doc = Document 248 251 249 252 ;==== Editor Page ========= … … 273 276 cp.build_path = Build Tool 274 277 cp.ddbg_path = Debugger 275 cp. doc = D Document278 cp.rc_path = RCC Compiler 276 279 cp.thread = Compile / Build At Background-Thread 277 280 cp.compiler = Compiler … … 296 299 pap.ed = Default recursive structures max depth [ed] 297 300 pap.el = Default array elements max number [el] 301 pap.path = Source Search Paths 298 302 299 303 ; ============ D style page ============= … … 336 340 diag.title7 = Add ImportExpression Path... 337 341 diag.title7_1 = Edit ImportExpression Path 342 diag.title8 = Add Source Search Path... 343 diag.title8_1 = Edit Source Search Path 338 344 339 345 ;============================= project property =========================== … … 408 414 pp2.args = Execute Args 409 415 410 pp2.rc = Resource Complier Options: 416 pp2.rc = Resource Complier...... 417 pp2.rcoptions = Resource Complier Options 418 pp2.command = Console Command Line 419 ;pp2.rc_o0 = Generate a 32-bit resource file [-32] 420 ;pp2.rc_o1 = Predefines macro DEBUG to 1 [-D] 421 ;pp2.rc_o2 = Predefines macro macro to 1 [-Dmacro] 422 ;pp2.rc_o3 = Predefines macro macro to text [-Dmacro=<file>] 423 ;pp2.rc_o4 = Specify the format for two-byte Asian characters [-J] 424 ;pp2.rc_o5 = Specify the default language ID for Unicode conversions [-l<nnn>] 425 ;pp2.rc_o6 = Generate enum output file [-n] 426 ;pp2.rc_o5 = Specify the default language ID for Unicode conversions [-l<nnn>] 427 ;pp2.rc_o6 = Generate enum output file [-n] 428 411 429 pp2.rc_o0 = Defines a symbol for the preprocessor that you can test with the #ifdef directive [-D] 412 pp2.rc_o1 = Names the executable file [-FE]413 pp2.rc_o2 = Renames the resource file [-FO]414 pp2.rc_o3 = Prevents RC from checking the INCLUDE environment variable when searching for include files or resource files [-X]415 pp2.rc_o4 = Dis ables RC's load-optimization feature [-K]416 pp2.rc_o5 = Creates a resource file from a resource script file [-R]417 pp2.rc_o6 = Displaying progress messages [-V]430 pp2.rc_o1 = Prevents RC from checking the INCLUDE environment variable when searching for include files or resource files [-X] 431 pp2.rc_o2 = Disables RC's load-optimization feature [-K] 432 pp2.rc_o3 = Creates a resource file from a resource script file [-R] 433 pp2.rc_o4 = Displaying progress messages [-V] 434 pp2.rc_o5 = Names the executable file [-FE] 435 pp2.rc_o6 = Renames the resource file [-FO] 418 436 419 437 trunk/current/poseidon/poseidon/controller/actionmanager.d
r240 r244 703 703 } 704 704 705 /* 706 public bool actionResTool( char[] fileName ) 705 706 public bool actionRCCompile( char[] fileName, char[] command ) 707 { 708 if( !command.length ) 709 { 710 sGUI.outputPanel.setForeColor( 0xff, 0, 0 ); 711 sGUI.outputPanel.bringToFront(); 712 sGUI.outputPanel.setString( " ERROR >>> No Commands!!\n" ); 713 return false; 714 } 715 716 if( !std.file.exists( Globals.RCExe ) ) 717 { 718 sGUI.outputPanel.setForeColor( 0xff, 0, 0 ); 719 sGUI.outputPanel.bringToFront(); 720 sGUI.outputPanel.setString( " ERROR >>> Wrong RC Compiler EXE Path!!\n" ); 721 return false; 722 } 723 724 ToolEntry entry = new ToolEntry(); 725 726 entry.name = "RC Compiler"; 727 entry.cmd = Globals.RCExe; 728 entry.args = command; 729 entry.hideWnd = true; 730 731 execExtToolHSU( entry, "Command >>> RC Compiler: " ~ fileName ~ "......\n", !Globals.backBuild, false ); 732 733 return true; 734 } 735 736 737 public bool actionDDocumentFile( int index ) 707 738 { 708 739 try 709 740 { 710 if( std.string.icmp( std.path.getExt( fileName ), "res" ) ) return false;711 712 if( !std.file.exists( Globals.RESToolExe ) )713 {714 sGUI.outputPanel.setForeColor( 0xff, 0, 0 );715 sGUI.outputPanel.bringToFront();716 sGUI.outputPanel.setString( " ERROR >>> Wrong Resource Editor EXE Path!!\n" );717 return true;718 }719 720 741 ToolEntry entry = new ToolEntry(); 721 entry.name = "Resource Editor"; 722 entry.cmd = Globals.RESToolExe; 723 entry.args = fileName; 724 sGUI.outputPanel.setForeColor( 0, 0x33, 0x66 ); 725 726 execExtToolHSU( entry, "Running Resource Tool......\n\n" ); 727 } 728 catch 729 { 730 return true; 731 } 732 733 return true; 734 } 735 */ 736 737 public bool actionDDocumentFile() 738 { 739 try 740 { 741 ToolEntry entry = new ToolEntry(); 742 entry.name = "DMDV1.0 Document"; 743 entry.cmd = Globals.DDcoumentDir; 744 if( !std.file.exists( Globals.DDcoumentDir ) ) return false; 742 entry.name = "Help Document " ~ std.string.toString( index ); 743 entry.cmd = Globals.DDcoumentDir[index]; 744 if( !std.file.exists( Globals.DDcoumentDir[index] ) ) return false; 745 745 746 746 //entry.args = fileName; … … 751 751 catch 752 752 { 753 return true;753 return false; 754 754 } 755 755 trunk/current/poseidon/poseidon/controller/debugcontrol/debugPanel.d
r221 r244 113 113 else 114 114 { 115 char[] moduleName = data[0..atIndex]; 115 116 char[] fileAndLine = data[atIndex+3..length]; 116 117 //currentStackFrameLocation = fileAndLine; … … 122 123 123 124 char[] filePath = fileAndLine[0..colonIndex]; 125 char[] fullPath; 124 126 int line = std.string.atoi( fileAndLine[colonIndex+1..length] ) - 1; 127 128 bool bGot; 129 130 if( !std.file.exists( filePath ) ) 131 { 132 if( !std.path.isabs( filePath ) ) 133 { 134 fullPath = std.path.join( CDebugger.projectDir, filePath ); 135 136 if( !std.file.exists( fullPath ) ) 137 { 138 foreach( char[] path; Globals.debuggerSearchPath ) 139 { 140 fullPath = std.path.join( path, filePath ); 141 if( std.file.exists( fullPath ) ) 142 { 143 filePath = fullPath; 144 bGot = true; 145 break; 146 } 147 } 148 } 149 else 150 { 151 filePath = fullPath; 152 bGot = true; 153 } 154 } 155 } 156 else 157 { 158 if( !std.path.isabs( filePath ) ) filePath = std.path.join( CDebugger.projectDir, filePath ); 159 bGot = true; 160 } 161 162 if( !bGot ) 163 { 164 char[] path; 165 char[] baseName = std.path.getName( std.path.getBaseName( filePath ) ); 166 167 foreach( char[] dir; Globals.debuggerSearchPath ) 168 { 169 fullPath = std.path.join( dir, baseName ); 170 if( std.file.exists( fullPath ) ) 171 { 172 filePath = fullPath; 173 bGot = true; 174 break; 175 } 176 } 177 178 if( !bGot ) 179 { 180 foreach( char[] s; std.string.split( moduleName, "." ) ) 181 { 182 if( s != baseName ) 183 path = s ~ "\\"; 184 else 185 break; 186 } 187 188 path = path ~ std.path.getBaseName( filePath ); 189 190 if( sGUI.packageExp.activeProject !is null ) 191 { 192 foreach( char[] dir; sGUI.packageExp.activeProject().projectIncludePaths ~ sGUI.packageExp.activeProject().scINIImportPath ) 193 { 194 fullPath = std.path.join( dir, path ); 195 if( std.file.exists( filePath ) ) 196 { 197 filePath = fullPath; 198 bGot = true; 199 break; 200 } 201 } 202 } 203 } 204 } 205 125 206 126 207 if( sGUI.editor.openFile( filePath, null, line, true ) ) trunk/current/poseidon/poseidon/controller/debugcontrol/debugger.d
r222 r244 65 65 CWatchPanel topRightPanel; 66 66 67 char[]projectDir;67 static char[] projectDir; 68 68 69 69 this( SashForm parent ) … … 148 148 if( ti.getChecked() ) 149 149 { 150 pipe.sendCommand( "bp " ~ std.string.strip( ti.getText( 3 ) ) ~ ":" ~ std.string.strip( ti.getText( 2 ) ) ~ "\n" ); 150 char[] fileName = std.string.strip( ti.getText( 3 ) ); 151 if( std.path.isabs( fileName ) ) fileName = std.string.replace( fileName, _projectDir ~ "\\", "" ); 152 153 pipe.sendCommand( "bp " ~ fileName ~ ":" ~ std.string.strip( ti.getText( 2 ) ) ~ "\n" ); 154 151 155 } 152 156 } … … 242 246 { 243 247 if( commands.length == 2 ) 244 addBP_editor( splitColon[0], std.string.atoi( splitColon[1] ) ); // bp file:linenum248 addBP_editor( splitColon[0], std.string.atoi( splitColon[1] ), projectDir ); // bp file:linenum 245 249 else if( commands.length == 3 ) 246 addBP_editor( splitColon[0], std.string.atoi( splitColon[1] ), std.string.atoi( commands[2] ) );250 addBP_editor( splitColon[0], std.string.atoi( splitColon[1] ), std.string.atoi( commands[2] ), projectDir ); 247 251 } 248 252 } … … 284 288 } 285 289 286 void addBP_editor( char[] fullPath, int lineNum ) 287 { 290 void addBP_editor( char[] fullPath, int lineNum, char[] _projectDir = null ) 291 { 292 char[] moduleName; 293 if( std.path.isabs( fullPath ) ) 294 moduleName = std.string.replace( fullPath, _projectDir ~ "\\", "" ); 295 else 296 moduleName = fullPath; 297 288 298 if( isPipeCreate ) 289 299 { 290 char[] result = write( "bp " ~ fullPath~ ":" ~ std.string.toString( lineNum ) ~ "\n" );300 char[] result = write( "bp " ~ moduleName ~ ":" ~ std.string.toString( lineNum ) ~ "\n" ); 291 301 292 302 int setPos = std.string.find( result, "Breakpoint set: " ); … … 301 311 } 302 312 303 bpItem.add( fullPath, lineNum ); 304 } 305 306 void addBP_editor( char[] fullPath, int lineNum, int id ) 307 { 313 bpItem.add( fullPath, moduleName, lineNum ); 314 } 315 316 void addBP_editor( char[] fullPath, int lineNum, int id, char[] _projectDir = null ) 317 { 318 char[] moduleName; 319 if( std.path.isabs( fullPath ) ) 320 moduleName = std.string.replace( fullPath, _projectDir ~ "\\", "" ); 321 else 322 moduleName = fullPath; 323 308 324 if( isPipeCreate ) 309 325 { 310 char[] result = write( "bp " ~ fullPath~ ":" ~ std.string.toString( lineNum ) ~ " " ~ std.string.toString( id ) ~ "\n" );326 char[] result = write( "bp " ~ moduleName ~ ":" ~ std.string.toString( lineNum ) ~ " " ~ std.string.toString( id ) ~ "\n" ); 311 327 312 328 int setPos = std.string.find( result, "Breakpoint set: " ); … … 321 337 } 322 338 323 bpItem.add( fullPath, lineNum, id );339 bpItem.add( fullPath, moduleName, lineNum, id ); 324 340 } 325 341 trunk/current/poseidon/poseidon/controller/debugcontrol/debugparser.d
r222 r244 9 9 import poseidon.controller.edititem; 10 10 import poseidon.controller.debugcontrol.debugger; 11 import poseidon.globals; 12 11 13 12 14 static bool findFileNameAndLineNum( char[] input, inout char[] fileName, inout int lineNum ) … … 34 36 lineNum = std.string.atoi( input[lnIndex + 1..spaceIndex] ); 35 37 36 return true; 38 char[] fullPath; 39 40 if( !std.file.exists( fileName ) ) 41 { 42 if( !std.path.isabs( fileName ) ) 43 { 44 fullPath = std.path.join( CDebugger.projectDir, fileName ); 45 46 if( !std.file.exists( fullPath ) ) 47 { 48 foreach( char[] path; Globals.debuggerSearchPath ) 49 { 50 fullPath = std.path.join( path, fileName ); 51 if( std.file.exists( fullPath ) ) 52 { 53 fileName = fullPath; 54 return true; 55 } 56 } 57 } 58 else 59 { 60 fileName = fullPath; 61 return true; 62 } 63 } 64 } 65 else 66 { 67 if( !std.path.isabs( fileName ) ) fileName = std.path.join( CDebugger.projectDir, fileName ); 68 return true; 69 } 70 71 if( !std.file.exists( fileName ) ) 72 { 73 char[] result = sGUI.debuggerDMD.write( "us\n", false ); 74 int posLine = std.string.find( result, "\n" ); 75 if( posLine > 3 ) 76 { 77 result = result[0..posLine]; 78 if( result[0..3] == "#0 " ) 79 { 80 result = std.string.strip( result[3..length] ); 81 82 int openparenPos = std.string.find( result, "(" ); 83 if( openparenPos > 0 ) 84 { 85 char[][] splitModuleName = std.string.split( std.string.strip( result[0..openparenPos] ) ); 86 87 if( splitModuleName.length ) 88 { 89 result = splitModuleName[length-1]; 90 91 char[] path; 92 char[] baseName = std.path.getName( std.path.getBaseName( fileName ) ); 93 foreach( char[] s; std.string.split( result, "." ) ) 94 { 95 if( s != baseName ) 96 path = s ~ "\\"; 97 else 98 break; 99 } 100 101 path = path ~ std.path.getBaseName( fileName ); 102 103 foreach( char[] dir; Globals.debuggerSearchPath ) 104 { 105 baseName = std.path.join( dir, path ); 106 if( std.file.exists( baseName ) ) 107 { 108 fileName = baseName; 109 return true; 110 } 111 } 112 113 if( sGUI.packageExp.activeProject !is null ) 114 { 115 foreach( char[] dir; sGUI.packageExp.activeProject().projectIncludePaths ~ sGUI.packageExp.activeProject().scINIImportPath ) 116 { 117 baseName = std.path.join( dir, path ); 118 119 if( std.file.exists( baseName ) ) 120 { 121 fileName = baseName; 122 return true; 123 } 124 } 125 } 126 } 127 } 128 } 129 } 130 } 37 131 } 38 132 } trunk/current/poseidon/poseidon/controller/debugcontrol/pipe.d
r221 r244 50 50 if( Globals.edDebug > 0 ) sendCommand( "ed " ~ std.string.toString( Globals.edDebug ) ~ "\n" ); 51 51 if( Globals.elDebug > 0 ) sendCommand( "el " ~ std.string.toString( Globals.elDebug ) ~ "\n" ); 52 foreach( char[] s; Globals.debuggerSearchPath ) 53 { 54 sendCommand( "sp " ~ s ~ "\n" ); 55 } 52 56 } 53 57 else trunk/current/poseidon/poseidon/controller/debugcontrol/watch.d
r222 r244 768 768 void updateI18N(){ this.setText( Globals.getTranslation( "debug.bps" ) ); } 769 769 770 void add( char[] fullPath, int lineNum )770 void add( char[] fullPath, char[] moduleName, int lineNum ) 771 771 { 772 772 TableItem[] tis = table.getItems(); … … 774 774 if( !tis.length ) 775 775 { 776 add( fullPath, lineNum, 0 );776 add( fullPath, moduleName, lineNum, 0 ); 777 777 } 778 778 else … … 791 791 if( bGetID ) 792 792 { 793 add( fullPath, lineNum, i );793 add( fullPath, moduleName, lineNum, i ); 794 794 break; 795 795 } … … 798 798 } 799 799 800 void add( char[] fullPath, int lineNum, int id )800 void add( char[] fullPath, char[] moduleName, int lineNum, int id ) 801 801 { 802 802 TableItem item = new TableItem( table, DWT.NULL ); 803 803 item.setText( 0, std.string.toString( id ) ~ " " ); 804 item.setText( 1, std.path.getName( std.path.getBaseName( fullPath ) )~ " " );804 item.setText( 1, moduleName ~ " " ); 805 805 item.setText( 2, std.string.toString( lineNum ) ~ " " ); 806 806 item.setText( 3, fullPath ~ " " ); trunk/current/poseidon/poseidon/controller/dialog/aboutbox.d
r243 r244 38 38 with(label = new CLabel(top, DWT.CENTER)){ 39 39 //setText("Poseidon Editor for D v " ~ Globals.getVersionS()); 40 setText("Poseidon Editor for D rev.24 3" );40 setText("Poseidon Editor for D rev.244" ); 41 41 setForeground(color); 42 42 } trunk/current/poseidon/poseidon/controller/edititem.d
r242 r244 43 43 { 44 44 private import poseidon.controller.debugcontrol.debugparser; 45 private import poseidon.controller.ddoc.ddocparser; 45 46 46 47 Editor _parent; … … 597 598 private void onMouseDwellStart( SCNotifyEvent e ) 598 599 { 599 if( !sGUI.debuggerDMD.isRunning() ) return;600 //if( !sGUI.debuggerDMD.isRunning() ) return; 600 601 //if( !sGUI.packageExp.isFileInProjects( scintilla.getFileName() ) ) return; 601 602 602 if( iteminfo !is null )603 if( iteminfo.project.projectDir != sGUI.debuggerDMD.projectDir ) return;603 //if( iteminfo !is null ) 604 //if( iteminfo.project.projectDir != sGUI.debuggerDMD.projectDir ) return; 604 605 605 606 try … … 616 617 if( varName.length ) 617 618 { 618 char[] tempVarName = varName; 619 char[] type = CDebugParser.getType( tempVarName ); 620 621 if( !type.length ) 619 if( sGUI.debuggerDMD.isRunning() ) 622 620 { 623 type = CDebugParser.getType( "this." ~ tempVarName ); 624 if( type.length ) tempVarName = "this." ~ tempVarName;else return; 621 if( iteminfo !is null ) 622 if( iteminfo.project.projectDir != sGUI.debuggerDMD.projectDir ) return; 623 624 char[] tempVarName = varName; 625 char[] type = CDebugParser.getType( tempVarName ); 626 627 if( !type.length ) 628 { 629 type = CDebugParser.getType( "this." ~ tempVarName ); 630 if( type.length ) tempVarName = "this." ~ tempVarName;else return; 631 } 632 633 char[] value = CDebugParser.getValue( tempVarName, type, false, true ); 634 635 if( value.length > 3 ) 636 { 637 if( value.length > 15 ) 638 { 639 if( value[0..15] == "Unknown symbol " ) return; 640 if( value[0..15] == "invalid string:" ) return; 641 if( value[0..15] == "Parser: Invalid" ) return; 642 if( value[0..15] == "array cast misa" ) return; 643 } 644 645 scintilla.callTipSetBack( 0x99ffff ); 646 scintilla.callTipSetFore( 0x993300 ); 647 648 scintilla.callTipShow( pos, type ~ " " ~ varName ~ ( value.length? " = " ~ value[0..length-3] : "" ) ); 649 } 625 650 } 626 627 char[] value = CDebugParser.getValue( tempVarName, type, false, true ); 628 629 if( value.length > 3 ) 651 else 630 652 { 631 if( value.length > 15 ) 632 { 633 if( value[0..15] == "Unknown symbol " ) return; 634 if( value[0..15] == "invalid string:" ) return; 635 if( value[0..15] == "Parser: Invalid" ) return; 636 if( value[0..15] == "array cast misa" ) return; 637 } 638 639 scintilla.callTipSetBack( 0x99ffff ); 640 scintilla.callTipSetFore( 0x993300 ); 641 642 scintilla.callTipShow( pos, type ~ " " ~ varName ~ ( value.length? " = " ~ value[0..length-3] : "" ) ); 653 if( scintilla.getSelText.length ) return; 654 655 char[] fileFullPath, moduleName; 656 int lineNum; 657 CAnalyzerTreeNode resultNode; 658 659 scope dStyle = new DStyle; 660 dStyle.performJumpToDefintion( scintilla, pos, fileFullPath, moduleName, lineNum, resultNode ); 661 662 if( resultNode !is null ) 663 CDDocParser.showTip( scintilla, pos, CDDocParser.getText( resultNode ), 0x993300, 0x99ffff ); 643 664 } 644 665 } … … 646 667 catch( Exception e ) 647 668 { 648 MessageBox.showMessage( "Scintilla MouseDwell Error!! \n" ~ e.toString );669 //MessageBox.showMessage( "Scintilla MouseDwell Error!! \n" ~ e.toString ); 649 670 } 650 671 } … … 1042 1063 else 1043 1064 { 1044 sGUI.debuggerDMD.addBP_editor( getFileName(), lineNumber + 1 );1065 sGUI.debuggerDMD.addBP_editor( getFileName(), lineNumber + 1, sGUI.packageExp.getActiveProjectDir ); 1045 1066 scintilla.markerAdd( lineNumber, Editor.MARK_DEBUGSYMBOLE ); 1046 1067 } … … 1137 1158 case "debug_stop" : return &_debug_stop; 1138 1159 case "debug_clean_bps" : return &_debug_cleanbps; 1160 1161 case "document0" : return &_document0; 1162 case "document1" : return &_document1; 1163 case "document2" : return &_document2; 1164 case "document3" : return &_document3; 1165 case "document4" : return &_document4; 1139 1166 1140 1167 // others … … 1165 1192 scope dStyle = new DStyle; 1166 1193 1167 char[] fileFullPath; 1168 int lineNum; 1169 1170 dStyle.performJumpToDefintion( scintilla, fileFullPath, lineNum ); 1194 char[] fileFullPath, moduleName; 1195 int lineNum; 1196 CAnalyzerTreeNode resultNode; 1197 1198 dStyle.performJumpToDefintion( scintilla, -1, fileFullPath, moduleName, lineNum, resultNode ); 1171 1199 1172 1200 //MessageBox.showMessage( "name = " ~ fileFullPath ~ "\n" ~ std.string.toString( lineNum ) ); … … 1178 1206 } 1179 1207 1180 if( std.file.exists( fileFullPath ) ) sGUI.packageExp.openFile( fileFullPath, lineNum - 1, true ); 1208 if( std.file.exists( fileFullPath ) ) 1209 sGUI.packageExp.openFile( fileFullPath, lineNum - 1, true ); 1210 else 1211 { 1212 // Maybe fileFullPath in default parser not exist, check import paths... 1213 if( sGUI.packageExp.activeProject !is null && moduleName.length ) 1214 { 1215 foreach( char[] path; sGUI.packageExp.activeProject().projectIncludePaths ~ sGUI.packageExp.activeProject().scINIImportPath ) 1216 { 1217 char[] name = std.string.replace( moduleName, ".", "\\" ); 1218 name = std.path.join( path, name );// ~".d"; 1219 1220 if( std.file.exists( name ~ ".di" ) ) 1221 { 1222 sGUI.packageExp.openFile( name ~ ".di", lineNum - 1, true ); 1223 break; 1224 } 1225 else if( std.file.exists( name ~ ".d" ) ) 1226 { 1227 sGUI.packageExp.openFile( name ~ ".d", lineNum - 1, true ); 1228 break; 1229 } 1230 } 1231 } 1232 } 1181 1233 } 1182 1234 … … 1279 1331 private void _closeCurrentFile(){ this.close( true ); } 1280 1332 1333 private void _document0(){ sActionMan.actionDDocumentFile( 0 ); } 1334 1335 private void _document1(){ sActionMan.actionDDocumentFile( 1 ); } 1336 1337 private void _document2(){ sActionMan.actionDDocumentFile( 2 ); } 1338 1339 private void _document3(){ sActionMan.actionDDocumentFile( 3 ); } 1340 1341 private void _document4(){ sActionMan.actionDDocumentFile( 4 ); } 1342 1281 1343 private char Eofline() 1282 1344 { trunk/current/poseidon/poseidon/controller/menumanager.d
r238 r244 20 20 Menu recentMenu; 21 21 Menu projectMenu; 22 private Menu documentMenu; 22 23 23 24 public MenuItem saveItem, saveasItem, saveallItem, closefileItem, closeprjItem, closeallprjItem, … … 27 28 compileItem, runItem, buildItem, build_runItem, rebuildItem, BudItem, cleanItem, 28 29 debugItem, debugbuildItem, debuginItem, debugrunItem, debugoverItem, debugreturnItem, debugstopItem, debugcleanbpsItem, 29 encodeItem ;30 encodeItem, documentItem; 30 31 31 32 // static properties … … 621 622 622 623 /// help.document 623 with( new MenuItem(menu, DWT.PUSH)){624 setData(LANG_ID," cp.doc");624 with( documentItem = new MenuItem(menu, DWT.CASCADE)){ 625 setData(LANG_ID,"gp.doc"); 625 626 setImage(Globals.getImage( "help_link" ) ); 626 627 handleEvent(this, DWT.Selection, delegate(Event e){ 627 sActionMan.actionDDocumentFile(); 628 }); 629 } 628 }); 629 } 630 documentMenu = DocumentMenu(documentItem); 631 documentItem.setMenu(documentMenu); 630 632 631 633 new MenuItem(menu, DWT.SEPARATOR); … … 677 679 } 678 680 return menu; 679 } 681 } 682 683 protected Menu DocumentMenu(MenuItem item) 684 { 685 Menu menu = new Menu(item); 686 687 _ShortCut[] hotkeys = Globals.hotkeys; 688 char[][5] shortCutName; 689 690 for( int i =0; i < hotkeys.length; ++ i ) 691 { 692 if( hotkeys[i].name == "document0" ) 693 shortCutName[0] = hotkeys[i].keyname; 694 else if( hotkeys[i].name == "document1" ) 695 shortCutName[1] = hotkeys[i].keyname; 696 else if( hotkeys[i].name == "document2" ) 697 shortCutName[2] = hotkeys[i].keyname; 698 else if( hotkeys[i].name == "document3" ) 699 shortCutName[3] = hotkeys[i].keyname; 700 else if( hotkeys[i].name == "document4" ) 701 shortCutName[4] = hotkeys[i].keyname; 702 } 703 704 705 for( int i = 0; i < Globals.DDcoumentDir.length; ++ i ) 706 { 707 if( !Globals.DDcoumentDir[i].length ) continue; 708 MenuItem mi = new MenuItem(menu, DWT.PUSH); 709 mi.setText( std.string.ljustify( "#" ~ std.string.toString(i) ~ " " ~ Globals.DDcoumentDir[i] , 50 ) ~ shortCutName[i] ); 710 711 mi.handleEvent(null, DWT.Selection, delegate(Event e) 712 { 713 MenuItem pItem = cast(MenuItem) e.widget; 714 char[] text = pItem.getText(); 715 int posSpace = std.string.find( text, " " ); 716 int posNum = std.string.find( text, "#" ); 717 if( posSpace > posNum + 1 ) text = text[posNum+1..posSpace]; else text = ""; 718 if( text.length) 719 sActionMan.actionDDocumentFile( std.string.atoi( text ) ); 720 }); 721 } 722 return menu; 723 } 680 724 681 725 protected Menu getRecentPrjMenu() { … … 866 910 } 867 911 } 912 913 void refreshDocumentHelp() 914 { 915 if( documentMenu !is null ) delete documentMenu; 916 documentMenu = DocumentMenu(documentItem); 917 documentItem.setMenu(documentMenu); 918 } 868 919 } trunk/current/poseidon/poseidon/controller/packageexplorer.d
r242 r244 1073 1073 ItemInfo info = pThis.getSelection(); 1074 1074 1075 auto dlg = new CResourceCompilerDialog( pthis.getShell(), "Resource Compiler....", info.getFileName ); 1076 1077 dlg.setValidateDelegate(&_validateString); 1078 dlg.setText( "Compile Resource......" );//(Globals.getTranslation("new_file")); 1079 char[] filename = dlg.open(); 1075 auto dlg = new CResourceCompilerDialog( pthis.getShell(), Globals.getTranslation( "pp2.rc" ), info.getFileName ); 1076 char[] command = dlg.open(); 1077 1078 sActionMan.actionRCCompile( info.getFileName, command ); 1080 1079 }); 1081 1080 } trunk/current/poseidon/poseidon/controller/property/compilerpage.d
r240 r244 18 18 class CompilerPage : AbstractPage 19 19 { 20 private Text txtDMDPath, txtDMCPath, txtBudTool, txtDebugger, txtDDocument, txtED, txtEL; 21 private Button btnUseThreadBuild; 22 private Shell shell; 23 24 this( Composite parent, IPropertyPage parentPage, void delegate(bool) dirtyListener ) 25 { 26 super( parent, parentPage, dirtyListener ); 27 shell = parent.getShell(); 28 initGUI(); 29 } 30 31 public void applyChanges() 32 { 33 Globals.DMDPath = std.string.strip( txtDMDPath.getText() ); 34 Globals.DMCPath = std.string.strip( txtDMCPath.getText() ); 35 Globals.BudExe = std.string.strip( txtBudTool.getText() ); 36 Globals.DebuggerExe = std.string.strip( txtDebugger.getText() ); 37 Globals.DDcoumentDir = std.string.strip( txtDDocument.getText() ); 38 39 if( btnUseThreadBuild.getSelection() ) Globals.backBuild = 1; else Globals.backBuild = 0; 40 41 int ed = std.string.atoi( std.string.strip( txtED.getText() ) ); 42 if( ed >= 0 ) Globals.edDebug = ed; 43 44 int el = std.string.atoi( std.string.strip( txtEL.getText() ) ); 45 if( el >= 0 ) Globals.elDebug = el; 46 47 setDirty( false ); 48 } 49 50 public char[] getTitle() 51 { 52 return Globals.getTranslation( "pref.compiler" ); 53 } 54 55 private void initGUI() 20 private: 21 import std.string; 22 23 Text txtDMDPath, txtDMCPath, txtBudTool, txtDebugger, txtRC, txtED, txtEL; 24 Button btnUseThreadBuild; 25 Shell shell; 26 List listSearchPath; 27 28 29 bool hasSelect( List activeList ) 30 { 31 if( activeList.getItemCount() == 0 ) return false; 32 if( activeList.getFocusIndex() == -1 ) return false; 33 if( activeList.getSelectionCount == 0 ) return false; 34 35 return true; 36 } 37 38 void touchDel( Event e ) 39 { 40 if( hasSelect( listSearchPath ) ) 41 { 42 listSearchPath.remove( listSearchPath.getSelectionIndices() ); 43 setDirty( true ); 44 } 45 } 46 47 void touchEdit( Event e ) 48 { 49 if( hasSelect( listSearchPath ) ) 50 { 51 scope dlg = new EditDlg( getShell(), 0, null, Globals.getTranslation( "diag.title8_1" ), listSearchPath.getItem( listSearchPath.getFocusIndex() ) ); 52 char[] str = std.string.strip( dlg.open() ); 53 54 if( !str.length ) return; 55 56 int index = listSearchPath.getFocusIndex(); 57 listSearchPath.setItem( index, str ); 58 listSearchPath.deselectAll(); 59 listSearchPath.select( index ); 60 setDirty( true ); 61 } 62 } 63 64 void touchAdd( Event e ) 65 { 66 scope dlg = new EditDlg( getShell(), 0, null, Globals.getTranslation( "diag.title8" ), null ); 67 char[] str = std.string.strip( dlg.open() ); 68 char[][] files = std.string.split( str, ";" ); 69 foreach( char[] s; files ) 70 listSearchPath.add( s ); 71 72 listSearchPath.setTopIndex( listSearchPath.getItemCount()); 73 listSearchPath.deselectAll(); 74 listSearchPath.select( listSearchPath.getItemCount() - files.length ,listSearchPath.getItemCount() - 1 ); 75 setDirty( true ); 76 } 77 78 void onUp( Event e ) 79 { 80 with( listSearchPath ) 81 { 82 if( getItemCount() == 0 ) return; 83 if( getFocusIndex() == -1 ) return; 84 if( getSelectionCount() == 0 ) return; 85 86 int index = getSelectionIndex(); 87 if( index <= 0 ) 88 return; 89 else 90 swapListItem( listSearchPath, index, index - 1 ); 91 92 setDirty( true ); 93 } 94 } 95 96 void onDown( Event e ) 97 { 98 with( listSearchPath ) 99 { 100 if( getItemCount() == 0 ) return; 101 if( getFocusIndex() == -1 ) return; 102 if( getSelectionCount() == 0 ) return; 103 104 int index = getSelectionIndex(); 105 if( getItemCount() <= index ) 106 return; 107 else 108 swapListItem( listSearchPath, index, index + 1 ); 109 110 setDirty( true ); 111 } 112 } 113 114 void swapListItem( List activeList, int a, int b ) 115 { 116 if( activeList is null ) return; 117 118 with( activeList ) 119 { 120 char[] temp = getItem( a ); 121 setItem( a, getItem( b ) ); 122 setItem( b, temp ); 123 setSelection( b ); 124 } 125 } 126 127 void onAction( Event e ) 128 { 129 setDirty(true); 130 } 131 132 char[] browseDir() 133 { 134 scope wc = new WaitCursor(shell); 135 136 scope dlg = new DirectoryDialog( shell, DWT.OPEN ); 137 dlg.setFilterPath(Globals.recentDir); 138 return dlg.open(); 139 } 140 141 char[] browseFile( char[] fileExt = "*.exe" ) 142 { 143 scope wc = new WaitCursor(shell); 144 145 scope dlg = new FileDialog( shell, DWT.OPEN ); 146 147 char[][] FileExtensions; 148 FileExtensions ~= fileExt; 149 150 dlg.setFilterPath( Globals.recentDir ); 151 dlg.setFilterExtensions( FileExtensions ); 152 return dlg.open(); 153 } 154 155 156 void onBrowseDirDMD( Event e ) 157 { 158 char[] fullpath = browseDir(); 159 if ( fullpath ) txtDMDPath.setText( fullpath ); 160 } 161 162 void onBrowseDirDMC( Event e ) 163 { 164 char[] fullpath = browseDir(); 165 if ( fullpath ) txtDMCPath.setText( fullpath ); 166 } 167 168 void onBrowseBud( Event e ) 169 { 170 char[] fullpath = browseFile(); 171 if ( fullpath ) txtBudTool.setText( fullpath ); 172 } 173 174 void onBrowseDebugger( Event e ) 175 { 176 char[] fullpath = browseFile(); 177 if ( fullpath ) txtDebugger.setText( fullpath ); 178 } 179 180 void onBrowseRC( Event e ) 181 { 182 char[] fullpath = browseFile(); 183 if( fullpath.length ) txtRC.setText( fullpath ); 184 } 185 186 187 void initGUI() 56 188 { 57 189 setLayout( LayoutShop.createGridLayout( 1 ) ); … … 145 277 } 146 278 279 // RC 280 with( new Label( compilerGroup, DWT.NONE ) ) 281 { 282 setText( Globals.getTranslation("cp.rc_path") ); 283 } 284 285 with( txtRC = new Text( compilerGroup, DWT.BORDER ) ) 286 { 287 setLayoutData( new GridData( GridData.FILL, GridData.BEGINNING, true, false, 1, 1 ) ); 288 setText( Globals.RCExe ); 289 handleEvent( null, DWT.Modify, &onAction ); 290 } 291 292 // RC button 293 with( new Button( compilerGroup, DWT.PUSH ) ) 294 { 295 setText( "..." ); 296 handleEvent( null, DWT.Selection, &onBrowseRC ); 297 } 298 299 147 300 // horizontal line 148 301 with( new Label( compilerGroup, DWT.SEPARATOR | DWT.HORIZONTAL ) ) … … 150 303 151 304 152 // D Document153 with( new Label( compilerGroup, DWT.NONE ) ){ setText( Globals.getTranslation("cp.doc") ); }154 155 with( txtDDocument = new Text( compilerGroup, DWT.BORDER ) )156 {157 setLayoutData( new GridData( GridData.FILL, GridData.BEGINNING, true, false, 1, 1 ) );158 setText( Globals.DDcoumentDir );159 handleEvent( null, DWT.Modify, &onAction );160 }161 162 // D Dcoument button163 with( new Button( compilerGroup, DWT.PUSH ) )164 {165 setText( "..." );166 handleEvent( null, DWT.Selection, &onBrowseDDocument );167 }168 169 // horizontal line170 with( new Label( compilerGroup, DWT.SEPARATOR | DWT.HORIZONTAL ) )171 setLayoutData( new GridData( GridData.FILL, GridData.CENTER, true, false, 3, 1 ) );172 173 305 with( btnUseThreadBuild = new Button( compilerGroup, DWT.CHECK ) ) 174 306 { … … 210 342 if( Globals.elDebug > 0 ) txtEL.setText( std.string.toString( Globals.elDebug ) ); 211 343 txtEL.handleEvent(null, DWT.KeyDown, &onAction); 212 txtEL.setLayoutData( new GridData( GridData.FILL, GridData.CENTER, true, false, 1, 1 ) ); 213 } 214 215 public void restoreDefaults() 344 txtEL.setLayoutData( new GridData( GridData.FILL, GridData.CENTER, true, false, 1, 1 ) ); 345 346 Group searchGroup = new Group( ddbgGroup, DWT.NONE ); 347 searchGroup.setText( Globals.getTranslation( "pap.path" ) ); 348 gridLayout = new GridLayout(); 349 gridLayout.numColumns = 5; 350 searchGroup.setLayout( gridLayout ); 351 gridData = new GridData( GridData.FILL_HORIZONTAL ); 352 gridData.horizontalSpan = 2; 353 searchGroup.setLayoutData( gridData ); 354 355 with( listSearchPath = new List( searchGroup, DWT.BORDER | DWT.MULTI | DWT.V_SCROLL ) ) 356 { 357 GridData innergridData = new GridData( GridData.FILL, GridData.BEGINNING, true, false, 5, 5 ); 358 scope font = new Font( display, "Verdana", 8, DWT.NORMAL ); 359 setFont( font ); 360 361 int ListHeight = getItemHeight() * 6; 362 Rectangle trim = computeTrim( 0, 0, 0, ListHeight ); 363 innergridData.heightHint = trim.height; 364 setLayoutData( innergridData ); 365 } 366 367 if( Globals.debuggerSearchPath ) listSearchPath.setItems( Globals.debuggerSearchPath ); 368 369 // Buttons 370 with( new Button( searchGroup, DWT.FLAT ) ) 371 { 372 setImage( Globals.getImage("add_obj") ); 373 setToolTipText( Globals.getTranslation( "pp.add" ) ); 374 setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) ); 375 handleEvent( null, DWT.Selection, &touchAdd ); 376 } 377 378 with( new Button( searchGroup, DWT.FLAT ) ) 379 { 380 setImage( Globals.getImage("delete_obj") ); 381 setToolTipText( Globals.getTranslation( "pp.delete" ) ); 382 setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) ); 383 handleEvent( null, DWT.Selection, &touchDel ); 384 } 385 386 with( new Button( searchGroup, DWT.FLAT ) ) 387 { 388 setImage( Globals.getImage("write_obj") ); 389 setToolTipText( Globals.getTranslation( "pp.edit" ) ); 390 setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) ); 391 handleEvent( null, DWT.Selection, &touchEdit ); 392 } 393 394 with( new Button( searchGroup, DWT.FLAT ) ) 395 { 396 setImage( Globals.getImage("prev_nav") ); 397 setToolTipText( Globals.getTranslation( "pp.moveup" ) ); 398 setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) ); 399 handleEvent( null, DWT.Selection, &onUp ); 400 } 401 402 with( new Button( searchGroup, DWT.FLAT ) ) 403 { 404 setImage( Globals.getImage("next_nav") ); 405 setToolTipText( Globals.getTranslation( "pp.movedown" ) ); 406 setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) ); 407 handleEvent( null, DWT.Selection, &onDown ); 408 } 409 } 410 411 public: 412 413 this( Composite parent, IPropertyPage parentPage, void delegate(bool) dirtyListener ) 414 { 415 super( parent, parentPage, dirtyListener ); 416 shell = parent.getShell(); 417 initGUI(); 418 } 419 420 void applyChanges() 421 { 422 Globals.DMDPath = std.string.strip( txtDMDPath.getText() ); 423 Globals.DMCPath = std.string.strip( txtDMCPath.getText() ); 424 Globals.BudExe = std.string.strip( txtBudTool.getText() ); 425 Globals.DebuggerExe = std.string.strip( txtDebugger.getText() ); 426 Globals.RCExe = std.string.strip( txtRC.getText() ); 427 428 if( btnUseThreadBuild.getSelection() ) Globals.backBuild = 1; else Globals.backBuild = 0; 429 430 int ed = std.string.atoi( std.string.strip( txtED.getText() ) ); 431 if( ed >= 0 ) Globals.edDebug = ed; 432 433 int el = std.string.atoi( std.string.strip( txtEL.getText() ) ); 434 if( el >= 0 ) Globals.elDebug = el; 435 436 Globals.debuggerSearchPath = listSearchPath.getItems(); 437 438 setDirty( false ); 439 } 440 441 char[] getTitle() 442 { 443 return Globals.getTranslation( "pref.compiler" ); 444 } 445 446 void restoreDefaults() 216 447 { 217 448 txtDMDPath.setText( "" ); 218 449 txtDMCPath.setText( "" ); 219 450 txtDebugger.setText( "" ); 220 txt DDocument.setText( "" );451 txtRC.setText( "" ); 221 452 btnUseThreadBuild.setSelection( false ); 222 453 223 454 txtED.setText( "" ); 224 455 txtEL.setText( "" ); 225 226 setDirty(true); 227 } 228 229 230 private void onAction( Event e ) 231 { 232 setDirty(true); 233 } 234 235 private char[] browseDir() 236 { 237 scope wc = new WaitCursor(shell); 238 239 scope dlg = new DirectoryDialog( shell, DWT.OPEN ); 240 dlg.setFilterPath(Globals.recentDir); 241 return dlg.open(); 242 } 243 244 private char[] browseFile( char[] fileExt = "*.exe" ) 245 { 246 scope wc = new WaitCursor(shell); 247 248 scope dlg = new FileDialog( shell, DWT.OPEN ); 249 250 char[][] FileExtensions; 251 FileExtensions ~= fileExt; 252 253 dlg.setFilterPath( Globals.recentDir ); 254 dlg.setFilterExtensions( FileExtensions ); 255 return dlg.open(); 256 } 257 258 259 private void onBrowseDirDMD( Event e ) 260 { 261 char[] fullpath = browseDir(); 262 if ( fullpath ) txtDMDPath.setText( fullpath ); 263 } 264 265 private void onBrowseDirDMC( Event e ) 266 { 267 char[] fullpath = browseDir(); 268 if ( fullpath ) txtDMCPath.setText( fullpath ); 269 } 270 271 private void onBrowseBud( Event e ) 272 { 273 char[] fullpath = browseFile(); 274 if ( fullpath ) txtBudTool.setText( fullpath ); 275 } 276 277 private void onBrowseDebugger( Event e ) 278 { 279 char[] fullpath = browseFile(); 280 if ( fullpath ) txtDebugger.setText( fullpath ); 281 } 282 283 private void onBrowseDDocument( Event e ) 284 { 285 char[] fullpath = browseFile( "*.*" ); 286 if ( fullpath ) txtDDocument.setText( fullpath ); 287 } 288 456 457 listSearchPath.removeAll(); 458 459 setDirty( true ); 460 } 289 461 } trunk/current/poseidon/poseidon/controller/property/generalpage.d
r240 r244 14 14 class GeneralPage : AbstractPage 15 15 { 16 private Button chkShowSplash, chkLoadWorkspace, chkUseOutputWrap ;16 private Button chkShowSplash, chkLoadWorkspace, chkUseOutputWrap, chkAbsoluteFullpath; 17 17 private Text txtExplorerFilters; 18 private Text[5] txtDDocuments; 19 private import std.string; 18 20 19 21 … … 29 31 Globals.loadWorkSpaceAtStart = chkLoadWorkspace.getSelection(); 30 32 if( chkUseOutputWrap.getSelection() ) Globals.outputWRAP = DWT.WRAP; else Globals.outputWRAP = 0; 33 Globals.sendAbsoluteFullpath = chkAbsoluteFullpath.getSelection(); 31 34 Globals.SplitedExplorerFilter = poseidon.util.miscutil.MiscUtil.getSplitFilter( std.string.strip( txtExplorerFilters.getText() ) ); 35 Globals.DDcoumentDir.length = 0; 36 for( int i = 0; i < 5; ++ i ) 37 Globals.DDcoumentDir ~= txtDDocuments[i].getText(); 38 39 sGUI.menuMan.refreshDocumentHelp(); 32 40 33 41 setDirty(false); … … 56 64 chkLoadWorkspace = createCheckBox("gp.ld_wspace", Globals.loadWorkSpaceAtStart); 57 65 chkUseOutputWrap = createCheckBox("gp.wrap", Globals.outputWRAP ); 66 chkAbsoluteFullpath = createCheckBox("gp.absolute", Globals.sendAbsoluteFullpath ); 67 68 Group documentGroup = new Group( this, DWT.NONE ); 69 documentGroup.setText( Globals.getTranslation( "gp.doc_title" ) ); 70 auto gridLayout = new GridLayout(); 71 gridLayout.numColumns = 3; 72 documentGroup.setLayout( gridLayout ); 73 documentGroup.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) ); 74 75 // D Document 76 for( int i = 0; i < 5; ++ i ) 77 { 78 char[] s = " #" ~ std.string.toString( i ) ~ ":"; 79 with( new Label( documentGroup, DWT.NONE ) ){ setText( Globals.getTranslation("gp.doc") ~ s ); } 80 81 with( txtDDocuments[i] = new Text( documentGroup, DWT.BORDER ) ) 82 { 83 setLayoutData( new GridData( GridData.FILL, GridData.BEGINNING, true, false, 1, 1 ) ); 84 if( Globals.DDcoumentDir.length > i ) setText( Globals.DDcoumentDir[i] ); 85 handleEvent( null, DWT.Modify, &onAction ); 86 } 87 88 // D Dcoument button 89 with( new Button( documentGroup, DWT.PUSH ) ) 90 { 91 setText( "..." ); 92 setData( txtDDocuments[i] ); 93 handleSelection( this, delegate( SelectionEvent e ) 94 { 95 GeneralPage pThis = cast(GeneralPage)e.cData; 96 Button pButton = cast(Button) e.widget; 97 98 scope dlg = new FileDialog( pThis.getShell, DWT.OPEN ); 99 100 dlg.setFilterPath( Globals.recentDir ); 101 dlg.setFilterExtensions( ["*.*"] ); 102 Text text = cast(Text) pButton.getData(); 103 104 text.setText( strip( dlg.open() ) ); 105 106 setDirty(true); 107 }); 108 } 109 } 58 110 59 111 Group explorerGroup = new Group( this, DWT.NONE ); 60 112 explorerGroup.setText( Globals.getTranslation( "gp.filter" ) ); 61 autogridLayout = new GridLayout();113 gridLayout = new GridLayout(); 62 114 gridLayout.numColumns = 1; 63 115 explorerGroup.setLayout( gridLayout ); 64 GridData gridData = new GridData( GridData.FILL_HORIZONTAL ); 65 explorerGroup.setLayoutData( gridData ); 66 116 explorerGroup.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) ); 67 117 68 118 with( txtExplorerFilters = new Text( explorerGroup, DWT.BORDER ) ) … … 71 121 setText( poseidon.util.miscutil.MiscUtil.getFilter( Globals.SplitedExplorerFilter ) ); 72 122 handleEvent( null, DWT.Modify, &onAction ); 73 } 123 } 74 124 } 75 125 … … 84 134 chkLoadWorkspace.setSelection( true ); 85 135 chkUseOutputWrap.setSelection( true ); 136 chkAbsoluteFullpath.setSelection( false ); 137 for( int i = 0; i < 5; ++ i ) 138 txtDDocuments[i].setText( "" ); 139 86 140 txtExplorerFilters.setText( "*.c;*.cpp;*.h;*.xml;*.txt;*.def" ); 87 141 trunk/current/poseidon/poseidon/controller/property/preference.d
r227 r244 149 149 // seem too long, decrease the height 150 150 Point pt = shell.getSize(); 151 pt.y -= 18 5;151 pt.y -= 180; 152 152 pt.x = pt.y * 10 / 11; 153 153 shell.setSize(pt); … … 185 185 186 186 private void onClose(Event e) { 187 187 /+ 188 188 foreach(IPropertyPage page; pages) 189 189 { … … 191 191 page.applyChanges(); 192 192 } 193 +/ 193 194 194 195 if(font) trunk/current/poseidon/poseidon/controller/property/rescompilerpage.d
r242 r244 7 7 { 8 8 private: 9 9 import std.string; 10 10 import dwt.all; 11 11 import poseidon.globals; … … 14 14 import poseidon.util.layoutshop; 15 15 import poseidon.util.miscutil; 16 17 18 Text txt; 16 import poseidon.model.project; 17 18 19 20 Text txtSource, txtDest, txtCommand; 21 Table tableOption; 22 List listImport; 23 Button btnOK; 24 19 25 char[] title; 20 26 char[] iniString; 21 boolean delegate(char[] str) _validate = null; 22 Button btnOK; 23 24 25 void onOK() { 26 char[] str = txt.getText(); 27 if(_validate && !_validate(str)){ 28 MessageBox.showMessage(Globals.getTranslation("mb.invalid_string"), Globals.getTranslation("ERROR"), getShell(), DWT.ICON_ERROR); 29 return; 30 } 31 if(str.length == 0){ 32 // the caller may check the return value against null instead of its length 33 str = null; 34 } 35 result = str; 36 27 28 29 void onOK() 30 { 31 char[] command = std.string.strip( txtCommand.getText() ); 32 if( !command.length ) 33 { 34 foreach( char[] s; listImport.getItems() ) 35 command ~= ( "-I " ~ std.string.strip( s ) ); 36 37 if( command.length) command ~= " "; 38 39 foreach( TableItem ti; tableOption.getItems() ) 40 { 41 if( ti.getChecked() ) 42 command ~= ( Project.getBracketText( ti.getText( 0 ) ) ~ " " ); 43 } 44 45 if( command.length) command = "-r " ~ command ~ " "; 46 47 command ~= ( std.string.strip( txtSource.getText ) ~ " " ~ std.string.strip( txtDest.getText ) ); 48 } 49 50 result = command; 37 51 getShell().close(); 38 52 } 39 53 40 54 void onCancel(){} 55 56 bool hasSelect( List activeList ) 57 { 58 if( activeList.getItemCount() == 0 ) return false; 59 if( activeList.getFocusIndex() == -1 ) return false; 60 if( activeList.getSelectionCount == 0 ) return false; 61 62 return true; 63 } 64 65 void touchDel( Event e ) 66 { 67 if( hasSelect( listImport ) ) listImport.remove( listImport.getSelectionIndices() ); 68 } 69 70 void touchEdit( Event e ) 71 { 72 if( hasSelect( listImport ) ) 73 { 74 scope dlg = new EditDlg( getShell(), 0, null, Globals.getTranslation( "diag.title1_1" ), listImport.getItem( listImport.getFocusIndex() ) ); 75 char[] str = std.string.strip( dlg.open() ); 76 77 if( !str.length ) return; 78 79 int index = listImport.getFocusIndex(); 80 listImport.setItem( index, str ); 81 listImport.deselectAll(); 82 listImport.select( index ); 83 } 84 } 85 86 void touchAdd( Event e ) 87 { 88 scope dlg = new EditDlg( getShell(), 0, null, Globals.getTranslation( "diag.title1" ), null ); 89 char[] str = std.string.strip( dlg.open() ); 90 char[][] files = std.string.split( str, ";" ); 91 foreach( char[] s; files ) 92 listImport.add( s ); 93 94 listImport.setTopIndex( listImport.getItemCount()); 95 listImport.deselectAll(); 96 listImport.select( listImport.getItemCount() - files.length ,listImport.getItemCount() - 1 ); 97 } 98 99 void onUp( Event e ) 100 { 101 with( listImport ) 102 { 103 if( getItemCount() == 0 ) return; 104 if( getFocusIndex() == -1 ) return; 105 if( getSelectionCount() == 0 ) return; 106 107 int index = getSelectionIndex(); 108 if( index <= 0 ) 109 return; 110 else 111 swapListItem( listImport, index, index - 1 ); 112 } 113 } 114 115 void onDown( Event e ) 116 { 117 with( listImport ) 118 { 119 if( getItemCount() == 0 ) return; 120 if( getFocusIndex() == -1 ) return; 121 if( getSelectionCount() == 0 ) return; 122 123 int index = getSelectionIndex(); 124 if( getItemCount() <= index ) 125 return; 126 else 127 swapListItem( listImport, index, index + 1 ); 128 } 129 } 130 131 private void swapListItem( List activeList, int a, int b ) 132 { 133 if( activeList is null ) return; 134 135 with( activeList ) 136 { 137 char[] temp = getItem( a ); 138 setItem( a, getItem( b ) ); 139 setItem( b, temp ); 140 setSelection( b ); 141 } 142 } 143 41 144 42 145 protected: 43 146 Shell createShell(Shell parent) 44 147 { 45 Shell shell = new Shell(parent, DWT.DIALOG_TRIM | DWT.APPLICATION_MODAL); 46 GridLayout layout = new GridLayout(3, true);148 Shell shell = new Shell(parent, DWT.DIALOG_TRIM | DWT.APPLICATION_MODAL); 149 GridLayout layout = new GridLayout(3, 0); 47 150 shell.setLayout(layout); 48 49 /*50 with(layout){51 // numColumns = 2;52 // marginLeft = 20;53 // marginRight = 20;54 // marginTop = 20;55 // marginBottom = 20;56 marginHeight = 16;57 marginWidth = 24;58 horizontalSpacing = 24;59 verticalSpacing = 8;60 }61 */62 63 with( new Label(shell, DWT.NONE) )64 {65 setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 3, 1));66 setText( "Source File : " ~ iniString );67 }68 151 69 152 with( new Label(shell, DWT.NONE) ) … … 74 157 75 158 76 77 78 79 80 81 txt = new Text(shell, DWT.SINGLE | DWT.BORDER); 82 txt.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 3, 1)); 83 txt.handleEvent(null, DWT.Modify, &onModify); 84 85 159 Group resOptionsGroup = new Group( shell, DWT.NONE ); 160 resOptionsGroup.setText( Globals.getTranslation( "pp2.rcoptions" ) ); 161 auto gridLayout = new GridLayout(); 162 gridLayout.numColumns = 1; 163 resOptionsGroup.setLayout( gridLayout ); 164 GridData gridData = new GridData( GridData.FILL_HORIZONTAL ); 165 gridData.horizontalSpan = 3; 166 resOptionsGroup.setLayoutData( gridData ); 167 168 169 with( tableOption = new Table( resOptionsGroup, DWT.BORDER | DWT.CHECK ) ) 170 { 171 GridData innergridData = new GridData( GridData.FILL, GridData.BEGINNING, true, false, 1, 1 ); 172 scope font = new Font( display, "Verdana", 8, DWT.NORMAL ); 173 setFont( font ); 174 175 int ListHeight = getItemHeight() * 6; 176 Rectangle trim = computeTrim( 0, 0, 0, ListHeight ); 177 innergridData.heightHint = trim.height; 178 setLayoutData( innergridData ); 179 handleEvent( null, DWT.Selection, delegate( Event e ) 180 { 181 TableItem item = cast(TableItem) e.item; 182 if( item !is null ) 183 { 184 with( item ) 185 { 186 if( getChecked() ) 187 { 188 scope color = new Color( display, 0x99, 0xff, 0x66 ); 189 setBackground( 0, color ); 190 } 191 else 192 setBackground( 0, null ); 193 } 194 } 195 } 196 ); 197 } 198 199 for( int i = 0; i < 50; ++ i ) 200 { 201 char[] beTransOptionName = "pp2.rc_o" ~ std.string.toString( i ); 202 char[] optionName = Globals.getTranslation( beTransOptionName ); 203 204 if( beTransOptionName == optionName ) break; 205 206 with( new TableItem( tableOption, DWT.NULL ) ) 207 { 208 setText( optionName ); 209 /* 210 setChecked( bChecked ); 211 212 if( bChecked ) 213 { 214 scope color = new Color( display, 0x99, 0xff, 0x66 ); 215 setBackground( 0, color ); 216 } 217 */ 218 } 219 } 220 221 222 Group importGroup = new Group( shell, DWT.NONE ); 223 importGroup.setText( Globals.getTranslation( "pp1.directory" ) ); 224 gridLayout = new GridLayout(); 225 gridLayout.numColumns = 5; 226 importGroup.setLayout( gridLayout ); 227 gridData = new GridData( GridData.FILL_HORIZONTAL ); 228 gridData.horizontalSpan = 3; 229 importGroup.setLayoutData( gridData ); 230 231 with( listImport = new List( importGroup, DWT.BORDER | DWT.MULTI | DWT.V_SCROLL ) ) 232 { 233 GridData innergridData = new GridData( GridData.FILL, GridData.BEGINNING, true, false, 5, 5 ); 234 scope font = new Font( display, "Verdana", 8, DWT.NORMAL ); 235 setFont( font ); 236 237 int ListHeight = getItemHeight() * 9; 238 Rectangle trim = computeTrim( 0, 0, 0, ListHeight ); 239 innergridData.heightHint = trim.height; 240 setLayoutData( innergridData ); 241 } 242 243 // Buttons 244 with( new Button( importGroup, DWT.FLAT ) ) 245 { 246 setImage( Globals.getImage("add_obj") ); 247 setToolTipText( Globals.getTranslation( "pp.add" ) ); 248 setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) ); 249 handleEvent( null, DWT.Selection, &touchAdd ); 250 } 251 252 with( new Button( importGroup, DWT.FLAT ) ) 253 { 254 setImage( Globals.getImage("delete_obj") ); 255 setToolTipText( Globals.getTranslation( "pp.delete" ) ); 256 setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) ); 257 handleEvent( null, DWT.Selection, &touchDel ); 258 } 259 260 with( new Button( importGroup, DWT.FLAT ) ) 261 { 262 setImage( Globals.getImage("write_obj") ); 263 setToolTipText( Globals.getTranslation( "pp.edit" ) ); 264 setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) ); 265 handleEvent( null, DWT.Selection, &touchEdit ); 266 } 267 268 with( new Button( importGroup, DWT.FLAT ) ) 269 { 270 setImage( Globals.getImage("prev_nav") ); 271 setToolTipText( Globals.getTranslation( "pp.moveup" ) ); 272 setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) ); 273 handleEvent( null, DWT.Selection, &onUp ); 274 } 275 276 with( new Button( importGroup, DWT.FLAT ) ) 277 { 278 setImage( Globals.getImage("next_nav") ); 279 setToolTipText( Globals.getTranslation( "pp.movedown" ) ); 280 setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) ); 281 handleEvent( null, DWT.Selection, &onDown ); 282 } 283 284 Group textGroup = new Group( shell, DWT.NONE ); 285 gridLayout = new GridLayout(); 286 gridLayout.numColumns = 3; 287 textGroup.setLayout( gridLayout ); 288 gridData = new GridData( GridData.FILL_HORIZONTAL ); 289 gridData.horizontalSpan = 3; 290 textGroup.setLayoutData( gridData ); 291 292 with( new Label( textGroup, DWT.NONE ) ) setText( "Source:" ); 293 294 with( txtSource = new Text( textGroup, DWT.SINGLE | DWT.BORDER ) ) 295 { 296 setText( iniString ); 297 setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 1, 1)); 298 } 299 300 with( new Button( textGroup, DWT.PUSH ) ) 301 { 302 setText("..."); 303 handleSelection( this, delegate( SelectionEvent e ) 304 { 305 CResourceCompilerDialog pThis = cast(CResourceCompilerDialog) e.cData; 306 307 scope dlg = new DirectoryDialog( pThis.shell, DWT.OPEN ); 308 dlg.setFilterPath(Globals.recentDir); 309 pThis.txtSource.setText( strip( dlg.open() ) ); 310 } 311 ); 312 } 313 314 with( new Label( textGroup, DWT.NONE ) ) setText( "Destination:" ); 315 316 with( txtDest = new Text(textGroup, DWT.SINGLE | DWT.BORDER) ) 317 { 318 setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 1, 1)); 319 } 320 321 with( new Button( textGroup, DWT.PUSH ) ) 322 { 323 setText("..."); 324 handleSelection( this, delegate( SelectionEvent e ) 325 { 326 CResourceCompilerDialog pThis = cast(CResourceCompilerDialog) e.cData; 327 328 scope dlg = new DirectoryDialog( pThis.shell, DWT.OPEN ); 329 dlg.setFilterPath(Globals.recentDir); 330 pThis.txtDest.setText( strip( dlg.open() ) ); 331 } 332 ); 333 } 334 335 Group consoleGroup = new Group( shell, DWT.NONE ); 336 consoleGroup.setText( Globals.getTranslation( "pp2.command" ) ); 337 gridLayout = new GridLayout(); 338 gridLayout.numColumns = 1; 339 consoleGroup.setLayout( gridLayout ); 340 gridData = new GridData( GridData.FILL_HORIZONTAL ); 341 gridData.horizontalSpan = 3; 342 consoleGroup.setLayoutData( gridData ); 343 344 with( txtCommand = new Text( consoleGroup, DWT.BORDER | DWT.MULTI | DWT.V_SCROLL | DWT.WRAP ) ) 345 { 346 GridData innergridData = new GridData( GridData.FILL, GridData.BEGINNING, true, false, 1, 1 ); 347 scope font = new Font( display, "Verdana", 8, DWT.NORMAL ); 348 setFont( font ); 349 innergridData.heightHint = 32; 350 setLayoutData( innergridData ); 351 } 86 352 87 353 // the bottom buttton bar … … 93 359 pThis.onOK(); 94 360 } 95 ); 96 97 98 if(iniString){ 99 txt.setText(iniString); 100 txt.setSelection(0, iniString.length); 101 } 102 else if(_validate !is null){ 103 btnOK.setEnabled(false); 104 } 361 ); 362 105 363 shell.setDefaultButton(btnOK); 106 364 shell.pack(); 365 366 Point pt = shell.getSize(); 367 pt.x = pt.y * 3 / 3; 368 shell.setSize(pt); 369 shell.setMinimumSize(pt); 370 107 371 108 372 return shell; … … 110 374 111 375 public: 112 this (Shell parent, char[] title, char[] iniString) { 113 super (parent); 376 this( Shell parent, char[] title, char[] iniString ) 377 { 378 super( parent ); 114 379 this.title = title; 115 380 this.iniString = iniString; 116 381 } 117 118 void setValidateDelegate(boolean delegate(char[]) func) {119 assert(func);120 _validate = func;121 }122 123 void onModify(Event e){124 if(_validate)125 btnOK.setEnabled(_validate(txt.getText()));126 }127 382 } trunk/current/poseidon/poseidon/globals.d
r242 r244 29 29 static public char[] BudExe; 30 30 static public char[] DebuggerExe; 31 static public char[] DDcoumentDir; 31 static public char[] RCExe; 32 static public char[][] DDcoumentDir; 32 33 static public int backBuild = 1; 33 34 static public char[] poseidonPath; … … 38 39 static public int[] BottomPanelLastWeight; 39 40 static public char[][] SplitedExplorerFilter; 41 42 static public char[][] debuggerSearchPath; 43 static public int sendAbsoluteFullpath = 1; 40 44 41 45 static public int useCodeCompletion = 1; … … 455 459 } 456 460 457 child = compilerChild.getChild("DDOCUMENT");458 if( child )459 {460 XMLattrib at = child.getAttrib("path");461 if( at && at.GetValue().length > 0 ) DDcoumentDir = at.GetValue();462 }463 464 461 child = compilerChild.getChild("BUILDTYPE"); 465 462 if( child ) … … 475 472 if( at && at.GetValue().length > 0 ) outputWRAP = std.string.atoi( at.GetValue() ); 476 473 } 477 474 475 child = compilerChild.getChild("debuggerSearch"); 476 if( child ) 477 { 478 XMLattrib at = child.getAttrib("path"); 479 if( at && at.GetValue().length > 0 ) 480 { 481 char[] path = at.GetValue(); 482 if( path.length ) 483 debuggerSearchPath = std.string.split( path, ";" ); 484 } 485 } 478 486 } 479 487 … … 623 631 node.addAttrib( "path", DebuggerExe ); 624 632 625 node = compiler_node.addNode( "DDOCUMENT" , null);626 node.addAttrib( "path", DDcoumentDir );627 628 633 node = compiler_node.addNode( "BUILDTYPE" , null); 629 634 node.addAttrib( "thread", std.string.toString( backBuild ) ); … … 632 637 node.addAttrib( "wrap", std.string.toString( outputWRAP ) ); 633 638 634 639 node = compiler_node.addNode( "debuggerSearch", null ); 640 node.addAttrib( "path", std.string.join( debuggerSearchPath, ";" ) ); 641 635 642 XMLnode parser_node = root.addNode("parsersetting", null); 636 643 node = parser_node.addNode( "codecompletion" , null); … … 819 826 820 827 node.addAttrib("desktopweight", desktop ); 828 node.addAttrib("sendabspath", std.string.toString(sendAbsoluteFullpath) ); 829 node.addAttrib( "document", std.string.join( DDcoumentDir, ";" ) ); 830 821 831 char[] filter = poseidon.util.miscutil.MiscUtil.getFilter( SplitedExplorerFilter ); 822 832 node.addAttrib("explorerfilters", filter ); … … 844 854 shellBounds = _parseRect(bounds); 845 855 856 sendAbsoluteFullpath = XMLUtil.getAttribInt(node, "sendabspath", sendAbsoluteFullpath); 857 char[] documentDir = XMLUtil.getAttrib( node, "document", null ); 858 DDcoumentDir = std.string.split( documentDir, ";" ); 859 846 860 char[] filter = XMLUtil.getAttrib( node, "explorerfilters", "*.c;*.cpp;*.h;*.xml;*.txt;*.def" ); 847 861 SplitedExplorerFilter = poseidon.util.miscutil.MiscUtil.getSplitFilter( filter ); 862 848 863 } 849 864 } trunk/current/poseidon/poseidon/intellisense/autocomplete.d
r242 r244 526 526 return null; 527 527 } 528 529 CAnalyzerTreeNode getParserFromProjectParserByModuleName( char[] moduleName ) 530 { 531 if( !projectParsers.length ) return null; 532 533 char[] projectName = sGUI.packageExp.getActiveProjectName(); 534 535 foreach( CAnalyzerTreeNode t; projectParsers[projectName] ) 536 { 537 char[] mName, fName; 538 getModuleNames( t, mName, fName ); 539 if( mName == moduleName ) return t; 540 } 541 542 return null; 543 } 544 528 545 529 546 void addProjectParser( char[][] paths ) trunk/current/poseidon/poseidon/model/project.d
r243 r244 95 95 ToolEntry entry = new ToolEntry(); 96 96 entry.name = "Compile File"; 97 98 filename = getSentFileName( filename ); 97 99 98 100 if( this.DMDPath.length ) … … 826 828 827 829 return false; 828 } 830 } 831 832 private char[] getSentFileName( char[] fileName ) 833 { 834 if( !Globals.sendAbsoluteFullpath ) 835 { 836 if( std.path.isabs( fileName ) ) fileName = std.string.replace( fileName, projectDir ~ "\\", "" ); 837 } 838 else 839 { 840 if( !std.path.isabs( fileName ) ) fileName = std.path.join( projectDir, fileName ); 841 } 842 843 return fileName; 844 } 845 829 846 830 847 private char[] getFileListDMD( bool bReBuild, bool bMakeLib ) … … 838 855 if( bMakeLib ) 839 856 { 857 f = getSentFileName( f ); 858 840 859 char[] objFileName = std.path.getBaseName( std.path.getName( f ) ) ~ ".obj"; 841 860 842 861 if( objDir.length ) 843 862 { … … 848 867 } 849 868 else // no -odxx and no -op 850 result ~= ( " " ~ projectDir ~ "\\" ~ objFileName ); 869 { 870 if( Globals.sendAbsoluteFullpath ) 871 result ~= ( " " ~ projectDir ~ "\\" ~ objFileName ); 872 else 873 result ~= ( " " ~ objFileName ); 874 875 } 851 876 } 852 877 else 853 878 { 854 879 if( !bReBuild ) 855 result ~= ( " " ~ get CompileTargetFileHSU( f) );880 result ~= ( " " ~ getSentFileName( getCompileTargetFileHSU( f ) ) ); 856 881 else 857 result ~= ( " " ~ f);882 result ~= ( " " ~ getSentFileName( f ) ); 858 883 } 859 884 } trunk/current/poseidon/poseidon/style/dstyle.d
r242 r244 14 14 private import poseidon.util.miscutil; 15 15 private import std.string, std.thread; 16 private import poseidon.controller.ddoc.ddocparser; 16 17 17 18 /+ … … 324 325 if( bFunctionToolTip ) 325 326 { 327 CDDocParser.showTip( sc, -1, listToolTip, 0x777777, 0xffffff ); 328 /+ 326 329 sc.callTipCancel(); 327 330 … … 431 434 sc.callTipShow( sc.positionFromPoint( callTipX, currentY ), listToolTip[0..length - 1] ); 432 435 } 436 +/ 433 437 } 434 438 else … … 593 597 if( treeNode ) 594 598 { 595 if( treeNode.DType ==D_FUNCTION )599 if( treeNode.DType & D_FUNCTION ) 596 600 { 597 601 if( bUseFunTip ) … … 1468 1472 } 1469 1473 1470 if( dword ) dword.reverse;else return false;1474 if( dword.length ) dword.reverse;else return false; 1471 1475 1472 1476 … … 1481 1485 } 1482 1486 1483 word = std.string.strip( word ); 1487 int posImport = std.string.find( word, "import" ); 1488 if( posImport > -1 ) 1489 { 1490 ch = sc.getCharAt( pos + posImport + 7 ); 1491 //sGUI.outputPanel.appendLine( "pos + posImport =>" ~ cast(char) ch ~ "<" ); 1492 if( ch < 33 || ch > 126 ) return true; 1493 } 1494 return false; 1495 1496 /* 1484 1497 if( std.string.find( word, "import " ) > -1 ) return true; 1485 1498 1486 1499 return false; 1500 */ 1487 1501 } 1488 1502 … … 1510 1524 } 1511 1525 1512 private char[][] readCurrentWholeWord( Scintilla sc, bool bFunctionToolTip, inout bool bDotEnd )1526 private char[][] readCurrentWholeWord( Scintilla sc, bool bFunctionToolTip, inout bool bDotEnd, int _pos = -1 ) 1513 1527 { 1514 1528 char[] word; 1515 1529 dchar[] dword; 1516 int pos = sc.getCurrentPos() - 2;1530 int pos = _pos < 0 ? sc.getCurrentPos() - 2 : _pos;//= sc.getCurrentPos() - 2; 1517 1531 1518 1532 if( !bFunctionToolTip ) … … 2242 2256 2243 2257 2244 private CAnalyzerTreeNode searchFunctionHead( Scintilla sc )2258 private CAnalyzerTreeNode searchFunctionHead( Scintilla sc, int pos = -1 ) 2245 2259 { 2246 2260 if( !sAutoComplete.fileParser ) return null; 2247 2261 2248 2262 bool bMatch; 2249 int originPos = sc.getCurrentPos(); 2250 int pos = originPos - 1; 2263 int originAnchorPos = sc.getCurrentPos(); 2264 int originPos = pos < 0 ? originAnchorPos : pos; 2265 2266 pos = originPos - 1; 2267 2251 2268 char ch = sc.getCharAt( pos ); 2252 2269 char[] word, finalWord, paramWord; … … 2452 2469 if( finalWord == "case" || finalWord == "default" ) 2453 2470 { 2454 sc.setAnchor( posLeftParen );2455 sc.searchAnchor();2456 sc.hideSelection( true ); 2457 int switchPos = sc.searchPrev( ScintillaEx.SCFIND_MATCHCASE, "switch" );2471 /+ 2472 int switchPos = posLeftParen; 2473 2474 dchar[] dword; 2458 2475 2459 if( switchPos > -1 ) 2460 { 2461 if( switchPos > posLeftParen ) return null; 2462 2476 while( switchPos > 5 ) 2477 { 2478 dword ~= sc.getCharAt( switchPos - 6 ); 2479 dword ~= sc.getCharAt( switchPos - 5 ); 2480 dword ~= sc.getCharAt( switchPos - 4 ); 2481 dword ~= sc.getCharAt( switchPos - 3 ); 2482 dword ~= sc.getCharAt( switchPos - 2 ); 2483 dword ~= sc.getCharAt( -- switchPos ); 2484 2485 if( dword == "switch" ) break; 2486 } 2487 2488 if( dword == "switch" ) 2489 { 2490 sGUI.outputPanel.appendLine( "get" ); 2463 2491 char c; 2464 2492 bool bGetOpencurly; 2493 2465 2494 while( switchPos < posLeftParen ) 2466 2495 { … … 2473 2502 switchPos ++; 2474 2503 } 2504 2505 if( bGetOpencurly ) 2506 { 2507 int closecurlyPos = sc.braceMatch( switchPos ); 2508 2509 if( closecurlyPos > 0 ) 2510 { 2511 if( closecurlyPos > posLeftParen ) 2512 { 2513 int endPos = closecurlyPos; 2514 int nextCasePos = posLeftParen; 2515 2516 while( nextCasePos < closecurlyPos-4 ) 2517 { 2518 dword ~= sc.getCharAt( ++ nextCasePos ); 2519 dword ~= sc.getCharAt( nextCasePos + 1 ); 2520 dword ~= sc.getCharAt( nextCasePos + 2 ); 2521 dword ~= sc.getCharAt( nextCasePos + 3 ); 2522 if( dword == "case" ) 2523 { 2524 endPos = nextCasePos; 2525 break; 2526 } 2527 } 2528 2529 int defaultPos = posLeftParen; 2530 while( defaultPos < closecurlyPos-6) 2531 { 2532 dword ~= sc.getCharAt( ++ defaultPos ); 2533 dword ~= sc.getCharAt( defaultPos + 1 ); 2534 dword ~= sc.getCharAt( defaultPos + 2 ); 2535 dword ~= sc.getCharAt( defaultPos + 3 ); 2536 dword ~= sc.getCharAt( defaultPos + 4 ); 2537 dword ~= sc.getCharAt( defaultPos + 5 ); 2538 dword ~= sc.getCharAt( defaultPos + 6 ); 2539 if( dword == "default" ) 2540 { 2541 endPos = defaultPos; 2542 break; 2543 } 2544 } 2545 2546 if( originPos > posLeftParen && originPos < endPos ) 2547 lineBlocks ~= sc.lineFromPosition( posLeftParen ) + 1; 2548 } 2549 } 2550 } 2551 } 2552 2553 +/ 2554 2555 sc.setAnchor( posLeftParen ); 2556 sc.searchAnchor(); 2557 sc.hideSelection( true ); 2558 int switchPos = sc.searchPrev( ScintillaEx.SCFIND_MATCHCASE, "switch" ); 2559 2560 if( switchPos > -1 ) 2561 { 2562 if( switchPos > posLeftParen ) return null; 2563 2564 char c; 2565 bool bGetOpencurly; 2566 while( switchPos < posLeftParen ) 2567 { 2568 c = sc.getCharAt( switchPos ); 2569 if( c == '{' ) 2570 { 2571 bGetOpencurly = true; 2572 break; 2573 } 2574 switchPos ++; 2575 } 2475 2576 2476 2577 if( bGetOpencurly ) … … 2496 2597 } 2497 2598 2498 sc.gotoPos( originPos ); 2599 sc.setAnchor( originAnchorPos ); 2600 sc.setCurrentPos( originAnchorPos ); 2601 //sc.gotoPos( originPos ); 2499 2602 sc.hideSelection( false ); 2603 2500 2604 } 2501 2605 break; … … 2789 2893 } 2790 2894 2791 public void performJumpToDefintion( Scintilla sc, in out char[] fileFullPath, inout int lineNum)2895 public void performJumpToDefintion( Scintilla sc, int pos, inout char[] fileFullPath, inout char[] moduleName, inout int lineNum, out CAnalyzerTreeNode resultNode ) 2792 2896 { 2793 2897 // special version … … 2795 2899 { 2796 2900 if ( sc.getLineCount() <= 2 ) return null; 2797 int pos = sc.getCurrentPos(); 2901 2902 int _pos = pos < 0 ? sc.getCurrentPos() : pos; 2903 2904 2798 2905 int endLine = sc.getLineCount(); 2799 2906 int endPos = sc.positionFromLine( endLine ); 2800 2907 char[] wordForward, wordBackward, word; 2801 2908 2802 char ch = sc.getCharAt( pos++ );2909 char ch = sc.getCharAt( _pos++ ); 2803 2910 wordForward ~= ch; 2804 2911 2805 2912 while( !isWordBreak( ch ) ) 2806 2913 { 2807 ch = sc.getCharAt( pos++);2914 ch = sc.getCharAt( _pos++ ); 2808 2915 wordForward ~= ch; 2809 if( pos >= endPos ) break; 2810 } 2811 2812 pos = sc.getCurrentPos(); 2813 ch = sc.getCharAt( --pos ); 2916 if( _pos >= endPos ) break; 2917 } 2918 2919 _pos = pos < 0 ? sc.getCurrentPos() : pos; 2920 2921 ch = sc.getCharAt( --_pos ); 2814 2922 2815 2923 while( !isWordBreak( ch ) ) 2816 2924 { 2817 ch = sc.getCharAt( pos--);2925 ch = sc.getCharAt( _pos-- ); 2818 2926 wordBackward ~= ch; 2819 if( pos <= 0 ) break;2927 if( _pos <= 0 ) break; 2820 2928 } 2821 2929 … … 2835 2943 bool bDotEnd, bModuleScope, bFunctionToolTip = true; 2836 2944 char[] typedWord, withName, listToolTip; 2837 char[][] currentWords = readCurrentWholeWord( sc, bFunctionToolTip, bDotEnd );2945 char[][] currentWords = readCurrentWholeWord( sc, bFunctionToolTip, bDotEnd, pos ); 2838 2946 CAnalyzerTreeNode functionHeadNode; 2839 2947 2840 fileFullPath = "";2948 fileFullPath = moduleName = ""; 2841 2949 lineNum = -1; 2950 resultNode = originalFunctionNode = null; 2842 2951 2843 2952 if( !currentWords.length ) return; 2844 2845 //sGUI.outputPanel.appendLine( "Ori currentWords = " ~ std.string.join( currentWords, "~" ) );2846 2847 2953 char[] tail = _readHoverWord( sc ); 2848 2849 //sGUI.outputPanel.appendLine( "tail = " ~ tail );2850 2851 2954 currentWords[length-1] = tail; 2852 2955 2853 2956 if( currentWords[0].length ) 2854 2957 if( currentWords[0][0] == '!' ) currentWords[0] = currentWords[0][1..length]; 2855 2856 //sGUI.outputPanel.appendLine( "Fixed currentWords = " ~ std.string.join( currentWords, "~" ) );2857 2858 //MessageBox.showMessage( "currentWords = "~std.string.join( currentWords, "." ) );2859 2860 originalFunctionNode = null;2861 2958 2862 2959 if( !currentWords[0].length ) … … 2870 2967 } 2871 2968 2969 //sGUI.outputPanel.appendLine( "Fixed currentWords = " ~ std.string.join( currentWords, "~" ) ); 2970 2872 2971 2873 2972 bool bIsImport = haveImportKeyWord( sc ); … … 2877 2976 if( functionHeadNode is null ) 2878 2977 { 2879 functionHeadNode = searchFunctionHead( sc );2978 functionHeadNode = searchFunctionHead( sc, pos ); 2880 2979 if( bModuleScope ) 2881 2980 { … … 2885 2984 } 2886 2985 2887 //MessageBox.showMessage( "functionHead = " ~functionHeadNode.identifier );2888 2889 2986 withName = getWithName( functionHeadNode ); 2890 2987 if( withName.length ) currentWords = withName ~ currentWords; … … 2892 2989 originalFunctionNode = functionHeadNode; 2893 2990 2894 if( tail == currentWords[0] ) 2895 { 2896 CAnalyzerTreeNode easyNode = sAutoComplete.getAnalyzerTreeNode( tail, D_ALL - D_MAINROOT - D_BLOCK - D_MODULE, functionHeadNode, true );2991 if( tail == currentWords[0] ) // currentWords.length == 1 ) 2992 { 2993 CAnalyzerTreeNode easyNode = sAutoComplete.getAnalyzerTreeNode( currentWords[0], D_ALL - D_MAINROOT - D_BLOCK - D_MODULE, functionHeadNode, true ); 2897 2994 if( easyNode !is null ) 2898 2995 { 2996 resultNode = easyNode; 2899 2997 lineNum = easyNode.lineNumber; 2900 2998 while( !( easyNode.DType & D_MAINROOT ) ) … … 2905 3003 { 2906 3004 fileFullPath = easyNode.getLeaf( 0 ).typeIdentifier; 3005 moduleName = easyNode.getLeaf( 0 ).identifier; 2907 3006 return; 2908 3007 } … … 2911 3010 2912 3011 2913 CAnalyzerTreeNode resultNode = performAnalyzer( currentWords, typedWord, functionHeadNode, listToolTip, bFunctionToolTip, true ); 2914 if( resultNode !is null ) 2915 { 2916 lineNum = resultNode.lineNumber; 2917 while( !( resultNode.DType & D_MAINROOT ) ) 2918 resultNode = resultNode.getRoot; 2919 2920 if( resultNode.getLeafCount ) 2921 if( resultNode.getLeaf( 0 ).DType & D_MODULE ) fileFullPath = resultNode.getLeaf( 0 ).typeIdentifier; 3012 CAnalyzerTreeNode easyNode = performAnalyzer( currentWords, typedWord, functionHeadNode, listToolTip, bFunctionToolTip, true ); 3013 if( easyNode !is null ) 3014 { 3015 resultNode = easyNode; 3016 lineNum = easyNode.lineNumber; 3017 while( !( easyNode.DType & D_MAINROOT ) ) 3018 easyNode = easyNode.getRoot; 3019 3020 if( easyNode.getLeafCount ) 3021 if( easyNode.getLeaf( 0 ).DType & D_MODULE ) 3022 { 3023 fileFullPath = easyNode.getLeaf( 0 ).typeIdentifier; 3024 moduleName = easyNode.getLeaf( 0 ).identifier; 3025 } 3026 } 3027 } 3028 else 3029 { 3030 char[] word; 3031 dchar[] dword; 3032 3033 pos = pos < 0 ? sc.getCurrentPos() : pos; 3034 3035 //int pos = sc.getCurrentPos(); 3036 dchar ch = sc.getCharAt( pos - 1 ); 3037 3038 if( ch != ' ' && ch != ';' && ch != ',' ) 3039 { 3040 // move to head 3041 while( pos > -1 ) 3042 { 3043 ch = sc.getCharAt( -- pos ); 3044 if( ch == '\t' || ch == ' ' || ch == ';' ||ch == ',' ) break; 3045 } 3046 3047 ch = sc.getCharAt( ++ pos ); 3048 } 3049 3050 ch = sc.getCharAt( pos ); 3051 3052 // look back 3053 while( ch != '\0' ) 3054 { 3055 if( ch == ';' || ch == ',' ) break; 3056 dword ~= ch; 3057 ch = sc.getCharAt( ++ pos ); 3058 } 3059 3060 try 3061 { 3062 word = std.utf.toUTF8( dword ); 3063 std.utf.validate( word ); // 檢查是否為有效的 UTF8 3064 } 3065 catch( Exception ) 3066 { 3067 return; 3068 } 3069 3070 word = std.string.strip( word ); 3071 if( word.length ) 3072 { 3073 CAnalyzerTreeNode easyNode = sAutoComplete.getParserFromProjectParserByModuleName( word ); 3074 if( easyNode !is null ) 3075 { 3076 resultNode = easyNode; 3077 if( easyNode.getLeafCount ) 3078 if( easyNode.getLeaf( 0 ).DType & D_MODULE ) 3079 { 3080 fileFullPath = easyNode.getLeaf( 0 ).typeIdentifier; 3081 lineNum = easyNode.getLeaf( 0 ).lineNumber; 3082 moduleName = easyNode.getLeaf( 0 ).identifier; 3083 } 3084 } 2922 3085 } 2923 3086 }
