Ejemplo n.º 1
0
void openPropDlg(void)
{
	if (propDlg.doDialog(&prop) == IDOK)
	{
		hexEdit1.UpdateFont();
		hexEdit2.UpdateFont();
		setHexMask();
		SystemUpdate();
	}
}
Ejemplo n.º 2
0
int OpticUpdate( SYSTEM *system )
    {
    int state ;

    if( SystemVarSet == 0 )
	return ( system->softstate != SYSTEM_READY ) ;
    SystemVarSet = 0 ;

    RTenter( "OpticUpdate" ) ;

    state = SystemUpdate( system, 0 ) ;
    if( state != SYSTEM_READY )
	SystemPrintState( system ) ;

    RTexit( "OpticUpdate" ) ;

    return ( state != SYSTEM_READY ) ;
    }
Ejemplo n.º 3
0
	// CAutoServerSystem
	void FrameUpdatePostEntityThink()
	{
		SystemUpdate();
	}
Ejemplo n.º 4
0
	// CAutoClientSystem
	virtual void Update( float frametime ) 
	{
		SystemUpdate();
	}
Ejemplo n.º 5
0
/**************************************************************************
 *	SubWndProcNotepad
 */
LRESULT CALLBACK SubWndProcNotepad(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	LRESULT			ret = 0;

	switch (message)
	{
		case WM_ACTIVATE:
		{
			ret = ::CallWindowProc(wndProcNotepad, hWnd, message, wParam, lParam);
			if (currentSC == MAIN_VIEW)
			{
				::SendMessage(hexEdit1.getHSelf(), message, wParam, lParam);
				::SendMessage(hexEdit2.getHSelf(), message, ~wParam, lParam);
			}
			else
			{
				::SendMessage(hexEdit1.getHSelf(), message, ~wParam, lParam);
				::SendMessage(hexEdit2.getHSelf(), message, wParam, lParam);
			}
			break;
		}
        case WM_COPYDATA:
        {
			ret = ::CallWindowProc(wndProcNotepad, hWnd, message, wParam, lParam);
			OutputDebugString(_T("WM_COPYDATA\n"));
			SystemUpdate();
            pCurHexEdit->SetStatusBar();
            break;
        }
		case WM_COMMAND:
		{
			/* necessary for focus change between main and second SCI handle */
			if (HIWORD(wParam) == SCEN_SETFOCUS)
			{
				ret = ::CallWindowProc(wndProcNotepad, hWnd, message, wParam, lParam);
				OutputDebugString(_T("SCEN_SETFOCUS\n"));
				SystemUpdate();
			}

			if (pCurHexEdit->isVisible() == true)
			{
				switch (LOWORD(wParam))
				{
					case IDM_EDIT_CUT:
						pCurHexEdit->Cut();
						return TRUE;
					case IDM_EDIT_COPY:
						pCurHexEdit->Copy();
						return TRUE;
					case IDM_EDIT_PASTE:
						pCurHexEdit->Paste();
						return TRUE;
					case IDM_EDIT_DELETE:
						pCurHexEdit->Delete();
						return TRUE;
					case IDM_EDIT_SELECTALL:
						pCurHexEdit->SelectAll();
						return TRUE;
					case IDM_VIEW_ZOOMIN:
						pCurHexEdit->ZoomIn();
						return TRUE;
					case IDM_VIEW_ZOOMOUT:
						pCurHexEdit->ZoomOut();
						return TRUE;
					case IDM_VIEW_ZOOMRESTORE:
						pCurHexEdit->ZoomRestore();
						return TRUE;
					case IDM_SEARCH_FIND:
						findRepDlg.doDialog(pCurHexEdit->getHSelf(), FALSE);
						return TRUE;
					case IDM_SEARCH_REPLACE:
						findRepDlg.doDialog(pCurHexEdit->getHSelf(), TRUE);
						return TRUE;
					case IDM_SEARCH_FINDNEXT:
						findRepDlg.findNext(pCurHexEdit->getHSelf());
						return TRUE;
					case IDM_SEARCH_FINDPREV:
						findRepDlg.findPrev(pCurHexEdit->getHSelf());
						return TRUE;
					case IDM_SEARCH_VOLATILE_FINDNEXT:
						findRepDlg.findNext(pCurHexEdit->getHSelf(), TRUE);
						return TRUE;
					case IDM_SEARCH_VOLATILE_FINDPREV:
						findRepDlg.findPrev(pCurHexEdit->getHSelf(), TRUE);
						return TRUE;
					case IDM_SEARCH_GOTOLINE:
						gotoDlg.doDialog(pCurHexEdit->getHSelf());
						return TRUE;
					case IDM_SEARCH_NEXT_BOOKMARK:
						pCurHexEdit->NextBookmark();
						return TRUE;
					case IDM_SEARCH_PREV_BOOKMARK:
						pCurHexEdit->PrevBookmark();
						return TRUE;
					case IDM_SEARCH_TOGGLE_BOOKMARK:
						pCurHexEdit->ToggleBookmark();
						return TRUE;
					case IDM_SEARCH_CLEAR_BOOKMARKS:
						pCurHexEdit->ClearBookmarks();
						return TRUE;
					case IDM_SEARCH_CUTMARKEDLINES:
						pCurHexEdit->CutBookmarkLines();
						return TRUE;
					case IDM_SEARCH_COPYMARKEDLINES:
						pCurHexEdit->CopyBookmarkLines();
						return TRUE;
					case IDM_SEARCH_PASTEMARKEDLINES:
						pCurHexEdit->PasteBookmarkLines();
						return TRUE;
					case IDM_SEARCH_DELETEMARKEDLINES:
						pCurHexEdit->DeleteBookmarkLines();
						return TRUE;
					/* ignore this messages */
					case IDM_EDIT_LINE_UP:
					case IDM_EDIT_LINE_DOWN:
					case IDM_EDIT_DUP_LINE:
					case IDM_EDIT_JOIN_LINES:
					case IDM_EDIT_SPLIT_LINES:
					case IDM_EDIT_BLOCK_COMMENT:
					case IDM_EDIT_LTR:
					case IDM_EDIT_INS_TAB:
					case IDM_EDIT_RMV_TAB:
					case IDM_EDIT_STREAM_COMMENT:
						return TRUE;
					default:
						break;
				}
			}

			switch (LOWORD(wParam))
			{
				case IDM_FILE_RELOAD:
				{
					ret = ::CallWindowProc(wndProcNotepad, hWnd, message, wParam, lParam);
					pCurHexEdit->SetCompareResult(NULL);
					break;
				}
				case IDM_SEARCH_FIND:
				case IDM_SEARCH_REPLACE:
				{
					ret = ::CallWindowProc(wndProcNotepad, hWnd, message, wParam, lParam);
					g_hFindRepDlg = ::GetActiveWindow();
					break;
				}
				case IDM_FILE_SAVE:
				{
					ret = ::CallWindowProc(wndProcNotepad, hWnd, message, wParam, lParam);
					if (::SendMessage(g_HSource, SCI_GETMODIFY, 0, 0) == 0)
					{
						pCurHexEdit->ResetModificationState();
					}
					break;
				}
				case IDM_FILE_SAVEAS:
				case IDM_FILE_RENAME:
				{
					TCHAR oldPath[MAX_PATH];
					TCHAR newPath[MAX_PATH];

					/* stop updating of active documents (workaround to keep possible HEX view open) */
					isNotepadCreated = FALSE;

					::SendMessage(nppData._nppHandle, NPPM_GETFULLCURRENTPATH, 0, (LPARAM)oldPath);
					ret = ::CallWindowProc(wndProcNotepad, hWnd, message, wParam, lParam);
					::SendMessage(nppData._nppHandle, NPPM_GETFULLCURRENTPATH, 0, (LPARAM)newPath);
					pCurHexEdit->FileNameChanged(newPath);

					/* switch update again on and do the update now self */
					isNotepadCreated = TRUE;
					SystemUpdate();

					if (::SendMessage(g_HSource, SCI_GETMODIFY, 0, 0) == 0)
					{
						pCurHexEdit->ResetModificationState();
					}
					break;
				}
				case IDC_PREV_DOC:
				case IDC_NEXT_DOC:
				case IDM_FILE_CLOSE:
				case IDM_FILE_CLOSEALL:
				case IDM_FILE_CLOSEALL_BUT_CURRENT:
				case IDM_FILE_NEW:
				{
					ret = ::CallWindowProc(wndProcNotepad, hWnd, message, wParam, lParam);
					OutputDebugString(_T("IDC_PREV/NEXT_DOC\n"));
					SystemUpdate();
					pCurHexEdit->doDialog();
					pCurHexEdit->SetStatusBar();
					break;
				}
				case IDM_VIEW_GOTO_ANOTHER_VIEW:
				case IDM_VIEW_CLONE_TO_ANOTHER_VIEW:
				{
					tHexProp hexProp = pCurHexEdit->GetHexProp();

					ret = ::CallWindowProc(wndProcNotepad, hWnd, message, wParam, lParam);
					OutputDebugString(_T("TO_ANOTHER_VIEW\n"));
					SystemUpdate();
					pCurHexEdit->SetHexProp(hexProp);
					pCurHexEdit->doDialog();
					pCurHexEdit->SetStatusBar();
					break;
				}
				case IDM_VIEW_SWITCHTO_OTHER_VIEW:
				{
					ret = ::CallWindowProc(wndProcNotepad, hWnd, message, wParam, lParam);
					pCurHexEdit->SetStatusBar();
					break;
				}
				default:
					ret = ::CallWindowProc(wndProcNotepad, hWnd, message, wParam, lParam);
					break;
			}
			break;
		}
		case NPPM_DOOPEN:
		{
			ret = ::CallWindowProc(wndProcNotepad, hWnd, message, wParam, lParam);
			OutputDebugString(_T("DOOPEN\n"));
			SystemUpdate();
			pCurHexEdit->doDialog();
			break;
		}
		case WM_NOTIFY:
		{
			SCNotification *notifyCode = (SCNotification *)lParam;

			if (((notifyCode->nmhdr.hwndFrom == nppData._scintillaMainHandle) ||
				(notifyCode->nmhdr.hwndFrom == nppData._scintillaSecondHandle)) &&
				(notifyCode->nmhdr.code == SCN_SAVEPOINTREACHED))
			{
				OutputDebugString(_T("SAVEPOINTREACHED\n"));
				SystemUpdate();
				if (TRUE != pCurHexEdit->GetModificationState())
					ret = ::CallWindowProc(wndProcNotepad, hWnd, message, wParam, lParam);
				break;
			}
			switch (notifyCode->nmhdr.code)
			{
				case TCN_TABDELETE:
				case TCN_SELCHANGE:
				{
					ret = ::CallWindowProc(wndProcNotepad, hWnd, message, wParam, lParam);
					OutputDebugString(_T("TCN_SELCHANGED\n"));
					SystemUpdate();
					pCurHexEdit->SetStatusBar();
					break;
				}
				case TCN_TABDROPPED:
				case TCN_TABDROPPEDOUTSIDE:
				{
					HexEdit* pOldHexEdit = pCurHexEdit;
					tHexProp hexProp	 = pCurHexEdit->GetHexProp();

					ret = ::CallWindowProc(wndProcNotepad, hWnd, message, wParam, lParam);
					OutputDebugString(_T("TCN_DROPPED\n"));
					SystemUpdate();

					if (pOldHexEdit != pCurHexEdit)
					{
						if (pCurHexEdit == &hexEdit1)
						{
							hexEdit2.doDialog();
						}
						else
						{
							hexEdit1.doDialog();
						}
						pCurHexEdit->SetHexProp(hexProp);
						pCurHexEdit->doDialog();
						pCurHexEdit->SetStatusBar();
					}
					break;
				}
				default:
					ret = ::CallWindowProc(wndProcNotepad, hWnd, message, wParam, lParam);
					break;
			}
			break;
		}
		default:
			ret = ::CallWindowProc(wndProcNotepad, hWnd, message, wParam, lParam);
			break;
	}

	return ret;
}
Ejemplo n.º 6
0
/***
 *	beNotification()
 *
 *	This function is called, if a notification in Scantilla/Notepad++ occurs
 */
