From fd13467832352fe2d023e0fc8e65952cebaddaba Mon Sep 17 00:00:00 2001 From: Edouard Dupin Date: Wed, 24 Aug 2011 12:13:57 +0200 Subject: [PATCH] REPLACE : addition done --- Sources/Buffer/BufferText.cpp | 6 +++--- Sources/GuiTools/Search/Search.cpp | 18 +++++++++++------- Sources/tools/NameSpaceEdn/String.cpp | 2 ++ avancement.boo | 5 ++--- test2.c | 6 +++--- 5 files changed, 21 insertions(+), 16 deletions(-) diff --git a/Sources/Buffer/BufferText.cpp b/Sources/Buffer/BufferText.cpp index 1272d59..b2c974d 100644 --- a/Sources/Buffer/BufferText.cpp +++ b/Sources/Buffer/BufferText.cpp @@ -1202,9 +1202,9 @@ void BufferText::Replace(Edn::String &data) bool haveSelectionActive = m_EdnBuf.GetSelectionPos(SELECTION_PRIMARY, SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd); if (true == haveSelectionActive) { // Replace Data : - // TODO : Reset this : ... m_EdnBuf.ReplaceSelected(SELECTION_PRIMARY, data.GetDirectPointer());//, strlen(data.GetDirectPointer())); - // TODO : Reset this : ... SetInsertPosition(SelectionStart + strlen(data.GetDirectPointer())); - + Edn::VectorType myData = data.GetVector(); + m_EdnBuf.ReplaceSelected(SELECTION_PRIMARY, myData); + SetInsertPosition(SelectionStart + myData.Size()); } SetModify(true); } diff --git a/Sources/GuiTools/Search/Search.cpp b/Sources/GuiTools/Search/Search.cpp index fe885b5..b9ebaa4 100644 --- a/Sources/GuiTools/Search/Search.cpp +++ b/Sources/GuiTools/Search/Search.cpp @@ -192,15 +192,15 @@ void Search::Display(GtkWindow *parent) } else { gtk_widget_set_sensitive(m_CkMatchCase, true); } - - Edn::String myDataString; - SearchData::GetSearch(myDataString); + // Remove data form the search + Edn::String myDataString = ""; + SearchData::SetSearch(myDataString); gtk_entry_set_text(GTK_ENTRY(m_searchEntry), myDataString.c_str()); - if (0 == strlen(myDataString.c_str())) { + //if (0 == strlen(myDataString.c_str())) { m_haveSearchData = false; - } else { - m_haveSearchData = true; - } + //} else { + // m_haveSearchData = true; + //} SearchData::GetReplace(myDataString); gtk_entry_set_text(GTK_ENTRY(m_replaceEntry), myDataString.c_str()); @@ -220,6 +220,10 @@ void Search::Display(GtkWindow *parent) gtk_widget_set_sensitive(m_BtReplaceAndNext, m_haveReplaceData); } + // set focus on a specific widget : + gtk_window_set_focus(parent, m_searchEntry); + + // display the dialogue box gtk_widget_show_all(m_localDialog); diff --git a/Sources/tools/NameSpaceEdn/String.cpp b/Sources/tools/NameSpaceEdn/String.cpp index f634fe1..89beabd 100644 --- a/Sources/tools/NameSpaceEdn/String.cpp +++ b/Sources/tools/NameSpaceEdn/String.cpp @@ -584,6 +584,8 @@ Edn::VectorType Edn::String::GetVector(void) return out; } + + /** * @brief Unitary test for the string system * diff --git a/avancement.boo b/avancement.boo index a747a19..51a5f21 100644 --- a/avancement.boo +++ b/avancement.boo @@ -16,12 +16,10 @@ # action a faire (ordonner par révision) : * 0.1.X : - - ctags : Back simple et multiple - - sys : search complet, replace complet and replace ALL ... - gui : demander l'enregistrement avant de fermer (quand c'est nécessaire) - - Faire les deplacement de EdnXXX dans le nameSpace Edn::XXX - Edn::VectorType : Rewrite the erase fuction to support start => stop and Erase len methode ... * 0.2.X : + - gui : Mise en place d'un display ligne par ligne - gui : Demander la création de nouveaux fichier quand il n'existe pas (a l'ouverture en ligne de commande) - sys : Mise en place des colorisation de base pour le * java script @@ -44,6 +42,7 @@ * 0.5.X : - project : list of current files open - gui : Parameters : et en autre la taille de la police ... et voir pour la récupérer sur le system... et ce serait cool... + - sys : replace ALL # Text Editor diff --git a/test2.c b/test2.c index bd99f89..367bbe3 100644 --- a/test2.c +++ b/test2.c @@ -18,15 +18,15 @@ //#include "tools_debug.h" #include "tools_globals.h" #include "EdnBuf.h" - +Edn m_isUndoProcessing = false; m_isRedoProcessing = false; - + Edn // Load highlight system : HighlightManager *myHighlightManager = HighlightManager::getInstance(); EdnString plop = ".c"; m_Highlight = myHighlightManager->Get(plop); //m_Highlight = NULL; - m_nbLine = 1; + m_nbLine = 1;Edn m_HLDataSequence = 0;