//static
bool DoEditorListDialog(wxWindow* parent, 
                        std::vector<EditorListDialog::EditedFile>& editors)
{
   EditorListDialog* dlg = new EditorListDialog(parent, editors);
   bool ret = (dlg->ShowModal() == wxID_OK);
   
   DestroyDialog(dlg);
   return ret;
}
//static
bool DoConflictListDialog(wxWindow* parent, 
                          const std::vector<std::string>& files)
{
   ConflictListDialog* dlg = new ConflictListDialog(parent, files);
   bool ret = (dlg->ShowModal() == wxID_OK);
   
   DestroyDialog(dlg);
   return ret;
}
Example #3
0
AnnotateDialog::~AnnotateDialog()
{
    // Delete line colors
    delete[] myLineColors;
    if (myFindDialog)
        DestroyDialog(myFindDialog);

    SaveRegistryData();

    StoreTortoiseDialogSize(this, "Annotate");
}
void removeNick(char *nick)
{
	map<char *, HWND, ltstr>::iterator itr;

	if((itr = nickList.find(nick)) != nickList.end())
	{
		DestroyDialog(itr->second);
		delete[] itr->first;

		nickList.erase(itr);
	}
}
void clearNickList()
{
	map<char *, HWND, ltstr>::iterator itr, itre;
	itre = nickList.end();

	for(itr = nickList.begin(); itr != itre; itr++)
	{
		DestroyDialog(itr->second);
		delete[] itr->first;
	}

	nickList.clear();
}
Example #6
0
bool DoCheckoutDialog(wxWindow* parent, CVSRoot& cvsRoot, 
                      std::string& module, std::string& tag, 
                      std::string& date, bool& exportOnly, 
                      std::string& alternateDirectory,
                      bool& unixLineEndings,
#ifdef MARCH_HARE_BUILD
                      bool& fileReadOnly,
#endif
                      const std::string& dir, 
                      bool& forceHead,
                      bool& edit,
                      std::string& bugNumber)
{
   CheckoutDialog* checkoutDialog = new CheckoutDialog(parent, dir);
   checkoutDialog->myRevOptions->SetForceHead(forceHead);
   checkoutDialog->myModuleBasicsPage->SetRepoGraph(parent);
   int modal = checkoutDialog->ShowModal();
   bool ret = (modal == wxID_OK);

   // Allow pages a chance to save settings
   if (ret)
   {
      checkoutDialog->myModuleBasicsPage->OKClicked();
      checkoutDialog->myRevOptions->OKClicked();
      checkoutDialog->myCheckoutOptionsPage->OKClicked();
   }

   cvsRoot = checkoutDialog->myModuleBasicsPage->GetCVSRoot();
   // Remove trailing slash from directory
   cvsRoot.RemoveTrailingDelimiter();
   module = checkoutDialog->myModuleBasicsPage->GetModule();
   tag = checkoutDialog->myRevOptions->GetTag();
   date = checkoutDialog->myRevOptions->GetDate();

   exportOnly = checkoutDialog->myCheckoutOptionsPage->GetExportFlag();
   alternateDirectory = checkoutDialog->myCheckoutOptionsPage->GetAlternateDirectory();
   unixLineEndings = checkoutDialog->myCheckoutOptionsPage->GetUnixLineEndingsFlag();
#ifdef MARCH_HARE_BUILD
   fileReadOnly = checkoutDialog->myCheckoutOptionsPage->GetReadOnlyFlag();
#endif
   forceHead = checkoutDialog->myRevOptions->GetForceHead();
   edit = checkoutDialog->myModuleBasicsPage->GetEdit();
   bugNumber = checkoutDialog->myModuleBasicsPage->GetBugNumber();

   // Delete the dialog
   DestroyDialog(checkoutDialog);

   return ret;
}
Example #7
0
bool DoAnnotateDialog(wxWindow* parent, const std::string& filename, const std::string& rev)
{
   AnnotateDialog* dlg = new AnnotateDialog(parent, filename, rev);

   CAnnotationList* annotationList = dlg->GetAnnotationList(parent);
   bool ret = false;
   if (annotationList)
   {
      dlg->Populate(annotationList);
      ret = (dlg->ShowModal() == wxID_OK);
      delete annotationList;
   }
   DestroyDialog(dlg);
   return ret;
}
INT_PTR ServerPingSettings::ProcMessage(UINT message, WPARAM wParam, LPARAM lParam)
{
	switch(message) {
		case WM_INITDIALOG: 
		{
			InitDialog();
			return TRUE;
		}
		case WM_DESTROY:
		{
			DestroyDialog();
			return TRUE;
		}
		case WM_COMMAND:
		{
			if(LOWORD(wParam) == IDC_CLEAR) {
				HandleClear();
				return TRUE;
			}
		}
		case WM_NOTIFY:
		{
			switch (((LPNMHDR) lParam)->code) {
				case LVN_GETDISPINFO: 
				{
					HandleLVNGetDispInfo((NMLVDISPINFO*)lParam);
					return TRUE;
				}
				case LVN_ITEMCHANGED: 
				{
					HandleLVNItemChanged((LPNMLISTVIEW)lParam);
					return TRUE;
				}
				case NM_CUSTOMDRAW:
				{
					SetWindowLong(hwnd, 0, (LONG)HandleCustomDraw(lParam));
					return TRUE;
				}	
			}
			break;
		}
	}

	return FALSE;
}
LRESULT CALLBACK InstantTalkProcessingHandler(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
	switch(msg)
	{
	case WM_CLOSE:
		DestroyDialog(hwnd);
		break;
	case WM_DESTROY:
		{
			map<HWND, char*>::iterator itr;

			itr = openConversationList.find(hwnd);
			nickList[itr->second] = NULL;
			openConversationList.erase(itr);
		}
		break;
	case WM_COMMAND:
        switch(LOWORD(wParam))
        {
		case ID_BUTTON_SEND:
			{
				int lenMsg = GetWindowTextLength(GetDlgItem(hwnd, IDC_EDIT_SEND));

				if(lenMsg > 0)
				{
					char *msgData = new char[lenMsg + 1];

					GetDlgItemText(hwnd, IDC_EDIT_SEND, msgData, lenMsg + 1);
					
					GetTextandAddLine(hwnd, IDC_EDIT_CONVERSATION, nickName);
					GetTextandAddLine(hwnd, IDC_EDIT_CONVERSATION, ": ");
					GetTextandAddLine(hwnd, IDC_EDIT_CONVERSATION, msgData);
					GetTextandAddLine(hwnd, IDC_EDIT_CONVERSATION, "\r\n");

					char *dest_msg;
					char *dest = openConversationList[hwnd];

					dest_msg = new char[TALK_MSG_VAL_MAKE_NORMAL_LEN(msgData, dest)];
					
					TALK_MAKE_MSG_NORMAL_MSG(dest, msgData, dest_msg);

					TalkSendMessage(serverSocket, dest_msg, 
						TALK_MSG_VAL_LENGTH(dest_msg));

					delete[] dest_msg;

					SetDlgItemText(hwnd, IDC_EDIT_SEND, "");

					delete[] msgData;
				}
			}
			break;
		}
		break;
	case GOT_MSG:
		{
					GetTextandAddLine(hwnd, IDC_EDIT_CONVERSATION, openConversationList[hwnd]);
					GetTextandAddLine(hwnd, IDC_EDIT_CONVERSATION, ": ");
					GetTextandAddLine(hwnd, IDC_EDIT_CONVERSATION, (char *)(wParam));
					GetTextandAddLine(hwnd, IDC_EDIT_CONVERSATION, "\r\n");
		}
		break;
	default:
		return FALSE;
	}
	
	return TRUE;
}
void DistroyConnectDialog()
{
	DestroyDialog(currentDialogHandle);
	currentDialogHandle = NULL;
}
Example #11
0
//OptionsDialog class functions
BOOL OptionsDialogType::DialogProcedure(UINT msg, WPARAM wParam, LPARAM lParam)
{
	BOOL Result = FALSE;

	switch(msg) 
	{
	case WM_INITDIALOG:
		InitDialog();
		Result = TRUE;
		break;

	case WM_DESTROY:
		DestroyDialog();
		break;

	case WM_COMMAND:
		switch (LOWORD(wParam)) 
		{
		case IDC_FILENAME:
			switch(HIWORD(wParam))
			{
			case EN_KILLFOCUS:
				FilenameChanged();
				break;

			case EN_CHANGE:
				if (GetFocus() == (HWND)lParam) SetChanged();
				break;
			}
			break;

		case IDC_BROWSE:
			if (HIWORD(wParam) == BN_CLICKED)
			{
				if (BrowseForSmileyPacks(GetSelProto()))
				{
					UpdateControls(true); 
					SetChanged();
				}
			}
			break;

		case IDC_SMLOPTBUTTON:
			if (HIWORD(wParam) == BN_CLICKED) ShowSmileyPreview();
			break;

		case IDC_USESTDPACK:
			if (HIWORD(wParam) == BN_CLICKED)
			{
				PopulateSmPackList(); 
				SetChanged();
			}
			break;

		case IDC_PLUGENABLED:
			if (HIWORD(wParam) == BN_CLICKED)
			{
				BOOL en = IsDlgButtonChecked(m_hwndDialog, IDC_PLUGENABLED) == BST_UNCHECKED;
				EnableWindow(GetDlgItem(m_hwndDialog, IDC_SMLBUT), en);
				SetChanged();
			}
			break;

		case IDC_ADDCATEGORY:
			if (HIWORD(wParam) == BN_CLICKED)
			{
				AddCategory();
			}
			break;

		case IDC_DELETECATEGORY:
			if (HIWORD(wParam) == BN_CLICKED)
			{
				if (tmpsmcat.DeleteCustomCategory(GetSelProto()))
				{
					PopulateSmPackList();
					SetChanged();
				}
			}
			break;

		case IDC_SPACES:
		case IDC_SCALETOTEXTHEIGHT:
		case IDC_APPENDSPACES:
		case IDC_SMLBUT:
		case IDC_SCALEALLSMILEYS:
		case IDC_IEVIEWSTYLE:
		case IDC_ANIMATESEL:
		case IDC_ANIMATEDLG:
		case IDC_INPUTSMILEYS:
		case IDC_DCURSORSMILEY:
		case IDC_DISABLECUSTOM:
		case IDC_HQSCALING:
			if (HIWORD(wParam) == BN_CLICKED) SetChanged();
			break;

		case IDC_SELCLR:
			if (HIWORD(wParam) == CPN_COLOURCHANGED) SetChanged();
			break;

		case IDC_MAXCUSTSMSZ:
		case IDC_MINSMSZ:
			if (HIWORD(wParam) == EN_CHANGE && GetFocus() == (HWND)lParam) SetChanged();
			break;
		}
		break;

	case UM_CHECKSTATECHANGE:
		UserAction((HTREEITEM)lParam);
		break;

	case WM_NOTIFY:
		switch(((LPNMHDR)lParam)->idFrom)
		{
		case 0:
			switch (((LPNMHDR)lParam)->code)
			{
			case PSN_APPLY:
				ApplyChanges();
				break;
			}
			break;

		case IDC_CATEGORYLIST:
			switch (((LPNMHDR)lParam)->code)
			{
			case NM_CLICK:
				{
					TVHITTESTINFO ht = {0};

					DWORD dwpos = GetMessagePos();
					POINTSTOPOINT(ht.pt, MAKEPOINTS(dwpos));
					MapWindowPoints(HWND_DESKTOP, ((LPNMHDR)lParam)->hwndFrom, &ht.pt, 1);

					TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom, &ht);
					if (TVHT_ONITEM & ht.flags)
						FilenameChanged();
					if (TVHT_ONITEMSTATEICON & ht.flags)
						PostMessage(m_hwndDialog, UM_CHECKSTATECHANGE, 0, (LPARAM)ht.hItem);
				}

			case TVN_KEYDOWN:
				if (((LPNMTVKEYDOWN) lParam)->wVKey == VK_SPACE)
					PostMessage(m_hwndDialog, UM_CHECKSTATECHANGE, 0, 
					(LPARAM)TreeView_GetSelection(((LPNMHDR)lParam)->hwndFrom));
				break;

			case TVN_SELCHANGEDA:
			case TVN_SELCHANGEDW:
				{
					LPNMTREEVIEW pnmtv = (LPNMTREEVIEW) lParam;
					if (pnmtv->itemNew.state & TVIS_SELECTED)
						UpdateControls();
				}
				break;
			}
			break;
		}
		break;
	}

	return Result;
}
Example #12
0
INT_PTR CALLBACK TSIDE_ReferenceMessageProc (
                                             HWND   window,
                                             UINT   message,
                                             WPARAM wparam,
                                             LPARAM lparam
                                            )
{
    struct reference_data* data;
    NMHDR*                 notify_data;
    LRESULT                current_selection;
    int                    error;

    switch(message)
    {
    case WM_INITDIALOG:
        error = InitializeDialog(window);
        if(error != TSIDE_ERROR_NONE)
            goto initialize_dialog_failed;

        return TRUE;

    case WM_CLOSE:
        ShowWindow(tside_reference_window, SW_HIDE);

        return TRUE;

    case WM_DESTROY:
        data = (struct reference_data*)GetWindowLongPtr(window, GWLP_USERDATA);
        if(data == NULL)
            return FALSE;

        DestroyDialog(data);

        return TRUE;

    case WM_NOTIFY:
        data = (struct reference_data*)GetWindowLongPtr(window, GWLP_USERDATA);
        if(data == NULL)
            return FALSE;

        notify_data = (LPNMHDR)lparam;

        switch(notify_data->code)
        {
        case TCN_SELCHANGE:
            current_selection = SendMessage(data->tab_window, TCM_GETCURSEL, 0, 0);
            if(current_selection < 0)
                return TRUE;

            SetSelectedTab(current_selection, data);

            return TRUE;
        }
    }

    return FALSE;

initialize_dialog_failed:
    PostQuitMessage(TSIDE_ERROR_REFERENCE_ERROR);

    return FALSE;
}