extern "C" __declspec(dllexport) void beNotified(SCNotification *notifyCode)
{
	/* test for friday */
	if (((notifyCode->nmhdr.hwndFrom == nppData._scintillaMainHandle) ||
		 (notifyCode->nmhdr.hwndFrom == nppData._scintillaSecondHandle)))
	{
//		SystemUpdate();

		switch (notifyCode->nmhdr.code)
		{
			case SCN_MODIFIED:
				if (notifyCode->modificationType & SC_MOD_INSERTTEXT ||
					notifyCode->modificationType & SC_MOD_DELETETEXT) 
				{
					tHexProp	hexProp1	= hexEdit1.GetHexProp();
					tHexProp	hexProp2	= hexEdit2.GetHexProp();
					INT			length		= notifyCode->length;

					if ((hexProp1.szFileName != NULL) && (hexProp2.szFileName != NULL) &&
						(_tcscmp(hexProp1.szFileName, hexProp2.szFileName) == 0))
					{
						/* test for line lengths */
						hexEdit1.TestLineLength();
						hexEdit2.TestLineLength();

						/* redo undo the code */
						if (notifyCode->modificationType & SC_PERFORMED_UNDO ||
							notifyCode->modificationType & SC_PERFORMED_REDO)
						{
							hexEdit1.RedoUndo(notifyCode->position, notifyCode->length, notifyCode->modificationType);
							hexEdit2.RedoUndo(notifyCode->position, notifyCode->length, notifyCode->modificationType);
						}
					}
					else
					{
						/* test for line length */
						pCurHexEdit->TestLineLength();

						/* redo undo the code */
						if (notifyCode->modificationType & SC_PERFORMED_UNDO ||
							notifyCode->modificationType & SC_PERFORMED_REDO)
						{
							pCurHexEdit->RedoUndo(notifyCode->position, notifyCode->length, notifyCode->modificationType);
						}
					}
				}
				break;
			default:
				break;
		}
	}
	if (notifyCode->nmhdr.hwndFrom == nppData._nppHandle)
	{
		switch (notifyCode->nmhdr.code)
		{
			case NPPN_TBMODIFICATION:
			{
				/* change menu language */
				NLChangeNppMenu((HINSTANCE)g_hModule, nppData._nppHandle, PLUGIN_NAME, funcItem, nbFunc);

				g_TBHex.hToolbarBmp = (HBITMAP)::LoadImage((HINSTANCE)g_hModule, MAKEINTRESOURCE(IDB_TB_HEX), IMAGE_BITMAP, 0, 0, (LR_DEFAULTSIZE | LR_LOADMAP3DCOLORS));
				::SendMessage(nppData._nppHandle, NPPM_ADDTOOLBARICON, (WPARAM)funcItem[0]._cmdID, (LPARAM)&g_TBHex);
				break;
			}
			case NPPN_READY:
			{
				isNotepadCreated = TRUE;
				SystemUpdate();
                GetShortCuts(nppData._nppHandle);
				break;
			}
			case NPPN_FILEOPENED:
			case NPPN_FILECLOSED:
			{
				SystemUpdate();
				pCurHexEdit->doDialog();
				break;
			}
			default:
				break;
		}
	}
}