Getting a new computer

So, I’ll be getting a new computer in about a week or so. It’s a Toshiba Satellite P855-S5200, and is pretty good.

Specs if anyone is interested:

  • Intel Core i7-3610QM (quad-core, 2.3 GHz with Turbo Boost up to 3.3 GHz, 6 MB L3 cache)
  • Mobile Intel HD graphics, 64 MB – 1696 MB dynamically allocated graphics memory
  • 750 GB 5400 rpm Serial ATA HDD
  • 8 GB DDR3 1600 MHz
  • I’m too lazy to post the rest.

It’s rather better than my current computer, which is an IBM ThinkPad T41. (With an Intel Pentium M 1.6 GHz processor, 1 GB RAM, and 160 GB HDD. Hey, it’s not bad if you live in 2003.)

After I get it it might be a while before a post anything new about my programming stuff, as I’ll have to get it everything installed, and files copied over, and all that.

Advertisements

pytextedit 0.1 is complete!

Right, so I just finished pytextedit 0.1. It should (hopefully) work now, with no major bugs or anything. However, I haven’t tested it much with Python 2, so I can only say it works well with Python 3.

pytextedit 0.1

Download

You can download it here, if you want. It’s currently source code only, but I’m working on creating both Linux and Windows executables.

Changelog

The biggest change for a user is probably the improved Options dialog. Additionally, it is now no longer necessary to edit the configuration file manually, as the new dialog also saves the settings.

Not all the important changes would be obvious to a user though. I cleaned up a lot of the code, as well as improved the comments.

Here are all of the changes:

  • Added .json to the filetypes list for JavaScript.
  • Removed “Options -> View Options”.
  • The background color of the toolbar is now set to ED_LN_BG as well.
  • Removed spellchecker.
  • Removed ED_CMD_INIT_DIR. Now ED_INIT_DIR is used for the command line as well.
  • opt_font_size() will now refuse to change the font size if it would be less than 1.
  • Added an option for .java files in the filetypes list.
  • Added a command in “Code -> Compile” for compiling Java files.
  • ED_INIT_DIR will now be set to “C:” for the HOME dircetory on Windows.
  • Created a new directory called “resources” for storing anything the application needs.
  • Moved “images” directory into “resources”.
  • Added a keybinding for F5 to file_reload().
  • Added “File -> Quick Open”.
  • There is now a LICENSE file.
  • There is now a README file.
  • Added “Code -> Remove Tags”.
  • Clicking on “Cancel” when saving a file when exiting will now not close the application anyway.
  • Line numbers can now be hidden.
  • Added improved “About” dialog.
  • Code menu can no longer be disabled.
  • Context menu can no longer be disabled.
  • Modified a few menu items in “File”.
  • Added “File -> Favorites” and “Options -> Edit Favorites”.
  • “Recently Opened” now saves across sessions.
  • Added key binding for “Favorites”.
  • Default font name is now “courier”.
  • Fixed how line numbers wouldn’t match up with text.
  • Changing the font name/size will change the font in the line numbers as well.
  • file_open() now closes files after it is done reading.
  • Window size and position is now saved across sessions.
  • Removed ED_WIN_SIZE.
  • Added a CSS entry in the filetypes list.
  • Removed all references to ED_TITLE, and removed that variable.
  • Renamed Textbox_LN to TextboxLN.
  • Added function internal_return_focus() for simplifying returning the focus to the text box.
  • Fixed bug where pressing Tab wouldn’t change gbl_text_modified.
  • Removed “import glob”. It wasn’t used by anything.
  • Removed gbl_browse_dlg and gbl_fullscreen. I honestly have no idea what they were for, as they weren’t used by anything.
  • Fixed bug where you couldn’t open a new file if current file was locked.
  • Removed “Search -> Move Insert To…”.
  • Removed tools_insert_pos() function, it wasn’t used anymore.
  • Simplified lots of the code. (Mostly removing unnecessary try-except blocks.)
  • Made some except blocks handle specific errors, rather then catching all.
  • Simplified the GUI code. There was an unnecessary frame.
  • Simplified edit_lock().
  • Removed “Edit -> Selection -> Move Selection”.
  • Merged file_save_as() into file_save().
  • When getting all text, the indexes “1.0” and “end-1c” are now always used. Before it was very inconsistent.
  • Same as above, but for deleting all text.
  • Fixed bug where “Revert to Last Save” would scroll to the bottom.
  • Fixed bug where “Revert to Last Save” would not mark the text as having no changes.
  • “Revert to Last Save” now clears the undo/redo stack.
  • Improved some of the code for loading a file from the command line. I had forgotten to update it as I did the other stuff. (Oops.)
  • Further improved comments.
  • Changed the default gbl_dlg_open_url to “http://”.
  • gbl_saved_data is now updated when the file is opened as well.
  • UI options now apply to scrollbars as well.
  • Rewrote check_modified().
  • Added function internal_text_modified() function for simplifying marking text as having changes.
  • Rewrote all functions to use internal_text_modified().
  • Simplified the code for opening from command line.
  • Rewrote file_exit() to use a Toplevel (again).
  • Removed “Font” toolbar button.
  • Added “Options” toolbar button.
  • Added the options dialog.
  • Removed “Options -> Font” and corrosponding function.
  • Fixed bug where “Indent All” and “Unindent All” would not work for the last line.
  • Simplified TextboxLN.

