Change Log:
1.1:
* Added the ability for multiple, simultaneous undo/redo. Previously,
you had to undo/redo multiple items one at time. To implement this,
several aspects of menu enabling have changed. Before, you would
call SimpleUndoRedoMenu::Set() within your UpdateEditUndo() and
UpdateEditRedo() routines. Now, you query the undo manager directly
(the caption, if there is one, will already be present), e.g.,
void CRicherEditView::OnUpdateEditUndo(CCmdUI* pCmdUI)
{
// was: CSimpleUndoRedoMenu::Set(pCmdUI, GetActionTarget());
if (gUndoManager->CanUndo(GetActionTarget()))
pCmdUI->Enable(TRUE);
else
pCmdUI->Enable(FALSE);
}
To support simultaneous undo/redo, several new command ranges
(ID_UNDO_0...ID_UNDO_9, ID_REDO_0...ID_REDO_9) and handlers,
OnMultipleUndo() and OnMultipleRedo().
Two new callback routines were added which, in addition to marking
the document dirty or clean as the original callback did, also build
the appropriate menus. The callbacks are
UMCmdTargetNotifier -- original notifier; marks document dirty/clean
UMSimpleMenuBuilder -- sets caption to "Undo" + action name + accelerator
UMSubmenuBuilder -- creates submenu with up to 10 actions
The CRicherEditView and CBetterEditView classes work with all three,
differing in only the amount of feedback given to the user. To achieve
efficient menu rebuilding, menus are generally constructed only when
needed and only when changed. This is unlike using the UpdateXXX()
handlers which (1) update often (e.g., every time you select the item)
and (2) update several times (e.g., the same handler can be invoked for
a tool button and menu item.)
One minor change to allow correct menu updating in the context of MDI
is that a "NULL" action (i.e., gUndoManager->Set(..., 0)) will force
a menu rebuild.
Also note that this invalidates some of the programmer's guide. Since it's
so long, and probably needed (extensive) reformatting, I didn't want to
force another revision on the codeguru guys.
* Removed the const declaration and changed the name of the default
notification callback to gUMDefaultNotifier. It still defaults to
UMCmdTargetNotifier but you can set it to something else if you want
all action targets to use that routine. You would do this in your
application
* Removed some experimental code in CRicherEditView and CUndoManager. The
OLE drag & drop stuff (obviously) doesn't work; the class CUndoManagerData
was never used but was (part of) an attempt to use MFC's command routing.
Never panned out.
* Added parentheses around the #defines within UMResources.h header file.
Without these, you get lots of interesting parses :( (of course)
* One feature not noted is that you can undo/redo after saving a document
correctly. If you save, then undo, the document is dirtied and closing
will prompt the user. If you redo, the document is marked clean and a
prompt will not be presented upon closing.
* Noted another "UM: To Do" in wordpdoc.cpp which notifies the undo
manager that the document has been saved, i.e., the call to
gUndoManager->TargetCleaned() in CWordPadDoc::DoSave().
* I'm considering adding user-defined data (a cookie) to the notification
data that's sent in a callback. Alternatively, perhaps the callbacks should
be transformed into tru adapter classes, which you can then extend in any
way you like. I'm interested in feedback if anyone cares to share.
1.0.1:
* Fixed forward delete bug in CBetterEditView (already corrected in
CRicherEditView); if you forward deleted some text, followed by
typing regular characters, the undo operation didn't save those
characters correctly so you couldn't undo then redo.
* Fixed a crasher in the CRicherEditView's Replace All action when
undoing (already corrected in CBetterEditView's version); previously
I used a list but switched to a vector for space considerations; in
doing so, I screwed up the increment of the iterator and apparently,
forgot to test the undo part (!) when testing this change, sorry.
Both replace all actions now maintain the previous selection when
undoing/redoing, where before they selected the first word replaced.
* Backspacing at the beginning of a text view or forward deleting
at the end no longer creates a typing action; undo/redo would be
enabled yet would do nothing; harmless but confusing
* Backspacing now creates a new typing action, though a series of
backspaces or backspacing followed by normal characters is considered
a single action; previously, if you typed some characters, followed
immediately by backspacing over them, a single action with an empty
after state was created. While technically correct, at least according
to the previous definition of a single typing action, this might be
surprising to a user.
* Forgot to comment some utility data structures and parts of class
CBetterEditView; I especially want to communicate my motivation for
certain design choices (e.g., tables vs RTF) and to detail how
typing is handled, especially at the level of individual characters.
* Uncommented the #ifdef APSTUDIO_INVOKED ... #endif in UndoManager.rc;
you should not need to edit this file, but if you do, you must edit it
by hand; AppStudio will change it otherwise; I had commented it out so
I could edit the .rc file in the "original" project and forgot to undo!
* The IDS_XXX_ACTION resource strings and related commands are now defined
with a base definition plus an offset; to change the id range, just
change the base #define; also added more #ifndef ... #endif around the
commands, in case they were already partially defined.
1.0:
* Initial release; supports undo/redo for typing, edit operations like
cut & paste, and replace actions in both CBetterEditView and
CRicherEditView; also supports undo/redo for text styling, paragraph
styling, bulleting, and OLE object insertion in CRicherEditView;
WordPad example adds undo/redo for insert data/time
没有合适的资源?快使用搜索试试~ 我知道了~
经典矢量绘图JTDraw
共160个文件
h:41个
cpp:36个
obj:35个
4星 · 超过85%的资源 需积分: 10 67 下载量 133 浏览量
2009-07-01
10:18:04
上传
评论
收藏 5.95MB RAR 举报
温馨提示
有很多网上下的JTDraw都是原始版的JTDRAW,跑不起来。因为JTDRAW需要GDI+和BCG库,而现在能下载的一般都是BCGP库,我经过修改,把代码里面的BCG修改成BCGP库,可以跑起来。欢迎大家下载。经典的绘图设计模式。
资源推荐
资源详情
资源评论
收起资源包目录
经典矢量绘图JTDraw (160个子文件)
Draw.aps 115KB
b2.bmp 15KB
WVLEFT.BMP 8KB
BITMAP1.BMP 2KB
Toolbar.bmp 2KB
FORMAT_T.BMP 2KB
toolbar1.bmp 1KB
USERIMAGES.BMP 1KB
smallico.bmp 1KB
classview.bmp 1KB
resource.bmp 1KB
workspc.bmp 630B
ITOOLBAR.BMP 630B
fileview.bmp 478B
BITMAP2.BMP 374B
DRAWOBJ.CPP 68KB
NETWORKVIEW.CPP 51KB
COLOURPOPUPWND.CPP 46KB
MACTION.CPP 34KB
DRAWTOOL.CPP 27KB
ZOOMVIEW.CPP 22KB
MAINFRM.CPP 17KB
FILLGRADIENTDLG.CPP 14KB
COLORLIS.CPP 13KB
ARROWWND.CPP 12KB
UNDOMANAGER.CPP 11KB
HATCHWELLWND.CPP 11KB
LINEWND.CPP 10KB
COLOURPICKER.CPP 10KB
DRAWDOC.CPP 9KB
HYPERLINK.CPP 9KB
FORMATBA.CPP 9KB
BEZIER.CPP 8KB
MyTabCTRL.CPP 8KB
LINEPROPERTY.CPP 8KB
LINE.CPP 8KB
ARROWPICKER.CPP 8KB
Draw.CPP 7KB
LINEPICKER.CPP 6KB
TextFormatPage.cpp 6KB
CNTRITEM.CPP 4KB
FILLPICTUREDLG.CPP 3KB
FILLPATTERNDLG.CPP 3KB
IPFRAME.CPP 3KB
EFFECTDLG.CPP 3KB
LINELIST.CPP 3KB
TEXTPROPERTY.CPP 2KB
CHILDFRM.CPP 2KB
ACTION.CPP 1KB
DRAWPROPERTY.CPP 1016B
STDAFX.CPP 206B
PENCIL.CUR 518B
CUR00002.CUR 326B
CUR00001.CUR 326B
draw.dsp 12KB
draw.dsw 531B
draw.exe 792KB
RESOURCE.FD 15KB
PLUSHOT.GIF 80B
MINHOT.GIF 77B
PLUSCOLD.GIF 59B
MINCOLD.GIF 56B
WVLINE.GIF 54B
resource.h 26KB
DRAWOBJ.H 11KB
MACTION.H 9KB
NETWORKVIEW.H 9KB
SPLINE.H 8KB
UNDOMANAGER.H 6KB
DRAWTOOL.H 5KB
UMRESOURCES.H 5KB
COLOURPOPUPWND.H 5KB
COLOURPICKER.H 4KB
ACTION.H 4KB
ARROWWND.H 4KB
BEZIER.H 4KB
LINEWND.H 4KB
LINEPROPERTY.H 3KB
MEMDC.H 3KB
LINEPICKER.H 3KB
ARROWPICKER.H 3KB
HATCHWELLWND.H 3KB
ZOOMVIEW.H 3KB
HYPERLINK.H 3KB
MAINFRM.H 3KB
FILLGRADIENTDLG.H 3KB
DRAWDOC.H 3KB
CNTRITEM.H 2KB
draw.H 2KB
MyTabCTRL.H 2KB
TEXTPROPERTY.H 2KB
IPFRAME.H 2KB
LINE.H 2KB
COLORLIS.H 2KB
STDAFX.H 2KB
TextFormatPage.h 2KB
EFFECTDLG.H 2KB
CHILDFRM.H 2KB
LINELIST.H 2KB
FILLPATTERNDLG.H 2KB
共 160 条
- 1
- 2
hjr_200
- 粉丝: 3
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
前往页