Compared files  

Left
C:\SDK\wxWidgets-2.6.2\contrib\src\stc\PlatWX.cpp
Last modified2005-09-18 10:01:50.001 +0200
Size35 Kb (1379 Lines)
EncodingLatin 1 - ANSI (CP1252) default
Right
C:\SDK\wxWidgets-2.6.3\contrib\src\stc\PlatWX.cpp
Last modified2006-03-16 13:06:58.001 +0100
Size35.9 Kb (1399 Lines)
EncodingLatin 1 - ANSI (CP1252) default


   Comparison Statistics  

Detailed Statistics

All Changes
 BlocksLines
Unchanged251344
Inserted423
Deleted27
Ignored00
Changed1860



   Comparison Details  

5 skipped lines
6 6  
7 7 #include <ctype.h>
8 8  
9 #include <wx/wx.h> 9 #include "wx/wx.h"
10 #include <wx/encconv.h> 10 #include "wx/encconv.h"
11 #include <wx/listctrl.h> 11 #include "wx/listctrl.h"
12 #include <wx/mstream.h> 12 #include "wx/mstream.h"
13 #include <wx/image.h> 13 #include "wx/image.h"
14 #include <wx/imaglist.h> 14 #include "wx/imaglist.h"
  15 #include "wx/tokenzr.h"