What’s next?

There are still a lot of features I want to add that will probably go into pytextedit 0.2:

  • Syntax highlighting. I already have the basics of how to do this, but figuring out all the regular expressions will take a while.
  • Multi-document interface. Again, I already know how I am basically going to do this. It might take some time to implement it, though, as there are many changes to make.
  • File browser. This will allow users to browse, organize, and otherwise manage their files without having to switch to another application.
  • Better support for opening files over HTTP. Biggest improvement will be added Unicode support.
  • Tons of other miscellaneous stuff.

Changes in pytextedit, Aug. 24

I don’t have any main thing I’ve been working on today, so here’s a list of the changes in pytextedit since last post:

  • Window size and position is now saved across sessions.
  • Removed ED_WIN_SIZE.
  • Added a CSS entry in the filetypes list.
  • Removed all references to ED_TITLE, and removed that variable.
  • Renamed Textbox_LN to TextboxLN.
  • Added function internal_return_focus() for simplifying returning the focus to the text box.
  • Fixed bug where pressing Tab wouldn’t change gbl_text_modified.
  • Removed “import glob”. It wasn’t used by anything.
  • Removed gbl_browse_dlg and gbl_fullscreen. I honestly have no idea what they were for, as they weren’t used by anything.
  • Fixed bug where you couldn’t open a new file if current file was locked.
  • Removed “Search -> Move Insert To…”.
  • Removed tools_insert_pos() function, it wasn’t used anymore.
  • Simplified lots of the code. (Mostly removing unnecessary try-except blocks.)
  • Made some except blocks handle specific errors, rather then catching all.
  • Simplified the GUI code. There was an unnecessary frame.
  • Simplified edit_lock().
  • Removed “Edit -> Selection -> Move Selection”.
  • Merged file_save_as() into file_save().
  • When getting all text, the indexes “1.0” and “end-1c” are now always used. Before it was very inconsistent.
  • Same as above, but for deleting all text.

pytextedit: options dialog is complete!

I completed this a lot earlier than I though I would. Well, the UI is complete, anyway. The functionality still needs to be added.

Everything works exactly how I wanted it to, although the code is rather larger than what I’d prefer. It’s basically impossible to do much about that, though, as it’s mostly for the Entry and OptionMenu widgets.

If you’re interested you can try it out yourself.

Changes for pytextedit 0.1

Since it will likely be a while until I’m finished with version 0.1, I thought I’d post of list of some of the improvements there will be. (Also to make sure I stay focused and actually get it done.)

  • A completely redone setting system. It will no longer require you to edit the pytextedit_config.py file yourself, but will instead have a settings dialog in the main application. The configuration file will be converted to plain text, to make it easier to read/write. Also, settings will save across sessions.
  • Fixed default  directory on Windows. Currently trying to set it to the HOME variable doesn’t work on Windows. Instead, it will default to “C:”.
  • Recently Opened will save across sessions, by storing the file paths in a text file. It may also be changed to use a menu instead of a separate window.
  • Open File will close the file after it has been read from.
  • Some minor UI changes to make it look better.
  • Textbox_LN (the class used to implement line numbers) will be simplified. Currently it has unnecessary code that allows it to support more than one textbox. Considering I only need one, this is absolutely useless.
  • It will be possible to disable line numbers.
  • Improved key bindings.
  • Improved About dialog.
  • Help dialogs for toolbar buttons. I’m still trying to decide how to do this. Possibly have a right-click open the dialog?
  • A new Quick Open command in the File menu for opening files without going through the entire open dialog.
  • Font size will no longer be able to be under 1.
  • Functions will be moved to a separate file in the resources directory called functions.py. This makes it easier to edit them, as I will no longer have to scroll all the time to switch between the functions and the code for the UI.
  • Classes will be in their own file as well.
  • The file browser might be back. Emphasis on “might.”
  • Adding a README file. I honestly don’t know why I haven’t already done this.
  • More added to the file types list?
  • The View Options command in the Options menu will be gone, as it will be useless with the new dialog.
  • Simplify some of the configuration. For example, get rid of ED_CMD_INIT_DIR and use ED_INIT_DIR for both the GUI and CLI.
  • Spellchecker will be removed. It might be back in a later version, if I can improve it. As it is it really isn’t useful.
  • Default font will be changed. Evidently “monospaced” isn’t a recognized value. “Courier” or “courier new” will probably be used instead, to remain as cross-platform as possible.
  • Window size will be saved, and restored when the application is next opened. I’m still trying to figure out how to do this. Probably get the window size and position on exit (both through the Exit command or using WM_DELETE_WINDOW), save it to a file (“resources/lastsize”), and read the file on next open.

