Developer forums (C::B DEVELOPMENT STRICTLY!) > Contributions to C::B

I can help with C::B with cross platforms.

<< < (2/5) > >>

mandrav:

--- Quote from: Paco.Blasco on August 03, 2006, 01:40:29 pm ---I suppose that binreloc should work on MAC (OS X is called Darwin and it is BSD with a nice GUI and JFS, basically).
My question is: one of the lines of "base = ... " must be removed (in fact, the first line is not used.....)

--- End quote ---

No, it is used. Read the code:


--- Code: C++ ---    // SELFPATH is a macro from prefix.h (binreloc)    // it returns the absolute filename of us    // similar to win32 GetModuleFileName()...    base = wxString(SELFPATH,wxConvUTF8);    base = wxFileName(base).GetPath(); 
The second assignment, uses the same object (base). It's the same as writing:


--- Code: C++ ---    base = wxFileName(wxString(SELFPATH,wxConvUTF8)).GetPath(); 
only a little clearer.

Paco.Blasco:
I'm silly.

Pecan:

--- Quote from: Paco.Blasco on August 03, 2006, 01:20:33 pm ---I don't have __WXMAC__ defined because C::B requires wxPopuWindow and that wxClass is not supported by WXMAC, so, I'm using fink and I compile wxWidgets with GTK. So i'm defining "WXGTK".
First I want to have a C::B working right (I probed the PPC version, but it have a lot of problems with the window layout).
And then to begin to work with WXMAC.


--- End quote ---

wxMac supports a "form" of popup window that will work with CodeBlocks.
It's called "miniframe". You can pick it out of the following patch.
As used in Codeblocks, the "MiniFrame" class works just like wxPopupWindow on all platforms (MS, Unix, OSX)


--- Code: ---Index: src/sdk/infowindow.cpp
===================================================================
--- src/sdk/infowindow.cpp (revision 2750)
+++ src/sdk/infowindow.cpp (working copy)
@@ -8,7 +8,14 @@
     #include "manager.h"
 #endif
 
+// --------------------------------------------------------------------------
+//  wxMAC has no support for wxPopupWindow, use wxMiniFrame instead
+// --------------------------------------------------------------------------
+#if (defined(__WXMAC__) || defined(_TEST_MINIFRAME_))
+BEGIN_EVENT_TABLE(InfoWindow, wxMiniFrame)
+#else
 BEGIN_EVENT_TABLE(InfoWindow, wxPopupWindow)
+#endif
 EVT_TIMER(-1, InfoWindow::OnTimer)
 EVT_MOTION(InfoWindow::OnMove)
 EVT_LEFT_DOWN(InfoWindow::OnClick)
@@ -116,7 +123,13 @@
 
 
 InfoWindow::InfoWindow(const wxString& title, const wxString& message, unsigned int delay, unsigned int hysteresis)
+            #if (defined(__WXMAC__) || defined(_TEST_MINIFRAME_))
+                #warning "Testing wxMac wxMiniFrame substitution for wxPopupWindow"\
+                " because the _TEST_MINIFRAME_ option was specified"
+            : wxMiniFrame(Manager::Get()->GetAppWindow(), -1, _T(""), wxDefaultPosition, wxDefaultSize, 0),
+            #else
             : wxPopupWindow(Manager::Get()->GetAppWindow(), wxSIMPLE_BORDER | wxWS_EX_TRANSIENT | wxCLIP_CHILDREN),
+            #endif
               m_timer(new wxTimer(this, 0)), status(0), m_delay(delay), ks(2)
     {
         wxBoxSizer *bs = new wxBoxSizer(wxVERTICAL);
@@ -225,4 +238,3 @@
     status = 3;
     m_timer->Start(scroll_millis, false);
 }
-
Index: src/sdk/infowindow.h
===================================================================
--- src/sdk/infowindow.h (revision 2750)
+++ src/sdk/infowindow.h (working copy)
@@ -16,8 +16,16 @@
 #include <wx/event.h>
 #include <wx/timer.h>
 #include <wx/string.h>
-#include <wx/popupwin.h>
 
+//-----------------------------------------------------------------------------
+// There is no wxPopupWindows for wxMac, use wxMiniFrame instead
+//-----------------------------------------------------------------------------
+#if (defined(__WXMAC__) || defined(_TEST_MINIFRAME_))
+    #include <wx/minifram.h>
+#else
+    #include <wx/popupwin.h>
+#endif
+
 #undef new
 #include <list>
 #include <algorithm>
@@ -48,7 +56,11 @@
     };
 };
 
+#if (defined(__WXMAC__) || defined(_TEST_MINIFRAME_))
+class InfoWindow : public wxMiniFrame
+#else
 class InfoWindow : public wxPopupWindow
+#endif
 {
     wxTimer *m_timer;
     int left;
@@ -71,7 +83,8 @@
 
     public:
 
-    static void Display(const wxString& title, const wxString& message, unsigned int delay = 5000, unsigned int hysteresis = 1){new InfoWindow(title, message, delay, hysteresis);};
+    static void Display(const wxString& title, const wxString& message, unsigned int delay = 5000, unsigned int hysteresis = 1)
+        {new InfoWindow(title, message, delay, hysteresis);};
 };
 
 #endif
Index: src/sdk/pluginmanager.cpp
===================================================================
--- src/sdk/pluginmanager.cpp (revision 2750)
+++ src/sdk/pluginmanager.cpp (working copy)
@@ -106,6 +106,14 @@
         ok = dir.GetNext(&filename);
     }
     Manager::Get()->GetMessageManager()->Log(_("Found %d plugins"), count);
+    #if defined(_TEST_MINIFRAME_)
+ {
+        InfoWindow::Display(_("Testing"),
+                            _("This is a test of wxMiniFrame.\n"
+                            "Used on the Mac to substitute for wxPopupWindow:\n"),
+                            15000, 3000);
+ }
+ #endif
  if (!failed.IsEmpty())
  {
         InfoWindow::Display(_("Warning"),


--- End code ---

thomas:

--- Quote ---wxMac supports a "form" of popup window that will work with CodeBlocks.
It's called "miniframe". You can pick it out of the following patch.
--- End quote ---
I was going to say "wow, you're genious", when I changed it to use wxMiniFrame regardless of the OS (as it should work fine for Windows and Linux, too).
However, wxMiniFrame draws behind the Windows taskbar, so it is only partially visible :(
Any ideas on how to solve this? Well, anything apart from moving it up by the taskbar's height... :)

Pecan:

--- Quote from: thomas on August 03, 2006, 04:53:42 pm ---
--- Quote ---wxMac supports a "form" of popup window that will work with CodeBlocks.
It's called "miniframe". You can pick it out of the following patch.
--- End quote ---
I was going to say "wow, you're genious", when I changed it to use wxMiniFrame regardless of the OS (as it should work fine for Windows and Linux, too).
However, wxMiniFrame draws behind the Windows taskbar, so it is only partially visible :(
Any ideas on how to solve this? Well, anything apart from moving it up by the taskbar's height... :)

--- End quote ---

Oops!, I knew my luck couldn't last. My taskbar is in "hidden" mode, so I didn't see this.

I'll fiddle with it. It's using a style="0". I'll try some options.

thanks
pecan

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version