Changeset 264
- Timestamp:
- 10/12/07 23:36:41 (1 year ago)
- Files:
-
- trunk/src/leds/BrowserView.d (modified) (1 diff)
- trunk/src/leds/CodeEdit.d (modified) (2 diffs)
- trunk/src/leds/CodeEditFactory.d (added)
- trunk/src/leds/CodeView.d (modified) (11 diffs)
- trunk/src/leds/KeyMap.d (modified) (4 diffs)
- trunk/src/leds/Language.d (modified) (4 diffs)
- trunk/src/leds/LanguageD.d (modified) (1 diff)
- trunk/src/leds/Leds.d (modified) (2 diffs)
- trunk/src/leds/Project.d (modified) (1 diff)
- trunk/src/leds/Scintilla.d (modified) (1 diff)
- trunk/src/leds/SourceViewEdit.d (modified) (9 diffs)
- trunk/src/leds/SystemConsole.d (modified) (8 diffs)
- trunk/src/leds/TrashUI.d (modified) (1 diff)
- trunk/src/leds/Workspace.d (modified) (2 diffs)
- trunk/src/property/PropertiesUI.d (modified) (2 diffs)
- trunk/src/property/PropsUI.d (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/leds/BrowserView.d
r253 r264 606 606 //if ( window.getWidth()+cellX+4 > treeView.getWidth() ) 607 607 { 608 window.show ();608 window.showAll(); 609 609 window.move(event.xRoot-cellX + 4, event.yRoot-cellY + 3); 610 610 } trunk/src/leds/CodeEdit.d
r253 r264 24 24 25 25 private import dool.String; 26 27 private import leds.Scintilla; // TODO to be removed transition for Scintilla independence 28 26 29 27 30 public: … … 43 46 public interface CodeEdit 44 47 { 48 49 public: 50 static final int MARK_SHORTARROW = leds.Scintilla.SC_MARK_SHORTARROW; 51 52 45 53 public: 46 54 //void addCodeEditListener(CodeEditListener listener); trunk/src/leds/CodeView.d
r258 r264 28 28 29 29 private import leds.FileView; 30 30 //////// 31 31 private import leds.CodeEdit; 32 32 … … 53 53 import leds.Workspace; 54 54 import leds.BrowserView; 55 import leds.SimpleCodeEdit;56 55 57 56 import leds.Language; … … 77 76 import leds.WrapGtk; 78 77 79 import leds.Scintilla; 80 import leds.SimpleCodeEdit; 81 version(SourceView) import leds.SourceViewEdit; 78 private import leds.CodeEditFactory; 79 82 80 private import gtk.Widget; 83 81 private import gtk.Menu; … … 199 197 this.project = project; 200 198 201 version(Win32) 202 { 203 codeEdit = new Scintilla(); 204 // codeEdit = new SimpleCodeEdit(); 205 } 206 else 207 { 208 if ( Leds.leds.editorType == "internal" ) 209 { 210 codeEdit = new SimpleCodeEdit(); 211 } 212 else if ( Leds.leds.editorType == "textView" ) 213 { 214 codeEdit = new SimpleCodeEdit(); 215 } 216 else if ( Leds.leds.editorType == "sv" ) 217 { 218 219 version(SourceView) codeEdit = new SourceViewEdit(); 220 } 221 else 222 { 223 codeEdit = new Scintilla(); 224 } 225 } 199 codeEdit = CodeEditFactory.getCodeEdit(); 200 226 201 codeEdit.getWidget().setSizeRequest(1,1); 227 202 if (this.getLanguageHandler()) { … … 773 748 bool allowClose(bool askUser) 774 749 { 775 writefln("CodeView.allowClose 1");776 750 bool allow = true; 777 751 if ( !userAllowClose && getModified() ) 778 752 { 779 writefln("CodeView.allowClose 2");780 753 ResponseType responce = PopupBox.yesNoCancel( 781 754 workspace, … … 792 765 793 766 } 794 writefln("CodeView.allowClose 3");795 767 userAllowClose = allow; 796 writefln("CodeView.allowClose 4");797 768 return allow; 798 769 } … … 914 885 public void clearErrors() 915 886 { 916 codeEdit.markerDeleteAll( SC_MARK_SHORTARROW);887 codeEdit.markerDeleteAll(CodeEdit.MARK_SHORTARROW); 917 888 errorLines.length = 0; 918 889 errors = null; … … 980 951 public void markError(int lineNumber, String message, int color = 0x3333FF) 981 952 { 982 codeEdit.markerSetBack( SC_MARK_SHORTARROW,color);983 int markHandle = codeEdit.markAdd(lineNumber-1, SC_MARK_SHORTARROW);953 codeEdit.markerSetBack(CodeEdit.MARK_SHORTARROW,color); 954 int markHandle = codeEdit.markAdd(lineNumber-1, CodeEdit.MARK_SHORTARROW); 984 955 //errors[lineNumber] = line; 985 956 int pos = message.find("):"); … … 2761 2732 bool editUpdateUI() 2762 2733 { 2763 printf("CodeView.editUpdateUI \n" );2734 //printf("CodeView.editUpdateUI \n" ); 2764 2735 userAllowClose = false; 2765 2736 if (!inChange ) … … 2890 2861 bool editKey(int ch, int modifiers) 2891 2862 { 2892 //printf("CodeView.editKey SCN_KEY %d -- %X\n", ch,ch );2863 printf("CodeView.editKey SCN_KEY %c %d -- %X\n", ch, ch,ch ); 2893 2864 //printf("CodeView.editKey SCN_MODIFIERS %X\n", modifiers ); 2894 2865 int chConverted; … … 3064 3035 } 3065 3036 break; 3037 case CodeCommand.IMPORT: 3038 if ( project !is null && languageHandler !is null) 3039 { 3040 languageHandler.addImports(project, getText()); 3041 } 3042 break; 3043 3066 3044 default: 3067 3045 processed = false; trunk/src/leds/KeyMap.d
r36 r264 35 35 COMMENT_OUT, 36 36 UNCOMMENT, 37 CODE_LOOKUP 37 CODE_LOOKUP, 38 IMPORT 38 39 } 39 40 … … 54 55 "commentOut", 55 56 "uncomment", 56 "codeLookup" 57 "codeLookup", 58 "import" 57 59 ]; 58 60 … … 73 75 "Comment out", 74 76 "Uncommnet", 75 "Code lookup Key" 77 "Code lookup Key", 78 "Generate imports" 76 79 ]; 77 80 … … 92 95 "o", 93 96 "O", 94 " " 97 " ", 98 "i" 95 99 ]; 96 100 trunk/src/leds/Language.d
r242 r264 29 29 import leds.CodeView; 30 30 import leds.CodeEdit; 31 import leds.Scintilla;32 31 import leds.Workspace; 33 32 import leds.FileView; 34 33 import leds.BrowserView; 34 import leds.Project; 35 35 import property.Properties; 36 36 … … 136 136 return true; 137 137 } 138 /** 139 * setup all the options for scintilla to render language correctly. 140 * @param scintilla 141 */ 142 void setLex(Scintilla scintilla) 143 { 144 145 } 138 146 139 /** 147 140 * show help in help bar giving autocompletion or just a string. … … 157 150 void setLex(CodeEdit codeEdit) 158 151 { 159 if (cast(Scintilla) codeEdit is null) {160 return;161 }162 163 this.setLex(cast(Scintilla) codeEdit);164 165 152 } 166 153 … … 296 283 } 297 284 285 public char[] addImports(Project project, String sourceCode) 286 { 287 return null; 288 } 298 289 299 290 } trunk/src/leds/LanguageD.d
r255 r264 1396 1396 */ 1397 1397 } 1398 1399 public char[] addImports(Project project, String sourceCode) 1400 { 1401 Element element = getCachedModule(true); 1402 listElements(element); 1403 //element.dumpChildren(true); 1404 return null; 1405 } 1406 1407 private void listElements(Element element, char[] tab="") 1408 { 1409 foreach ( Element el ; element.elements ) 1410 { 1411 writefln("%sel(%s).type = %s", tab, el.name, el.returnType); 1412 listElements(el, tab~" "); 1413 } 1414 } 1415 1398 1416 } 1399 1417 trunk/src/leds/Leds.d
r249 r264 816 816 else 817 817 { 818 // Duit.initMultiThread(args);818 //GtkD.initMultiThread(args); 819 819 GtkD.init(args); 820 820 } … … 838 838 debug(startup) writefln("Leds.main 4"); 839 839 GtkD.main(); 840 //GtkD.mainThreads(); 840 841 debug(startup) writefln("Leds.main 5"); 841 842 } trunk/src/leds/Project.d
r258 r264 782 782 super(usePhobos, project, target); 783 783 } else { 784 super( project, target);784 super(true, project, target); 785 785 } 786 786 } trunk/src/leds/Scintilla.d
r261 r264 18 18 19 19 module leds.Scintilla; 20 21 20 private import gtk.Container; 22 21 private import gtk.Widget; trunk/src/leds/SourceViewEdit.d
r254 r264 19 19 module leds.SourceViewEdit; 20 20 21 debug = flow; 21 //debug = flow; 22 //debug = todo; 22 23 23 24 //version(linux) … … 375 376 { 376 377 insertIter(); 377 printf("SourceViewEdit.getCurrLine getCurrLine = %d\n", iter.getLine());378 //printf("SourceViewEdit.getCurrLine getCurrLine = %d\n", iter.getLine()); 378 379 return iter.getLine(); 379 380 } … … 461 462 TextMark markSel = buffer.getMark("selection_bound"); 462 463 463 writefln("find positions %s %s", iterStart.getOffset(), iterEnd.getOffset());464 //writefln("find positions %s %s", iterStart.getOffset(), iterEnd.getOffset()); 464 465 465 466 buffer.moveMark(mark, iterStart); … … 824 825 { 825 826 iter.setOffset(position); 826 printf("SourceViewEdit.lineFromPosition = %d posiion=%d\n", iter.getLine(), position);827 //printf("SourceViewEdit.lineFromPosition = %d posiion=%d\n", iter.getLine(), position); 827 828 return iter.getLine(); 828 829 } … … 830 831 int markerLineFromHandle(int key) 831 832 { 832 writefln("SourceViewEdit.markerLineFromHandle TODO");833 debug(todo)writefln("SourceViewEdit.markerLineFromHandle TODO"); 833 834 return -1; 834 835 } … … 836 837 void setWhiteSpaceFor(Color color) 837 838 { 838 writefln("SourceViewEdit.setWhiteSpaceFor TODO");839 debug(todo)writefln("SourceViewEdit.setWhiteSpaceFor TODO"); 839 840 } 840 841 841 842 void setWhiteSpaceBack(Color color) 842 843 { 843 writefln("SourceViewEdit.setWhiteSpaceBack TODO");844 debug(todo)writefln("SourceViewEdit.setWhiteSpaceBack TODO"); 844 845 } 845 846 846 847 void callTipShow(int position, String message) 847 848 { 848 writefln("SourceViewEdit.callTipShow TODO");849 debug(todo)writefln("SourceViewEdit.callTipShow TODO"); 849 850 } 850 851 851 852 bool isAutoCompletionActive() 852 853 { 853 writefln("SourceViewEdit.isAutoCompletionActive TODO");854 debug(todo)writefln("SourceViewEdit.isAutoCompletionActive TODO"); 854 855 return false; 855 856 } … … 860 861 void showAutoCompletion(int start, String[] list) 861 862 { 862 writefln("SourceViewEdit.showAutoCompletion TODO");863 debug(todo)writefln("SourceViewEdit.showAutoCompletion TODO"); 863 864 Menu popupMenu = new Menu(); 864 865 foreach ( String str ; list ) … … 866 867 writefln("\t%s",str); 867 868 //popupMenu.append(new MenuItem(str.toString,&autoInsert)); 868 popupMenu.append(new MenuItem(&autoInsert, str.toString, str.toString)); 869 popupMenu.append( 870 new MenuItem(&autoInsert, str.toString, str.toString[start..str.length]) 871 ); 869 872 } 870 873 popupMenu.showAll(); … … 879 882 void showUserList(int start, String[] list) 880 883 { 881 writefln("SourceViewEdit.showUserList TODO");884 debug(todo)writefln("SourceViewEdit.showUserList TODO"); 882 885 } 883 886 884 887 void setCodePage(int codePage) 885 888 { 886 writefln("SourceViewEdit.setCodePage TODO");889 debug(todo)writefln("SourceViewEdit.setCodePage TODO"); 887 890 } 888 891 889 892 void setCodePage(String codeID ) 890 893 { 891 writefln("SourceViewEdit.setCodePage TODO");894 debug(todo)writefln("SourceViewEdit.setCodePage TODO"); 892 895 } 893 896 894 897 int getCodePage() 895 898 { 896 writefln("SourceViewEdit.getCodePage TODO");899 debug(todo)writefln("SourceViewEdit.getCodePage TODO"); 897 900 return 0; 898 901 } trunk/src/leds/SystemConsole.d
r230 r264 51 51 private import gtk.TextIter; 52 52 53 private import gdk.Threads; 54 53 55 54 56 private import dool.Queue; 55 57 58 59 private import gobject.ObjectG; 60 private import gtkc.gobjecttypes; 61 56 62 57 63 /** … … 148 154 { 149 155 executing = state; 156 writefln("SystemConsole.setExecuting 1"); 157 //gdkThreadsEnter(); 150 158 workspace.refreshDockableLabel(this); 159 //gdkThreadsLeave(); 151 160 } 152 161 } … … 293 302 if ( textView !is null ) 294 303 { 304 writefln("SystemConsole.append 1"); 305 //gdkThreadsEnter(); 295 306 textView.appendText(text); 307 //gdkThreadsLeave(); 296 308 } 297 309 } … … 381 393 Spawn spawn = new Spawn(commArgs); 382 394 383 //version(Win32)395 // version(Win32) 384 396 { 385 397 int result = spawn.commandLineSync( … … 392 404 // else 393 405 // { 394 // int result = spawn.execAsyncWithPipes( 395 // &childEnd, 396 // &appendOutputLine, 397 // &appendErrorLine 398 // ); 399 // Path.chdir(oldDir); 406 // if ( async ) 407 // { 408 // int result = spawn.execAsyncWithPipes( 409 // &childEnd, 410 // &appendOutputLine, 411 // &appendErrorLine 412 // ); 413 // Path.chdir(oldDir); 414 // } 415 // else 416 // { 417 // int result = spawn.commandLineSync( 418 // &childEnd, 419 // &appendOutputLine, 420 // &appendErrorLine 421 // ); 422 // Path.chdir(oldDir); 423 // } 400 424 // } 401 425 } 426 427 402 428 403 429 /** … … 408 434 * Returns: false 409 435 */ 410 bool childEnd(Spawn spawn)436 synchronized bool childEnd(Spawn spawn) 411 437 { 412 438 this.exitStatus = spawn.exitStatus; … … 414 440 writefln("SystemConsole.childEnd (calling queue) for %s", getTabName()); 415 441 childQueue.push(spawn); 442 //CallBackIdle(&childQueue.push, spawn); 416 443 417 444 if ( allowBeep && Leds.leds.getPropValue("beepOnCommandEnd", true) ) … … 428 455 } 429 456 457 writefln("SystemConsole.childEnd (calling queue) for %s (done)", getTabName()); 430 458 return false; 431 459 } trunk/src/leds/TrashUI.d
r230 r264 51 51 private import gtkc.gtktypes; 52 52 private import gtkc.gobjecttypes; 53 54 private import gobject.ObjectG; 55 56 53 57 54 58 /** trunk/src/leds/Workspace.d
r253 r264 710 710 mtb.addOnClicked(&runButtonClicked); 711 711 712 mtb = new MenuToolButton(StockID.APPLY); 713 toolbar.insert(mtb); 714 mtb.setTooltip("Debug last selected target", ""); 715 mtb.setArrowTooltip("Select the target to debug", ""); 716 mtb.setMenu(new Menu()); 717 mtb.addOnShowMenu(&toolButtonDebugMenu); 718 mtb.addOnClicked(&debugButtonClicked); 719 712 720 //addButton(StockID.STOP,"nothing for now (stop)","toolbar.stop"); 713 721 … … 971 979 toolButton.setMenu(popupMenu); 972 980 } 973 974 } 975 981 } 982 983 public void debugButtonClicked(ToolButton toolButton) 984 { 985 if ( !repeatCommand(prevRunCommand) ) 986 { 987 runCodeView(); 988 } 989 } 990 991 public void toolButtonDebugMenu(MenuToolButton toolButton) 992 { 993 Menu menu = null; 994 Project project = getProjectView().getCurrentProject(); 995 if ( project !is null ) 996 { 997 //project.selectAndRunTarget(event); 998 menu = project.getRunMenu(); 999 } 1000 if ( menu !is null ) 1001 { 1002 toolButton.setMenu(menu); 1003 } 1004 else 1005 { 1006 Menu popupMenu = new Menu();; 1007 MenuItem item = new MenuItem("No Project Seleced"); 1008 popupMenu.append(item); 1009 popupMenu.append(new SeparatorMenuItem()); 1010 popupMenu.append(new MenuItem("cancel")); 1011 popupMenu.showAll(); 1012 1013 toolButton.setMenu(popupMenu); 1014 } 1015 } 976 1016 // todo add a list a recent run and make commands to the run and make drop down menus 977 1017 trunk/src/property/PropertiesUI.d
r242 r264 66 66 private import gtk.Alignment; 67 67 68 69 68 private import glib.Str; 70 69 … … 72 71 private import gtkc.gdktypes; 73 72 private import gdk.Event; 73 74 private import gobject.ObjectG; 75 private import gtkc.gobjecttypes; 74 76 75 77 trunk/src/property/PropsUI.d
r242 r264 55 55 private import gtkc.gtktypes; 56 56 57 private import gobject.ObjectG; 58 private import gtkc.gobjecttypes; 59 60 57 61 /** 58 62 * Defines a visual interface for on Props