pytextedit 0.1 alpha 4

Okay, so I just finished pytextedit 0.1 alpha 4. There are a LOT of changes for this version:

  • COMMENTED ENTIRE CODE! YAY! (that took forever)
  • Removed old file_exit() function. (It was still there, as file_exit_old().)
  • Revised new file_exit() to quit without confirmation if file was saved.
  • Added option to hide file label.
  • Moved “Run Code (…)” commands into a new submenu, “Code -> Run Code.”
  • Added submenu “Code -> Compile” with options to compile C and C++ code. Also added corrosponding options in config file.
  • Tweaked keyboard shortcuts a little.
  • Added a “Delete” command to “File” menu.
  • Added a “Rename” command to “File” menu.
  • Modified some window titles to be more consistent.
  • Added button to “Recently Opened” dialog to clear list.
  • Fixed a bug in “Rename” where it didn’t stop the function while not having a file open.
  • Changed “Copy” to work while file is locked (why shouldn’t it?).
  • Cut some unneccesary code from edit_line_cut().
  • Modified “Select All” to keep cursor at current position, instead of moving it to top.
  • Removed some useless lines from the “Replace” functions.
  • Removed some useless lines from lots of functions.
  • Added improved “Font” options dialog, with entries for font name, font size, font style, foreground, and background.
  • Removed “Colors…” command in “Options” menu, as it is useless now. (See above.)
  • Added improved “Insert Tag” dialog.
  • Updated and improved the “About” dialog.
  • Commented the code to build the menus a little better.
  • Changed the buttons in the “Exit” dialog to have a little padding.
  • Removed the file browser. (At least for now. I might add it back it if I improve it a little.)
  • Changed the title in the dialog used by “Rename” to say “Rename”.
  • Fixed bug where clicking “Cancel” in the “Rename” dialog would result in an error.
  • Removed “Edit -> Lock File” submenu, and replaced it with a checkbutton.
  • Fixed the problem (I wouldn’t even call it a bug) where changing the file to read/write mode would add an unnecessary “-” to the title when no file was open.
  • Changed “style” entry in the “Font” options dialog to an OptionMenu, to limit the choices.
  • Further improved the “Font” options dialog by merging the “Wrap” options dialog with it.
  • Added (yet another) new “Exit” dialog, this time using the tkinter Dialog from tkinter.dialog.
  • Switched positions of “Copy” and “Cut” in the “Edit” menu.
  • Removed the file label.
  • Added toolbar.
  • Added an option in the config file to show/hide toolbar.
  • Fixed bug where clicking “Cancel” in the askcolor() dialogs for the “Font” options dialog would result in an error.
  • Added line numbers.
  • Updated “Options -> View Options”.
  • Removed “Case Sensitivity” command from “Options”.
  • Added new “Replace” dialog, merging “Replace”, “Replace All”, and all the others into one dialog.
  • Removed unnecessary menu items from “Search”. (See above.)
  • Removed config file option to change default title.
  • Fixed bug where trying to paste when nothing is in the clipboard results in an error.
  • “Ctrl+1” now increases font size by one, and “Ctrl+2” now decreases font size by one.
  • Removed “last action” label from status bar.
  • Disabled spellchecker by default.
  • Added “File -> Insert” command to insert text from another file into the current one.
  • Fixed a few inconsistencies with the menus.
  • Added “Tools -> Bookmarks” submenu.
  • Added a “Context Menu -> Bookmarks” submenu.
  • Fixed bug where trying to open a file while current file was locked wouldn’t work.
  • Added improved “Find” dialog, with case insensitive checkbox.
  • Added “Search -> Find Selected…” and “Search -> Find in Selected…” commands.
  • Removed “Search -> Find Again” command.
  • Modified keyboard shortcuts for “Search” menu.
  • Removed the status bar, due to problems with the labels and general uselessness.
  • Merged “Selected Statistics” and “Insert Position” into “Statistics”.
  • Added a keybinding for opt_font().
  • Modified keybindings for “Jump to Top/Bottom/Insert”.

Obligatory screenshot:

0.1 Alpha 4

Download here, if you want it.

Version 0.1 final will have a lot of changes, so it might be a while.