15 16  
16 17 #include "Platform.h"
17 18 #include "PlatWX.h"
89 skipped lines
107 108     // so we adjust the encoding before passing it to Scintilla.  See also
108 109     // wxStyledTextCtrl::StyleSetCharacterSet
109 110     wxFontEncoding encoding = (wxFontEncoding)(characterSet-1);
110       111  
111 112     wxFontEncodingArray ea = wxEncodingConverter::GetPlatformEquivalents(encoding);
112 113     if (ea.GetCount())
113 114         encoding = ea[0];
487 skipped lines
601 602  
602 603  
603 604 void Window::SetTitle(const char *s) {
604     GETWIN(id)->SetTitle(stc2wx(s)); 605     GETWIN(id)->SetLabel(stc2wx(s));
605 606 }
606 607  
607 608  
58 skipped lines
666 667  
667 668  
668 669  
669 #if wxUSE_POPUPWIN //-----------------------------------    670 #if wxUSE_POPUPWIN //-----------------------------------
670 671 #include <wx/popupwin.h>
671 672  
672 673  
3 skipped lines
676 677 // implement wxPopupWindow for the Mac!!)
677 678 //
678 679 // In the meantime, be careful to duplicate any changes as needed...
679 //     680 //
680       681  
681 // A popup window to place the wxSTCListBox upon     682 // A popup window to place the wxSTCListBox upon
682 683 class wxSTCListBoxWin : public wxPopupWindow
683 684 {
684 685 private:
1 skipped line
686 687     CallBackAction      doubleClickAction;
687 688     void*               doubleClickActionData;
688 689 public:
689     wxSTCListBoxWin(wxWindow* parent, wxWindowID id) : 690     wxSTCListBoxWin(wxWindow* parent, wxWindowID id, Point WXUNUSED(location)) :
690 691         wxPopupWindow(parent, wxBORDER_NONE)
691 692     {
692 693         SetBackgroundColour(*wxBLACK);  // for our simple border
9 skipped lines
702 703         // "right" to the user.  But since the wxPopupWindow or its children
703 704         // can't receive focus then we have to pull a fast one and temporarily
704 705         // parent the listctrl on the STC window and then call SetFocus and
705         // then reparent it back to the popup.  706         // then reparent it back to the popup.
706 707         lv->SetFocus();
707 708         lv->Reparent(this);
708 709 #ifdef __WXMSW__
84 skipped lines
793 794     EVT_LIST_ITEM_ACTIVATED(wxID_ANY, wxSTCListBoxWin::OnActivate)
794 795 END_EVENT_TABLE()
795 796  
796       797  
797 798  
798 799 #else // wxUSE_POPUPWIN -----------------------------------
799 800  
4 skipped lines
804 805     CallBackAction      doubleClickAction;
805 806     void*               doubleClickActionData;
806 807 public:
807     wxSTCListBoxWin(wxWindow* parent, wxWindowID id) : 808     wxSTCListBoxWin(wxWindow* parent, wxWindowID id, Point location) :
808         wxWindow(parent, id, wxDefaultPosition, wxSize(0,0), wxSIMPLE_BORDER ) 809         wxWindow(parent, id, wxPoint(location.x, location.y), wxSize(0,0), wxSIMPLE_BORDER )
809 810     {
810 811  
811 812         lv = new wxSTCListBox(this, id, wxDefaultPosition, wxDefaultSize,
69 skipped lines
881 882         return rv;
882 883     }
883 884 #endif
884       885  
885 886     void OnActivate(wxListEvent& WXUNUSED(event)) {
886 887         doubleClickAction(doubleClickActionData);
887 888     }
30 skipped lines
918 919     bool                unicodeMode;
919 920     int                 desiredVisibleRows;
920 921     int                 aveCharWidth;
921     int                 maxStrWidth; 922     size_t              maxStrWidth;
  923     Point               location;       // Caret location at which the list is opened
922 924     wxImageList*        imgList;
923 925     wxArrayInt*         imgTypeMap;
924 926  
2 skipped lines
927 929     ~ListBoxImpl();
928 930  
929 931     virtual void SetFont(Font &font);
930     virtual void Create(Window &parent, int ctrlID, int lineHeight_, bool unicodeMode_); 932     virtual void Create(Window &parent, int ctrlID, Point location_, int lineHeight_, bool unicodeMode_);
931 933     virtual void SetAverageCharWidth(int width);
932 934     virtual void SetVisibleRows(int rows);
  935     virtual int GetVisibleRows() const;
933 936     virtual PRectangle GetDesiredRect();
934 937     virtual int CaretFromEdge();
935 938     virtual void Clear();
936 939     virtual void Append(char *s, int type = -1);
  940             void Append(const wxString& text, int type);
937 941     virtual int Length();
938 942     virtual void Select(int n);
939 943     virtual int GetSelection();
2 skipped lines
942 946     virtual void RegisterImage(int type, const char *xpm_data);
943 947     virtual void ClearRegisteredImages();
944 948     virtual void SetDoubleClickAction(CallBackAction, void *);
945   949     virtual void SetList(const char* list, char separator, char typesep);
946 950 };
947 951  
948 952  
21 skipped lines
970 974 }
971 975  
972 976  
973 void ListBoxImpl::Create(Window &parent, int ctrlID, int lineHeight_, bool unicodeMode_) { 977 void ListBoxImpl::Create(Window &parent, int ctrlID, Point location_, int lineHeight_, bool unicodeMode_) {
  978     location = location_;
974 979     lineHeight =  lineHeight_;
975 980     unicodeMode = unicodeMode_;
976 981     maxStrWidth = 0;
977     id = new wxSTCListBoxWin(GETWIN(parent.GetID()), ctrlID); 982     id = new wxSTCListBoxWin(GETWIN(parent.GetID()), ctrlID, location);
978 983     if (imgList != NULL)
979 984         GETLB(id)->SetImageList(imgList, wxIMAGE_LIST_SMALL);
980 985 }
9 skipped lines
990 995 }
991 996  
992 997  
  998 int ListBoxImpl::GetVisibleRows() const {
  999     return desiredVisibleRows;
  1000 }
  1001  
993 1002 PRectangle ListBoxImpl::GetDesiredRect() {
994 1003     // wxListCtrl doesn't have a DoGetBestSize, so instead we kept track of
995 1004     // the max size in Append and calculate it here...
996     int maxw = maxStrWidth; 1005     int maxw = maxStrWidth * aveCharWidth;
997 1006     int maxh ;
998 1007  
999 1008     // give it a default if there are no lines, and/or add a bit more
39 skipped lines
1039 1048  
1040 1049  
1041 1050 void ListBoxImpl::Append(char *s, int type) {
1042     wxString text = stc2wx(s); 1051     Append(stc2wx(s), type);
  1052 }
  1053  
  1054 void ListBoxImpl::Append(const wxString& text, int type) {
1043 1055     long count  = GETLB(id)->GetItemCount();
1044 1056     long itemID  = GETLB(id)->InsertItem(count, wxEmptyString);
1045 1057     GETLB(id)->SetItem(itemID, 1, text);
1046     int itemWidth = 0;  
1047     GETLB(id)->GetTextExtent(text, &itemWidth, NULL);  
1048     maxStrWidth = wxMax(maxStrWidth, itemWidth); 1058     maxStrWidth = wxMax(maxStrWidth, text.length());
1049 1059     if (type != -1) {
1050 1060         wxCHECK_RET(imgTypeMap, wxT("Unexpected NULL imgTypeMap"));
1051 1061         long idx = imgTypeMap->Item(type);
1 skipped line
1053 1063     }
1054 1064 }
1055 1065  
  1066 void ListBoxImpl::SetList(const char* list, char separator, char typesep) {
  1067     GETLB(id)->Freeze();
  1068     Clear();
  1069     wxStringTokenizer tkzr(stc2wx(list), (wxChar)separator);
  1070     while ( tkzr.HasMoreTokens() ) {
7 skipped lines
  1078         Append(token, (int)type);
  1079     }
  1080     GETLB(id)->Thaw();
  1081 }
  1082  
1056 1083  
1057 1084 int ListBoxImpl::Length() {
1058 1085     return GETLB(id)->GetItemCount();
74 skipped lines
1133 1160 }
1134 1161  
1135 1162  
1136    
1137 1163 ListBox::ListBox() {
1138 1164 }
1139 1165  
230 skipped lines
1370 1396 }
1371 1397  
1372 1398 #endif
1373    
1374    
1375    
1376    
1377    
1378    
1379 1399  

   Text comparison Options  

Syntax colouring language used: C / C++
Match character case: yes.
Match line endings: no.
Match spaces

At start of lines: yes,
In middle of lines: yes,
At end of lines: yes.
Blank lines as empty lines: no.
Activate comparison algorithm
At word level: yes,
At character level: no.


   Legend  

Unchanged lineExample of unchanged line
Modified lineExample of modified line
Added lineExample of added line
Removed lineExample of removed line
Ignored lineExample of ignored line

This report has been generated by Ellié Computing Merge on 2006-09-07 15:48:10.001 +0200.
© 2005-2006 Ellié Computing http://www.elliecomputing.com. All rights reserved.