LRESULT CCustomEditControl::OnPaste(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { bHandled = false; if ( !onPaste.empty() ) { if ( onPaste(this) ) { bHandled = true; } } return 0; }
void DesignerEventHandler::onContextMenu(QContextMenuEvent * e) { QMenu * menu = new QMenu(parentWidget); QAction * copy_action = menu->addAction(tr("Copy"), this, SLOT(onCopy())); menu->addAction(tr("Paste"), this, SLOT(onPaste())); QAction * delete_action = menu->addAction(tr("Delete"), this, SLOT(onDelete())); QAction * delete_with_s_action = menu->addAction(tr("Delete with sourcers"), this, SLOT(onDeleteWithSourcers())); QMenu* go = menu->addMenu(tr("Geometry operations")); go->addAction(tr("Align left") , this, SLOT(onAlignLeft())); go->addAction(tr("Align top") , this, SLOT(onAlignTop())); go->addAction(tr("Align right"), this, SLOT(onAlignRight())); go->addAction(tr("Align bottom"),this, SLOT(onAlignBottom())); go->addAction(tr("Align vertical"),this, SLOT(onAlignVertical())); go->addAction(tr("Align horisontal"), this, SLOT (onAlignHorizontal()) ); go->addAction(tr("Queue x"), this, SLOT (onQuequeX()) ); go->addAction(tr("Queue y"), this, SLOT (onQuequeY()) ); go->insertSeparator(); go->addAction(tr("Same width"), this, SLOT(onSameWidth())); go->addAction(tr("Same height"), this, SLOT(onSameHeight())); QMenu* popupWindows = menu->addMenu(tr("Popup windows")); QMenu* leftButtonPW = popupWindows->addMenu(tr("Left button")); QAction * left_pw_add_action = leftButtonPW->addAction( tr("Add"), this, SLOT(onLeftPwAdd())); QAction * left_pw_copy_action = leftButtonPW->addAction( tr("Copy"), this, SLOT(onLeftPwCopy())); leftButtonPW->addAction( tr("Paste"), this, SLOT(onLeftPwPaste())); QAction * left_pw_delete_action = leftButtonPW->addAction( tr("Delete"), this, SLOT(onLeftDelete())); QMenu* rightButtonPW = popupWindows->addMenu (tr ("Right button")); QAction * right_pw_add_action = rightButtonPW->addAction( tr("Add"), this, SLOT(onRightPwAdd())); QAction * right_pw_copy_action = rightButtonPW->addAction( tr("Copy"), this, SLOT(onRightPwCopy())); rightButtonPW->addAction( tr("Paste"), this, SLOT(onRightPwPaste())); QAction * right_pw_delete_action = rightButtonPW->addAction( tr("Delete"), this, SLOT(onRightDelete())); QAction* show_properties_action = menu->addAction(tr("Properties"), this, SLOT(showProps())); QFont f = show_properties_action->font(); f.setBold(true); show_properties_action->setFont(f); menu->addAction( tr("Export lists"), this, SLOT(onExportLists()) ); //menu->insertSeparator(); QMenu * predef = menu->addMenu ("Predef windows"); QStringList names = PredefPw::Factory::availableNames(); for (QStringList::iterator iter = names.begin(); iter != names.end(); ++iter ) { QAction * a = predef->addAction (*iter); //a->setMenu (predef); a->setData (12345); } menu->addAction ( "Find sourcer", this, SLOT (onFindSourcerByWidget() ) ); if (selected_widgets.count( ) == 0 ){ copy_action->setEnabled(false); delete_action->setEnabled(false); delete_with_s_action->setEnabled(false); go->setEnabled(false); popupWindows->setEnabled(false); } else { VtlWidget * w = (VtlWidget*)checkWidget(e->pos()); if (w) { if (w->isLbPopupCreated()) { left_pw_add_action->setEnabled(false); } else { left_pw_copy_action->setEnabled(false); left_pw_delete_action->setEnabled(false); } if (w->isRbPopupCreated()) { right_pw_add_action->setEnabled(false); } else { right_pw_copy_action->setEnabled(false); right_pw_delete_action->setEnabled(false); } } } if ( context_widget ) context_widget->prepareContextMenu (menu); if (e->state() & Qt::ControlModifier ) control_modifier = true; QAction * a = menu->exec(e->globalPos()); control_modifier = false; if ( a && a->data().toInt() == 12345 ) { QMessageBox box ( vtl::app ); QAbstractButton * left_btn = box.addButton ("Left" , QMessageBox::ActionRole ); QAbstractButton * right_btn = box.addButton ("Right", QMessageBox::ActionRole ); box.setWindowTitle ("Mouse button?"); box.exec (); if ( box.clickedButton() == left_btn ) { for (SWPtrList::iterator iter = selected_widgets.begin(); iter != selected_widgets.end(); ++iter ) { (*iter)->createLbPredefPw ( a->text() ); } } else if (box.clickedButton() == right_btn ) { for (SWPtrList::iterator iter = selected_widgets.begin(); iter != selected_widgets.end(); ++iter ) { (*iter)->createRbPredefPw ( a->text() ); } } } delete menu; }
bool GuiTextEditCtrl::onKeyDown(const GuiEvent &event) { if ( !isActive() || !isAwake() ) return false; S32 stringLen = mTextBuffer.length(); setUpdate(); // Ugly, but now I'm cool like MarkF. if(event.keyCode == KEY_BACKSPACE) goto dealWithBackspace; if ( event.modifier & SI_SHIFT ) { // Added support for word jump selection. if ( event.modifier & SI_CTRL ) { switch ( event.keyCode ) { case KEY_LEFT: { S32 newpos = findPrevWord(); if ( mBlockStart == mBlockEnd ) { // There was not already a selection so start a new one. mBlockStart = newpos; mBlockEnd = mCursorPos; } else { // There was a selection already... // In this case the cursor MUST be at either the // start or end of that selection. if ( mCursorPos == mBlockStart ) { // We are at the start block and traveling left so // just extend the start block farther left. mBlockStart = newpos; } else { // We are at the end block BUT traveling left // back towards the start block... if ( newpos > mBlockStart ) { // We haven't overpassed the existing start block // so just trim back the end block. mBlockEnd = newpos; } else if ( newpos == mBlockStart ) { // We are back at the start, so no more selection. mBlockEnd = mBlockStart = 0; } else { // Only other option, we just backtracked PAST // our original start block. // So the new position becomes the start block // and the old start block becomes the end block. mBlockEnd = mBlockStart; mBlockStart = newpos; } } } mCursorPos = newpos; return true; } case KEY_RIGHT: { S32 newpos = findNextWord(); if ( mBlockStart == mBlockEnd ) { // There was not already a selection so start a new one. mBlockStart = mCursorPos; mBlockEnd = newpos; } else { // There was a selection already... // In this case the cursor MUST be at either the // start or end of that selection. if ( mCursorPos == mBlockEnd ) { // We are at the end block and traveling right so // just extend the end block farther right. mBlockEnd = newpos; } else { // We are at the start block BUT traveling right // back towards the end block... if ( newpos < mBlockEnd ) { // We haven't overpassed the existing end block // so just trim back the start block. mBlockStart = newpos; } else if ( newpos == mBlockEnd ) { // We are back at the end, so no more selection. mBlockEnd = mBlockStart = 0; } else { // Only other option, we just backtracked PAST // our original end block. // So the new position becomes the end block // and the old end block becomes the start block. mBlockStart = mBlockEnd; mBlockEnd = newpos; } } } mCursorPos = newpos; return true; } default: break; } } // End support for word jump selection. switch ( event.keyCode ) { case KEY_TAB: if ( mTabComplete ) { onTabComplete_callback("1"); return true; } break; // We don't want to fall through if we don't handle the TAB here. case KEY_HOME: mBlockStart = 0; mBlockEnd = mCursorPos; mCursorPos = 0; return true; case KEY_END: mBlockStart = mCursorPos; mBlockEnd = stringLen; mCursorPos = stringLen; return true; case KEY_LEFT: if ((mCursorPos > 0) & (stringLen > 0)) { //if we already have a selected block if (mCursorPos == mBlockEnd) { mCursorPos--; mBlockEnd--; if (mBlockEnd == mBlockStart) { mBlockStart = 0; mBlockEnd = 0; } } else { mCursorPos--; mBlockStart = mCursorPos; if (mBlockEnd == 0) { mBlockEnd = mCursorPos + 1; } } } return true; case KEY_RIGHT: if (mCursorPos < stringLen) { if ((mCursorPos == mBlockStart) && (mBlockEnd > 0)) { mCursorPos++; mBlockStart++; if (mBlockStart == mBlockEnd) { mBlockStart = 0; mBlockEnd = 0; } } else { if (mBlockEnd == 0) { mBlockStart = mCursorPos; mBlockEnd = mCursorPos; } mCursorPos++; mBlockEnd++; } } return true; case KEY_RETURN: case KEY_NUMPADENTER: return dealWithEnter(false); default: break; } } else if (event.modifier & SI_CTRL) { switch(event.keyCode) { #if defined(TORQUE_OS_MAC) // Added UNIX emacs key bindings - just a little hack here... // Ctrl-B - move one character back case KEY_B: { GuiEvent new_event; new_event.modifier = 0; new_event.keyCode = KEY_LEFT; return(onKeyDown(new_event)); } // Ctrl-F - move one character forward case KEY_F: { GuiEvent new_event; new_event.modifier = 0; new_event.keyCode = KEY_RIGHT; return(onKeyDown(new_event)); } // Ctrl-A - move to the beginning of the line case KEY_A: { GuiEvent new_event; new_event.modifier = 0; new_event.keyCode = KEY_HOME; return(onKeyDown(new_event)); } // Ctrl-E - move to the end of the line case KEY_E: { GuiEvent new_event; new_event.modifier = 0; new_event.keyCode = KEY_END; return(onKeyDown(new_event)); } // Ctrl-P - move backward in history case KEY_P: { GuiEvent new_event; new_event.modifier = 0; new_event.keyCode = KEY_UP; return(onKeyDown(new_event)); } // Ctrl-N - move forward in history case KEY_N: { GuiEvent new_event; new_event.modifier = 0; new_event.keyCode = KEY_DOWN; return(onKeyDown(new_event)); } // Ctrl-D - delete under cursor case KEY_D: { GuiEvent new_event; new_event.modifier = 0; new_event.keyCode = KEY_DELETE; return(onKeyDown(new_event)); } case KEY_U: { GuiEvent new_event; new_event.modifier = SI_CTRL; new_event.keyCode = KEY_DELETE; return(onKeyDown(new_event)); } // End added UNIX emacs key bindings #endif // Adding word jump navigation. case KEY_LEFT: { mCursorPos = findPrevWord(); mBlockStart = 0; mBlockEnd = 0; return true; } case KEY_RIGHT: { mCursorPos = findNextWord(); mBlockStart = 0; mBlockEnd = 0; return true; } #if !defined(TORQUE_OS_MAC) // Select all case KEY_A: { selectAllText(); return true; } // windows style cut / copy / paste / undo keybinds case KEY_C: case KEY_X: { // copy, and cut the text if we hit ctrl-x onCopy( event.keyCode==KEY_X ); return true; } case KEY_V: { onPaste(); // Execute the console command! execConsoleCallback(); return true; } case KEY_Z: if (! mDragHit) { onUndo(); return true; } #endif case KEY_DELETE: case KEY_BACKSPACE: //save the current state saveUndoState(); //delete everything in the field mTextBuffer.set(""); mCursorPos = 0; mBlockStart = 0; mBlockEnd = 0; execConsoleCallback(); onChangeCursorPos(); //.logicking return true; default: break; } } #if defined(TORQUE_OS_MAC) // mac style cut / copy / paste / undo keybinds else if (event.modifier & SI_ALT) { // Mac command key maps to alt in torque. // Added Mac cut/copy/paste/undo keys switch(event.keyCode) { // Select all case KEY_A: { selectAllText(); return true; } case KEY_C: case KEY_X: { // copy, and cut the text if we hit cmd-x onCopy( event.keyCode==KEY_X ); return true; } case KEY_V: { onPaste(); // Execute the console command! execConsoleCallback(); return true; } case KEY_Z: if (! mDragHit) { onUndo(); return true; } default: break; } } #endif else { switch(event.keyCode) { case KEY_ESCAPE: if( mEscapeCommand.isNotEmpty() ) { evaluate( mEscapeCommand ); return( true ); } return( Parent::onKeyDown( event ) ); case KEY_RETURN: case KEY_NUMPADENTER: return dealWithEnter(true); case KEY_UP: { if( mHistorySize > 0 ) { if(mHistoryDirty) { updateHistory(&mTextBuffer, false); mHistoryDirty = false; } mHistoryIndex--; if(mHistoryIndex >= 0 && mHistoryIndex <= mHistoryLast) setText(mHistoryBuf[mHistoryIndex]); else if(mHistoryIndex < 0) mHistoryIndex = 0; } return true; } case KEY_DOWN: { if( mHistorySize > 0 ) { if(mHistoryDirty) { updateHistory(&mTextBuffer, false); mHistoryDirty = false; } mHistoryIndex++; if(mHistoryIndex > mHistoryLast) { mHistoryIndex = mHistoryLast + 1; setText(""); } else setText(mHistoryBuf[mHistoryIndex]); } return true; } case KEY_LEFT: // If we have a selection put the cursor to the left side of it. if ( mBlockStart != mBlockEnd ) { mCursorPos = mBlockStart; mBlockStart = mBlockEnd = 0; } else { mBlockStart = mBlockEnd = 0; mCursorPos = getMax( mCursorPos - 1, 0 ); } return true; case KEY_RIGHT: // If we have a selection put the cursor to the right side of it. if ( mBlockStart != mBlockEnd ) { mCursorPos = mBlockEnd; mBlockStart = mBlockEnd = 0; } else { mBlockStart = mBlockEnd = 0; mCursorPos = getMin( mCursorPos + 1, stringLen ); } return true; case KEY_BACKSPACE: dealWithBackspace: //save the current state saveUndoState(); if (mBlockEnd > 0) { mTextBuffer.cut(mBlockStart, mBlockEnd-mBlockStart); mCursorPos = mBlockStart; mBlockStart = 0; mBlockEnd = 0; mHistoryDirty = true; // Execute the console command! execConsoleCallback(); } else if (mCursorPos > 0) { mTextBuffer.cut(mCursorPos-1, 1); mCursorPos--; mHistoryDirty = true; // Execute the console command! execConsoleCallback(); } return true; case KEY_DELETE: //save the current state saveUndoState(); if (mBlockEnd > 0) { mHistoryDirty = true; mTextBuffer.cut(mBlockStart, mBlockEnd-mBlockStart); mCursorPos = mBlockStart; mBlockStart = 0; mBlockEnd = 0; // Execute the console command! execConsoleCallback(); } else if (mCursorPos < stringLen) { mHistoryDirty = true; mTextBuffer.cut(mCursorPos, 1); // Execute the console command! execConsoleCallback(); } return true; case KEY_INSERT: mInsertOn = !mInsertOn; return true; case KEY_HOME: mBlockStart = 0; mBlockEnd = 0; mCursorPos = 0; return true; case KEY_END: mBlockStart = 0; mBlockEnd = 0; mCursorPos = stringLen; return true; default: break; } } switch ( event.keyCode ) { case KEY_TAB: if ( mTabComplete ) { onTabComplete_callback("0"); return( true ); } case KEY_UP: case KEY_DOWN: case KEY_ESCAPE: return Parent::onKeyDown( event ); default: break; } // Handle character input events. if( mProfile->mFont->isValidChar( event.ascii ) ) { handleCharInput( event.ascii ); return true; } // Or eat it if that's appropriate. if( mSinkAllKeyEvents ) return true; // Not handled - pass the event to it's parent. return Parent::onKeyDown( event ); }
void Editor_menuEvent(int menuItem) { int highlightRowStep = getTrackData()->highlightRowStep; switch (menuItem) { case EDITOR_MENU_ENTER_CURRENT_V : case EDITOR_MENU_ROWS_UP : case EDITOR_MENU_ROWS_DOWN : case EDITOR_MENU_PREV_BOOKMARK : case EDITOR_MENU_NEXT_BOOKMARK : case EDITOR_MENU_PREV_KEY : case EDITOR_MENU_NEXT_KEY : case EDITOR_MENU_PLAY : { endEditing(); } } cancelEditing(); // If some internal control has focus we let it do its thing if (Emgui_hasKeyboardFocus()) { Editor_update(); return; } switch (menuItem) { // File case EDITOR_MENU_OPEN: onOpen(); break; case EDITOR_MENU_SAVE: onSave(); break; case EDITOR_MENU_SAVE_AS: onSaveAs(); break; case EDITOR_MENU_REMOTE_EXPORT : RemoteConnection_sendSaveCommand(); break; case EDITOR_MENU_RECENT_FILE_0: case EDITOR_MENU_RECENT_FILE_1: case EDITOR_MENU_RECENT_FILE_2: case EDITOR_MENU_RECENT_FILE_3: { Editor_loadRecentFile(menuItem - EDITOR_MENU_RECENT_FILE_0); break; } // Edit case EDITOR_MENU_UNDO : onUndo(); break; case EDITOR_MENU_REDO : onRedo(); break; case EDITOR_MENU_CANCEL_EDIT : onCancelEdit(); break; case EDITOR_MENU_DELETE_KEY : onDeleteKey(); break; case EDITOR_MENU_CUT : onCutAndCopy(true); break; case EDITOR_MENU_COPY : onCutAndCopy(false); break; case EDITOR_MENU_PASTE : onPaste(); break; case EDITOR_MENU_SELECT_TRACK : onSelectTrack(); break; case EDITOR_MENU_BIAS_P_001 : biasSelection(0.01f); break; case EDITOR_MENU_BIAS_P_01 : biasSelection(0.1f); break; case EDITOR_MENU_BIAS_P_1: biasSelection(1.0f); break; case EDITOR_MENU_BIAS_P_10: biasSelection(10.0f); break; case EDITOR_MENU_BIAS_P_100: biasSelection(100.0f); break; case EDITOR_MENU_BIAS_P_1000: biasSelection(1000.0f); break; case EDITOR_MENU_BIAS_N_001: biasSelection(-0.01f); break; case EDITOR_MENU_BIAS_N_01: biasSelection(-0.1f); break; case EDITOR_MENU_BIAS_N_1: biasSelection(-1.0f); break; case EDITOR_MENU_BIAS_N_10: biasSelection(-10.0f); break; case EDITOR_MENU_BIAS_N_100 : biasSelection(-100.0f); break; case EDITOR_MENU_BIAS_N_1000: biasSelection(-1000.0f); break; case EDITOR_MENU_INTERPOLATION : onInterpolation(); break; case EDITOR_MENU_ENTER_CURRENT_V : onEnterCurrentValue(); break; // View case EDITOR_MENU_PLAY : onPlay(); break; case EDITOR_MENU_ROWS_UP : onRowStep(-highlightRowStep , NO_SELECTION); break; case EDITOR_MENU_ROWS_DOWN : onRowStep(highlightRowStep , NO_SELECTION); break; case EDITOR_MENU_ROWS_2X_UP : onRowStep(-highlightRowStep * 2 , NO_SELECTION); break; case EDITOR_MENU_ROWS_2X_DOWN : onRowStep(highlightRowStep * 2 , NO_SELECTION); break; case EDITOR_MENU_PREV_BOOKMARK : onBookmarkDir(ARROW_UP, NO_SELECTION); break; case EDITOR_MENU_NEXT_BOOKMARK : onBookmarkDir(ARROW_DOWN, NO_SELECTION); break; case EDITOR_MENU_FIRST_TRACK : onTrackSide(ARROW_LEFT, true, NO_SELECTION); break; case EDITOR_MENU_LAST_TRACK : onTrackSide(ARROW_RIGHT, true, NO_SELECTION); break; case EDITOR_MENU_PREV_KEY : onPrevNextKey(true, NO_SELECTION); break; case EDITOR_MENU_NEXT_KEY : onPrevNextKey(false, NO_SELECTION); break; case EDITOR_MENU_FOLD_TRACK : onFoldTrack(true); break; case EDITOR_MENU_UNFOLD_TRACK : onFoldTrack(false); break; case EDITOR_MENU_FOLD_GROUP : onFoldGroup(true); break; case EDITOR_MENU_UNFOLD_GROUP : onFoldGroup(false); break; case EDITOR_MENU_TOGGLE_BOOKMARK : onToggleBookmark(); break; case EDITOR_MENU_CLEAR_BOOKMARKS : onClearBookmarks(); break; case EDITOR_MENU_TAB : onTab(); break; } Editor_update(); }
static void onCommand(HWND hWnd, int id, HWND hWndCtl, UINT codeNotify) { CPlugin * pPlugin = (CPlugin *)GetWindowLong(hWnd, DWL_USER); if (!pPlugin) return; switch (id) { case IDC_COMBO_API_CALL: if(codeNotify != CBN_SELCHANGE) break; updateUI(hWnd); break; case IDC_BUTTON_GO: pLogger->blockDumpToFile(FALSE); onGo(hWnd); break; case IDC_EDIT_ARG1: case IDC_EDIT_ARG2: case IDC_EDIT_ARG3: case IDC_EDIT_ARG4: case IDC_EDIT_ARG5: case IDC_EDIT_ARG6: case IDC_EDIT_ARG7: { if(codeNotify == EN_SETFOCUS) pPlugin->m_hWndLastEditFocus = hWndCtl; char szString[80]; char szEdit[128]; int iIndex = ComboBox_GetCurSel(GetDlgItem(hWnd, IDC_COMBO_API_CALL)); ComboBox_GetLBText(GetDlgItem(hWnd, IDC_COMBO_API_CALL), iIndex, szString); if( ((strcmp(szString, STRING_NPN_POSTURL) == 0) || (strcmp(szString, STRING_NPN_POSTURLNOTIFY) == 0)) && (id == IDC_EDIT_ARG5) && (codeNotify == EN_CHANGE)) { Edit_GetText(hWndCtl, szEdit, sizeof(szEdit)); int iLength = strlen(szEdit); SetDlgItemInt(hWnd, IDC_EDIT_ARG4, iLength, FALSE); } if( ((strcmp(szString, STRING_NPN_WRITE) == 0)) && (id == IDC_EDIT_ARG4) && (codeNotify == EN_CHANGE)) { Edit_GetText(hWndCtl, szEdit, sizeof(szEdit)); int iLength = strlen(szEdit); SetDlgItemInt(hWnd, IDC_EDIT_ARG3, iLength, FALSE); } // save values of window size on the fly as we type it if( (strcmp(szString, STRING_NPN_SETVALUE) == 0) && ((id == IDC_EDIT_ARG3) || (id == IDC_EDIT_ARG4)) && (codeNotify == EN_CHANGE) && (hWndCtl == GetFocus())) { iIndex = ComboBox_GetCurSel(GetDlgItem(hWnd, IDC_COMBO_ARG2)); ComboBox_GetLBText(GetDlgItem(hWnd, IDC_COMBO_ARG2), iIndex, szString); if(strcmp(szString, "NPPVpluginWindowSize") == 0) { BOOL bTranslated = FALSE; int iWidth = GetDlgItemInt(hWnd, IDC_EDIT_ARG3, &bTranslated, TRUE); int iHeight = GetDlgItemInt(hWnd, IDC_EDIT_ARG4, &bTranslated, TRUE); if(pPlugin->m_iWidth != iWidth) pPlugin->m_iWidth = iWidth; if(pPlugin->m_iHeight != iHeight) pPlugin->m_iHeight = iHeight; } } break; } case IDC_COMBO_ARG2: { if(codeNotify != CBN_SELCHANGE) break; ShowWindow(GetDlgItem(hWnd, IDC_STATIC_ARG4), SW_HIDE); ShowWindow(GetDlgItem(hWnd, IDC_EDIT_ARG4), SW_HIDE); Static_SetText(GetDlgItem(hWnd, IDC_STATIC_ARG3), "*value:"); Edit_SetText(GetDlgItem(hWnd, IDC_EDIT_ARG3), ""); char szString[80]; int iIndex = ComboBox_GetCurSel(GetDlgItem(hWnd, IDC_COMBO_API_CALL)); ComboBox_GetLBText(GetDlgItem(hWnd, IDC_COMBO_API_CALL), iIndex, szString); if(strcmp(szString, STRING_NPN_SETVALUE) == 0) { iIndex = ComboBox_GetCurSel(GetDlgItem(hWnd, IDC_COMBO_ARG2)); ComboBox_GetLBText(GetDlgItem(hWnd, IDC_COMBO_ARG2), iIndex, szString); if((strcmp(szString, "NPPVpluginWindowBool") == 0) || (strcmp(szString, "NPPVpluginTransparentBool") == 0) || (strcmp(szString, "NPPVpluginKeepLibraryInMemory") == 0)) { HWND hWndCombo = GetDlgItem(hWnd, IDC_COMBO_ARG3); ComboBox_ResetContent(hWndCombo); ComboBox_AddString(hWndCombo, "TRUE"); ComboBox_AddString(hWndCombo, "FALSE"); ComboBox_SetCurSel(hWndCombo, 0); ShowWindow(GetDlgItem(hWnd, IDC_EDIT_ARG3), SW_HIDE); ShowWindow(hWndCombo, SW_SHOW); } else { ShowWindow(GetDlgItem(hWnd, IDC_EDIT_ARG3), SW_SHOW); ShowWindow(GetDlgItem(hWnd, IDC_COMBO_ARG3), SW_HIDE); if(strcmp(szString, "NPPVpluginWindowSize") == 0) { EnableWindow(GetDlgItem(hWnd, IDC_EDIT_ARG4), TRUE); ShowWindow(GetDlgItem(hWnd, IDC_EDIT_ARG4), SW_SHOW); ShowWindow(GetDlgItem(hWnd, IDC_STATIC_ARG4), SW_SHOW); Static_SetText(GetDlgItem(hWnd, IDC_STATIC_ARG3), "width:"); Static_SetText(GetDlgItem(hWnd, IDC_STATIC_ARG4), "height:"); SetDlgItemInt(hWnd, IDC_EDIT_ARG3, pPlugin->m_iWidth, TRUE); SetDlgItemInt(hWnd, IDC_EDIT_ARG4, pPlugin->m_iHeight, TRUE); } } } break; } case IDC_BUTTON_PASTE: onPaste(pPlugin->m_hWndLastEditFocus); break; default: break; } }