Changeset 244

Show
Ignore:
Timestamp:
05/14/08 19:58:35 (5 years ago)
Author:
Kuan Hsu
Message:

Add short-cut of help documents, advanced mouse-dwell function, show function initializer.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/current/poseidon/CodeAnalyzer/lexical/identifiersLex.d

    r240 r244  
    2222    else 
    2323    { 
     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        }        
    2439        return TOK.Identifier; 
    2540    } 
  • trunk/current/poseidon/CodeAnalyzer/syntax/declarations.d

    r240 r244  
    171171                    { 
    172172                        char[] paramString = std.string.strip( s ); 
     173                        int posAssign = std.string.rfind( paramString, "=" ); 
     174                        if( posAssign > 2 ) paramString = paramString[0..posAssign]; 
     175                         
    173176                        int spacePos = std.string.rfind( paramString, " " ); 
    174177                        if( spacePos > 0 ) 
    175178                            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                            } 
    177189                    } 
    178190                } 
     
    877889            parseR!(Declarator); 
    878890 
    879             globalParams ~= globalIdentifier; // Kuan Hsu 
    880  
     891            globalParams ~= tokenText; // Kuan Hsu 
    881892             
    882893            if( ts.next( TOK.Tassign ) ) 
     
    884895                parseTerminal(); 
    885896                parseR!(Initializer); 
     897                 
    886898            } 
    887899            else if( ts.next( TOK.Openparen ) ) 
  • trunk/current/poseidon/config.xml

    r241 r244  
    1414    </customtools> 
    1515    <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" /> 
    1666        <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" /> 
    6267    </hotkeys> 
    6368    <recentprjs /> 
     
    6873        <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" /> 
    6974    </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" /> 
    7176    <recentdir name="" /> 
    7277    <language value="english" /> 
     
    7681        <BUD path="" /> 
    7782        <DEBUGGER path="" /> 
    78         <DDOCUMENT path="" /> 
    7983        <BUILDTYPE thread="1" /> 
    8084        <output wrap="64" /> 
     85        <debuggerSearch path="" /> 
    8186    </compilersetting> 
    8287    <parsersetting> 
    83         <codecompletion use="1" onlybrowser="0" all="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" /> 
    8489        <defaultparserpaths /> 
    8590    </parsersetting> 
  • trunk/current/poseidon/nls/english.ini

    r242 r244  
    246246gp.wrap = Use Output Wrap ( Need Restart Poseidon ) 
    247247gp.filter = Package Explorer File Filter( File Open On Poseidon, Except *.d;*.di ) 
     248gp.absolute = Send Files To Compiler Using Absolute Path 
     249gp.doc_title = Help Document Fullpath 
     250gp.doc = Document 
    248251 
    249252;==== Editor Page ========= 
     
    273276cp.build_path = Build Tool 
    274277cp.ddbg_path = Debugger 
    275 cp.doc = D Document 
     278cp.rc_path = RCC Compiler 
    276279cp.thread = Compile / Build At Background-Thread 
    277280cp.compiler = Compiler 
     
    296299pap.ed = Default recursive structures max depth [ed] 
    297300pap.el = Default array elements max number [el] 
     301pap.path = Source Search Paths 
    298302 
    299303; ============ D style page ============= 
     
    336340diag.title7 = Add ImportExpression Path... 
    337341diag.title7_1 = Edit ImportExpression Path 
     342diag.title8 = Add Source Search Path... 
     343diag.title8_1 = Edit Source Search Path 
    338344 
    339345;============================= project property =========================== 
     
    408414pp2.args = Execute Args 
    409415 
    410 pp2.rc = Resource Complier Options: 
     416pp2.rc = Resource Complier...... 
     417pp2.rcoptions = Resource Complier Options 
     418pp2.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 
    411429pp2.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 = Disables 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
     430pp2.rc_o1 = Prevents RC from checking the INCLUDE environment variable when searching for include files or resource files [-X
     431pp2.rc_o2 = Disables RC's load-optimization feature [-K
     432pp2.rc_o3 = Creates a resource file from a resource script file [-R
     433pp2.rc_o4 = Displaying progress messages [-V
     434pp2.rc_o5 = Names the executable file [-FE
     435pp2.rc_o6 = Renames the resource file [-FO
    418436 
    419437 
  • trunk/current/poseidon/poseidon/controller/actionmanager.d

    r240 r244  
    703703    } 
    704704 
    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 ) 
    707738    { 
    708739        try 
    709740        { 
    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  
    720741            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; 
    745745             
    746746            //entry.args = fileName; 
     
    751751        catch 
    752752        { 
    753             return true; 
     753            return false; 
    754754        } 
    755755         
  • trunk/current/poseidon/poseidon/controller/debugcontrol/debugPanel.d

    r221 r244  
    113113            else 
    114114            { 
     115                char[] moduleName = data[0..atIndex]; 
    115116                char[] fileAndLine = data[atIndex+3..length]; 
    116117                //currentStackFrameLocation = fileAndLine; 
     
    122123                     
    123124                    char[]  filePath = fileAndLine[0..colonIndex]; 
     125                    char[]  fullPath; 
    124126                    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                     
    125206 
    126207                    if( sGUI.editor.openFile( filePath, null, line, true ) ) 
  • trunk/current/poseidon/poseidon/controller/debugcontrol/debugger.d

    r222 r244  
    6565    CWatchPanel     topRightPanel; 
    6666 
    67     char[]        projectDir; 
     67    static char[] projectDir; 
    6868     
    6969    this( SashForm parent ) 
     
    148148            if( ti.getChecked() ) 
    149149            { 
    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                 
    151155            } 
    152156        } 
     
    242246                            { 
    243247                                if( commands.length == 2 ) 
    244                                     addBP_editor( splitColon[0], std.string.atoi( splitColon[1] ) ); // bp file:linenum 
     248                                    addBP_editor( splitColon[0], std.string.atoi( splitColon[1] ), projectDir ); // bp file:linenum 
    245249                                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 ); 
    247251                            } 
    248252                        } 
     
    284288    } 
    285289         
    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 
    288298        if( isPipeCreate ) 
    289299        { 
    290             char[] result = write( "bp " ~ fullPath ~ ":" ~ std.string.toString( lineNum ) ~ "\n" ); 
     300            char[] result = write( "bp " ~ moduleName ~ ":" ~ std.string.toString( lineNum ) ~ "\n" ); 
    291301 
    292302            int setPos = std.string.find( result, "Breakpoint set: " ); 
     
    301311        } 
    302312 
    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         
    308324        if( isPipeCreate ) 
    309325        { 
    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" ); 
    311327             
    312328            int setPos = std.string.find( result, "Breakpoint set: " ); 
     
    321337        } 
    322338 
    323         bpItem.add( fullPath, lineNum, id ); 
     339        bpItem.add( fullPath, moduleName, lineNum, id ); 
    324340    }    
    325341 
  • trunk/current/poseidon/poseidon/controller/debugcontrol/debugparser.d

    r222 r244  
    99    import poseidon.controller.edititem; 
    1010    import poseidon.controller.debugcontrol.debugger; 
     11    import poseidon.globals; 
     12 
    1113 
    1214    static bool findFileNameAndLineNum( char[] input, inout char[] fileName, inout int lineNum ) 
     
    3436                        lineNum = std.string.atoi( input[lnIndex + 1..spaceIndex] ); 
    3537 
    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                        } 
    37131                    } 
    38132                } 
  • trunk/current/poseidon/poseidon/controller/debugcontrol/pipe.d

    r221 r244  
    5050            if( Globals.edDebug > 0 ) sendCommand( "ed " ~ std.string.toString( Globals.edDebug ) ~ "\n" ); 
    5151            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            } 
    5256        } 
    5357        else 
  • trunk/current/poseidon/poseidon/controller/debugcontrol/watch.d

    r222 r244  
    768768    void updateI18N(){ this.setText( Globals.getTranslation( "debug.bps" ) ); } 
    769769 
    770     void add( char[] fullPath, int lineNum ) 
     770    void add( char[] fullPath, char[] moduleName, int lineNum ) 
    771771    { 
    772772        TableItem[] tis = table.getItems(); 
     
    774774        if( !tis.length ) 
    775775        { 
    776             add( fullPath, lineNum, 0 ); 
     776            add( fullPath, moduleName, lineNum, 0 ); 
    777777        } 
    778778        else 
     
    791791                if( bGetID ) 
    792792                { 
    793                     add( fullPath, lineNum, i ); 
     793                    add( fullPath, moduleName, lineNum, i ); 
    794794                    break; 
    795795                } 
     
    798798    } 
    799799 
    800     void add( char[] fullPath, int lineNum, int id ) 
     800    void add( char[] fullPath, char[] moduleName, int lineNum, int id ) 
    801801    { 
    802802        TableItem item = new TableItem( table, DWT.NULL ); 
    803803        item.setText( 0, std.string.toString( id ) ~ "    " ); 
    804         item.setText( 1, std.path.getName( std.path.getBaseName( fullPath ) ) ~ "      " ); 
     804        item.setText( 1, moduleName ~ "      " ); 
    805805        item.setText( 2, std.string.toString( lineNum ) ~ "      " ); 
    806806        item.setText( 3, fullPath ~ "      " ); 
  • trunk/current/poseidon/poseidon/controller/dialog/aboutbox.d

    r243 r244  
    3838        with(label = new CLabel(top, DWT.CENTER)){ 
    3939            //setText("Poseidon Editor for D v " ~ Globals.getVersionS()); 
    40             setText("Poseidon Editor for D rev.243" ); 
     40            setText("Poseidon Editor for D rev.244" ); 
    4141            setForeground(color); 
    4242        } 
  • trunk/current/poseidon/poseidon/controller/edititem.d

    r242 r244  
    4343{ 
    4444    private import poseidon.controller.debugcontrol.debugparser; 
     45    private import poseidon.controller.ddoc.ddocparser; 
    4546     
    4647    Editor              _parent; 
     
    597598    private void onMouseDwellStart( SCNotifyEvent e ) 
    598599    { 
    599         if( !sGUI.debuggerDMD.isRunning() ) return; 
     600        //if( !sGUI.debuggerDMD.isRunning() ) return; 
    600601        //if( !sGUI.packageExp.isFileInProjects( scintilla.getFileName() ) ) return; 
    601602 
    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; 
    604605         
    605606        try 
     
    616617            if( varName.length ) 
    617618            { 
    618                 char[] tempVarName = varName; 
    619                 char[] type = CDebugParser.getType( tempVarName ); 
    620  
    621                 if( !type.length ) 
     619                if( sGUI.debuggerDMD.isRunning() ) 
    622620                { 
    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                    } 
    625650                } 
    626                  
    627                 char[] value = CDebugParser.getValue( tempVarName, type, false, true ); 
    628  
    629                 if( value.length > 3 ) 
     651                else 
    630652                { 
    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 ); 
    643664                } 
    644665            } 
     
    646667        catch( Exception e ) 
    647668        { 
    648             MessageBox.showMessage( "Scintilla MouseDwell Error!! \n" ~ e.toString  ); 
     669            //MessageBox.showMessage( "Scintilla MouseDwell Error!! \n" ~ e.toString  ); 
    649670        } 
    650671    } 
     
    10421063        else 
    10431064        { 
    1044             sGUI.debuggerDMD.addBP_editor( getFileName(), lineNumber + 1 ); 
     1065            sGUI.debuggerDMD.addBP_editor( getFileName(), lineNumber + 1, sGUI.packageExp.getActiveProjectDir ); 
    10451066            scintilla.markerAdd( lineNumber, Editor.MARK_DEBUGSYMBOLE ); 
    10461067        } 
     
    11371158            case "debug_stop"           :   return &_debug_stop; 
    11381159            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; 
    11391166 
    11401167            // others 
     
    11651192        scope dStyle = new DStyle; 
    11661193 
    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 ); 
    11711199 
    11721200        //MessageBox.showMessage( "name = " ~ fileFullPath ~ "\n" ~ std.string.toString( lineNum ) ); 
     
    11781206            } 
    11791207 
    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            } 
    11811233        } 
    11821234 
     
    12791331    private void _closeCurrentFile(){ this.close( true ); } 
    12801332 
     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     
    12811343    private char Eofline() 
    12821344    { 
  • trunk/current/poseidon/poseidon/controller/menumanager.d

    r238 r244  
    2020    Menu    recentMenu; 
    2121    Menu    projectMenu; 
     22    private Menu    documentMenu; 
    2223 
    2324    public  MenuItem    saveItem, saveasItem, saveallItem, closefileItem, closeprjItem, closeallprjItem, 
     
    2728                        compileItem, runItem, buildItem, build_runItem, rebuildItem, BudItem, cleanItem, 
    2829                        debugItem, debugbuildItem, debuginItem, debugrunItem, debugoverItem, debugreturnItem, debugstopItem, debugcleanbpsItem, 
    29                         encodeItem
     30                        encodeItem, documentItem
    3031                         
    3132    // static properties 
     
    621622 
    622623        /// 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"); 
    625626            setImage(Globals.getImage( "help_link" ) ); 
    626627            handleEvent(this, DWT.Selection, delegate(Event e){ 
    627                 sActionMan.actionDDocumentFile(); 
    628             }); 
    629         } 
     628            }); 
     629        } 
     630        documentMenu = DocumentMenu(documentItem); 
     631        documentItem.setMenu(documentMenu);      
    630632 
    631633        new MenuItem(menu, DWT.SEPARATOR); 
     
    677679        } 
    678680        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    }        
    680724 
    681725    protected Menu getRecentPrjMenu() { 
     
    866910        } 
    867911    } 
     912 
     913    void refreshDocumentHelp() 
     914    { 
     915        if( documentMenu !is null ) delete documentMenu; 
     916        documentMenu = DocumentMenu(documentItem); 
     917        documentItem.setMenu(documentMenu); 
     918    } 
    868919} 
  • trunk/current/poseidon/poseidon/controller/packageexplorer.d

    r242 r244  
    10731073            ItemInfo info = pThis.getSelection(); 
    10741074             
    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 ); 
    10801079        }); 
    10811080    } 
  • trunk/current/poseidon/poseidon/controller/property/compilerpage.d

    r240 r244  
    1818class CompilerPage : AbstractPage 
    1919{ 
    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() 
     20private: 
     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() 
    56188    { 
    57189        setLayout( LayoutShop.createGridLayout( 1 ) ); 
     
    145277        } 
    146278 
     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 
    147300        // horizontal line 
    148301        with( new Label( compilerGroup, DWT.SEPARATOR | DWT.HORIZONTAL ) ) 
     
    150303 
    151304 
    152         // D Document 
    153         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 button 
    163         with( new Button( compilerGroup, DWT.PUSH ) )  
    164         { 
    165             setText( "..." ); 
    166             handleEvent( null, DWT.Selection, &onBrowseDDocument ); 
    167         } 
    168  
    169         // horizontal line 
    170         with( new Label( compilerGroup, DWT.SEPARATOR | DWT.HORIZONTAL ) ) 
    171             setLayoutData( new GridData( GridData.FILL, GridData.CENTER, true, false, 3, 1 ) ); 
    172              
    173305        with( btnUseThreadBuild = new Button( compilerGroup, DWT.CHECK ) ) 
    174306        { 
     
    210342        if( Globals.elDebug > 0 ) txtEL.setText( std.string.toString( Globals.elDebug ) ); 
    211343        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 
     411public:  
     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() 
    216447    { 
    217448        txtDMDPath.setText( "" ); 
    218449        txtDMCPath.setText( "" ); 
    219450        txtDebugger.setText( "" ); 
    220         txtDDocument.setText( "" ); 
     451        txtRC.setText( "" ); 
    221452        btnUseThreadBuild.setSelection( false ); 
    222453 
    223454        txtED.setText( "" ); 
    224455        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    } 
    289461} 
  • trunk/current/poseidon/poseidon/controller/property/generalpage.d

    r240 r244  
    1414class GeneralPage : AbstractPage 
    1515{ 
    16     private Button  chkShowSplash, chkLoadWorkspace, chkUseOutputWrap
     16    private Button  chkShowSplash, chkLoadWorkspace, chkUseOutputWrap, chkAbsoluteFullpath
    1717    private Text    txtExplorerFilters; 
     18    private Text[5] txtDDocuments; 
     19    private import std.string; 
    1820 
    1921 
     
    2931        Globals.loadWorkSpaceAtStart = chkLoadWorkspace.getSelection(); 
    3032        if( chkUseOutputWrap.getSelection() ) Globals.outputWRAP = DWT.WRAP; else Globals.outputWRAP = 0; 
     33        Globals.sendAbsoluteFullpath = chkAbsoluteFullpath.getSelection(); 
    3134        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(); 
    3240 
    3341        setDirty(false); 
     
    5664        chkLoadWorkspace = createCheckBox("gp.ld_wspace", Globals.loadWorkSpaceAtStart); 
    5765        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        } 
    58110 
    59111        Group explorerGroup = new Group( this, DWT.NONE ); 
    60112        explorerGroup.setText( Globals.getTranslation( "gp.filter" ) ); 
    61         auto gridLayout = new GridLayout(); 
     113        gridLayout = new GridLayout(); 
    62114        gridLayout.numColumns = 1; 
    63115        explorerGroup.setLayout( gridLayout ); 
    64         GridData gridData = new GridData( GridData.FILL_HORIZONTAL ); 
    65         explorerGroup.setLayoutData( gridData ); 
    66  
     116        explorerGroup.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) ); 
    67117 
    68118        with( txtExplorerFilters = new Text( explorerGroup, DWT.BORDER  ) ) 
     
    71121            setText( poseidon.util.miscutil.MiscUtil.getFilter( Globals.SplitedExplorerFilter ) ); 
    72122            handleEvent( null, DWT.Modify, &onAction ); 
    73         } 
     123        }       
    74124    } 
    75125 
     
    84134        chkLoadWorkspace.setSelection( true ); 
    85135        chkUseOutputWrap.setSelection( true ); 
     136        chkAbsoluteFullpath.setSelection( false ); 
     137        for( int i = 0; i < 5; ++ i ) 
     138            txtDDocuments[i].setText( "" ); 
     139         
    86140        txtExplorerFilters.setText( "*.c;*.cpp;*.h;*.xml;*.txt;*.def" ); 
    87141 
  • trunk/current/poseidon/poseidon/controller/property/preference.d

    r227 r244  
    149149        // seem too long, decrease the height 
    150150        Point pt = shell.getSize(); 
    151         pt.y -= 185
     151        pt.y -= 180
    152152        pt.x = pt.y * 10 / 11; 
    153153        shell.setSize(pt); 
     
    185185 
    186186    private void onClose(Event e) { 
    187  
     187        /+ 
    188188        foreach(IPropertyPage page; pages) 
    189189        { 
     
    191191                page.applyChanges(); 
    192192        } 
     193        +/ 
    193194 
    194195        if(font) 
  • trunk/current/poseidon/poseidon/controller/property/rescompilerpage.d

    r242 r244  
    77{ 
    88private: 
    9  
     9    import std.string; 
    1010    import dwt.all; 
    1111    import poseidon.globals; 
     
    1414    import poseidon.util.layoutshop; 
    1515    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     
    1925    char[]  title; 
    2026    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; 
    3751        getShell().close(); 
    3852    } 
    3953     
    4054    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 
    41144     
    42145protected: 
    43146    Shell createShell(Shell parent) 
    44147    {        
    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); 
    47150        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         } 
    68151 
    69152        with( new Label(shell, DWT.NONE) ) 
     
    74157 
    75158 
    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        } 
    86352 
    87353        // the bottom buttton bar 
     
    93359            pThis.onOK(); 
    94360        }  
    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         
    105363        shell.setDefaultButton(btnOK); 
    106364        shell.pack(); 
     365 
     366        Point pt = shell.getSize(); 
     367        pt.x = pt.y * 3 / 3; 
     368        shell.setSize(pt); 
     369        shell.setMinimumSize(pt); 
     370         
    107371         
    108372        return shell; 
     
    110374 
    111375public: 
    112     this (Shell parent, char[] title, char[] iniString) { 
    113         super (parent);  
     376    this( Shell parent, char[] title, char[] iniString ) 
     377    { 
     378        super( parent ); 
    114379        this.title = title; 
    115380        this.iniString = iniString; 
    116381    } 
    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     }    
    127382} 
  • trunk/current/poseidon/poseidon/globals.d

    r242 r244  
    2929    static public char[]    BudExe; 
    3030    static public char[]    DebuggerExe; 
    31     static public char[]    DDcoumentDir; 
     31    static public char[]    RCExe; 
     32    static public char[][]  DDcoumentDir; 
    3233    static public int       backBuild = 1; 
    3334    static public char[]    poseidonPath; 
     
    3839    static public int[]     BottomPanelLastWeight; 
    3940    static public char[][]  SplitedExplorerFilter; 
     41 
     42    static public char[][]  debuggerSearchPath; 
     43    static public int       sendAbsoluteFullpath = 1; 
    4044 
    4145    static public int       useCodeCompletion = 1; 
     
    455459            } 
    456460 
    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  
    464461            child = compilerChild.getChild("BUILDTYPE"); 
    465462            if( child ) 
     
    475472                if( at && at.GetValue().length > 0 ) outputWRAP = std.string.atoi( at.GetValue() ); 
    476473            } 
    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            }                
    478486        } 
    479487 
     
    623631            node.addAttrib( "path", DebuggerExe ); 
    624632 
    625             node = compiler_node.addNode( "DDOCUMENT" , null); 
    626             node.addAttrib( "path", DDcoumentDir );          
    627  
    628633            node = compiler_node.addNode( "BUILDTYPE" , null); 
    629634            node.addAttrib( "thread", std.string.toString( backBuild ) );    
     
    632637            node.addAttrib( "wrap", std.string.toString( outputWRAP ) ); 
    633638 
    634  
     639            node = compiler_node.addNode( "debuggerSearch", null ); 
     640            node.addAttrib( "path", std.string.join( debuggerSearchPath, ";" ) ); 
     641         
    635642        XMLnode parser_node = root.addNode("parsersetting", null); 
    636643            node = parser_node.addNode( "codecompletion" , null); 
     
    819826 
    820827            node.addAttrib("desktopweight", desktop ); 
     828            node.addAttrib("sendabspath", std.string.toString(sendAbsoluteFullpath) ); 
     829            node.addAttrib( "document", std.string.join( DDcoumentDir, ";" ) );          
     830 
    821831            char[] filter = poseidon.util.miscutil.MiscUtil.getFilter( SplitedExplorerFilter ); 
    822832            node.addAttrib("explorerfilters", filter ); 
     
    844854                shellBounds = _parseRect(bounds); 
    845855 
     856                sendAbsoluteFullpath = XMLUtil.getAttribInt(node, "sendabspath", sendAbsoluteFullpath); 
     857                char[] documentDir = XMLUtil.getAttrib( node, "document", null ); 
     858                DDcoumentDir = std.string.split( documentDir, ";" ); 
     859                 
    846860                char[] filter = XMLUtil.getAttrib( node, "explorerfilters", "*.c;*.cpp;*.h;*.xml;*.txt;*.def" ); 
    847861                SplitedExplorerFilter = poseidon.util.miscutil.MiscUtil.getSplitFilter( filter ); 
     862                 
    848863            } 
    849864        } 
  • trunk/current/poseidon/poseidon/intellisense/autocomplete.d

    r242 r244  
    526526            return null; 
    527527    } 
     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 
    528545 
    529546    void addProjectParser( char[][] paths ) 
  • trunk/current/poseidon/poseidon/model/project.d

    r243 r244  
    9595        ToolEntry entry = new ToolEntry(); 
    9696        entry.name = "Compile File"; 
     97 
     98        filename = getSentFileName( filename ); 
    9799 
    98100        if( this.DMDPath.length ) 
     
    826828 
    827829        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     
    829846 
    830847    private char[] getFileListDMD( bool bReBuild, bool bMakeLib ) 
     
    838855            if( bMakeLib )  
    839856            { 
     857                f = getSentFileName( f ); 
     858                 
    840859                char[] objFileName = std.path.getBaseName( std.path.getName( f ) ) ~ ".obj"; 
    841                         
     860         
    842861                if( objDir.length ) 
    843862                { 
     
    848867                } 
    849868                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                } 
    851876            } 
    852877            else 
    853878            { 
    854879                if( !bReBuild ) 
    855                     result ~= ( " " ~ getCompileTargetFileHSU( f ) ); 
     880                    result ~= ( " " ~ getSentFileName( getCompileTargetFileHSU( f ) ) ); 
    856881                else 
    857                     result ~= ( " " ~ f ); 
     882                    result ~= ( " " ~ getSentFileName( f ) ); 
    858883            } 
    859884        } 
  • trunk/current/poseidon/poseidon/style/dstyle.d

    r242 r244  
    1414    private import poseidon.util.miscutil; 
    1515    private import std.string, std.thread; 
     16    private import poseidon.controller.ddoc.ddocparser; 
    1617 
    1718    /+ 
     
    324325        if( bFunctionToolTip ) 
    325326        { 
     327            CDDocParser.showTip( sc, -1, listToolTip, 0x777777, 0xffffff ); 
     328            /+ 
    326329            sc.callTipCancel(); 
    327330             
     
    431434                sc.callTipShow( sc.positionFromPoint( callTipX, currentY ), listToolTip[0..length - 1] ); 
    432435            } 
     436            +/ 
    433437        } 
    434438        else 
     
    593597            if( treeNode ) 
    594598            { 
    595                 if( treeNode.DType == D_FUNCTION ) 
     599                if( treeNode.DType & D_FUNCTION ) 
    596600                { 
    597601                    if( bUseFunTip ) 
     
    14681472        } 
    14691473 
    1470         if( dword ) dword.reverse;else return false; 
     1474        if( dword.length ) dword.reverse;else return false; 
    14711475 
    14721476 
     
    14811485        } 
    14821486 
    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        /* 
    14841497        if( std.string.find( word, "import " ) > -1 ) return true; 
    14851498 
    14861499        return false; 
     1500        */ 
    14871501    } 
    14881502     
     
    15101524    } 
    15111525 
    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
    15131527    { 
    15141528        char[]  word; 
    15151529        dchar[] dword; 
    1516         int     pos = sc.getCurrentPos() - 2; 
     1530        int     pos = _pos < 0 ? sc.getCurrentPos() - 2 : _pos;//= sc.getCurrentPos() - 2; 
    15171531 
    15181532        if( !bFunctionToolTip ) 
     
    22422256 
    22432257 
    2244     private CAnalyzerTreeNode searchFunctionHead( Scintilla sc
     2258    private CAnalyzerTreeNode searchFunctionHead( Scintilla sc, int pos = -1
    22452259    { 
    22462260        if( !sAutoComplete.fileParser ) return null; 
    22472261         
    22482262        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         
    22512268        char                ch  = sc.getCharAt( pos ); 
    22522269        char[]              word, finalWord, paramWord; 
     
    24522469                        if( finalWord == "case" || finalWord == "default" ) 
    24532470                        { 
    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
    24582475                             
    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" ); 
    24632491                                char    c; 
    24642492                                bool    bGetOpencurly; 
     2493                                 
    24652494                                while( switchPos < posLeftParen ) 
    24662495                                { 
     
    24732502                                    switchPos ++; 
    24742503                                } 
     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                                } 
    24752576 
    24762577                                if( bGetOpencurly ) 
     
    24962597                            } 
    24972598 
    2498                             sc.gotoPos( originPos ); 
     2599                            sc.setAnchor( originAnchorPos ); 
     2600                            sc.setCurrentPos( originAnchorPos ); 
     2601                            //sc.gotoPos( originPos ); 
    24992602                            sc.hideSelection( false ); 
     2603                             
    25002604                        } 
    25012605                        break; 
     
    27892893    } 
    27902894 
    2791     public void performJumpToDefintion( Scintilla sc, inout 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
    27922896    { 
    27932897        // special version 
     
    27952899        { 
    27962900            if ( sc.getLineCount() <= 2 ) return null; 
    2797             int pos =  sc.getCurrentPos(); 
     2901 
     2902            int _pos = pos < 0 ? sc.getCurrentPos() : pos; 
     2903 
     2904 
    27982905            int endLine = sc.getLineCount(); 
    27992906            int endPos = sc.positionFromLine( endLine ); 
    28002907            char[] wordForward, wordBackward, word; 
    28012908         
    2802             char ch = sc.getCharAt( pos++ ); 
     2909            char ch = sc.getCharAt( _pos++ ); 
    28032910            wordForward ~= ch; 
    28042911 
    28052912            while( !isWordBreak( ch ) ) 
    28062913            { 
    2807                 ch = sc.getCharAt(pos++); 
     2914                ch = sc.getCharAt( _pos++ ); 
    28082915                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 ); 
    28142922         
    28152923            while( !isWordBreak( ch ) ) 
    28162924            { 
    2817                 ch = sc.getCharAt(pos--); 
     2925                ch = sc.getCharAt( _pos-- ); 
    28182926                wordBackward ~= ch; 
    2819                 if( pos <= 0 ) break; 
     2927                if( _pos <= 0 ) break; 
    28202928            } 
    28212929             
     
    28352943        bool                bDotEnd, bModuleScope, bFunctionToolTip = true; 
    28362944        char[]              typedWord, withName, listToolTip; 
    2837         char[][]            currentWords = readCurrentWholeWord( sc, bFunctionToolTip, bDotEnd ); 
     2945        char[][]            currentWords = readCurrentWholeWord( sc, bFunctionToolTip, bDotEnd, pos ); 
    28382946        CAnalyzerTreeNode   functionHeadNode; 
    28392947 
    2840         fileFullPath = ""; 
     2948        fileFullPath = moduleName = ""; 
    28412949        lineNum = -1; 
     2950        resultNode = originalFunctionNode = null; 
    28422951 
    28432952        if( !currentWords.length ) return; 
    2844  
    2845         //sGUI.outputPanel.appendLine( "Ori currentWords = " ~ std.string.join( currentWords, "~" ) ); 
    2846  
    28472953        char[] tail = _readHoverWord( sc ); 
    2848  
    2849         //sGUI.outputPanel.appendLine( "tail = " ~ tail ); 
    2850  
    28512954        currentWords[length-1] = tail; 
    28522955 
    28532956        if( currentWords[0].length ) 
    28542957            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; 
    28612958 
    28622959        if( !currentWords[0].length ) 
     
    28702967        } 
    28712968 
     2969        //sGUI.outputPanel.appendLine( "Fixed currentWords = " ~ std.string.join( currentWords, "~" ) ); 
     2970 
    28722971 
    28732972        bool    bIsImport = haveImportKeyWord( sc ); 
     
    28772976            if( functionHeadNode is null ) 
    28782977            { 
    2879                 functionHeadNode = searchFunctionHead( sc ); 
     2978                functionHeadNode = searchFunctionHead( sc, pos ); 
    28802979                if( bModuleScope ) 
    28812980                { 
     
    28852984            } 
    28862985 
    2887             //MessageBox.showMessage( "functionHead = " ~functionHeadNode.identifier ); 
    2888  
    28892986            withName = getWithName( functionHeadNode ); 
    28902987            if( withName.length ) currentWords = withName ~ currentWords; 
     
    28922989            originalFunctionNode = functionHeadNode; 
    28932990 
    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 ); 
    28972994                if( easyNode !is null ) 
    28982995                { 
     2996                    resultNode = easyNode; 
    28992997                    lineNum = easyNode.lineNumber; 
    29002998                    while( !( easyNode.DType & D_MAINROOT ) ) 
     
    29053003                        { 
    29063004                            fileFullPath =  easyNode.getLeaf( 0 ).typeIdentifier; 
     3005                            moduleName = easyNode.getLeaf( 0 ).identifier; 
    29073006                            return; 
    29083007                        } 
     
    29113010             
    29123011         
    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                } 
    29223085            } 
    29233086        }