Smallest change possible to make it work and instructions that work for me. The configure skript from libtiff doesn't seem to understand that this is cross-compilation and fails in a "sanity check", so it needs to be disabled.
wxIPhone.png (view on web)https://github.com/wxWidgets/wxWidgets/pull/25688
(3 files)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
@RobertRoeb pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.
@RobertRoeb pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.
@RobertRoeb pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.
@RobertRoeb pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.
@RobertRoeb pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.
@RobertRoeb pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.
@RobertRoeb pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.
@RobertRoeb pushed 2 commits.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.
@RobertRoeb pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.
@RobertRoeb pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.
@RobertRoeb pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.
@RobertRoeb pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.
@lanurmi commented on this pull request.
I'd like to point out that the commit message of this commit and various previous ones does not follow the "standard rules" used in wxWidgets's git. That is, a short title, followed by an empty line, and a longer description.
(Also note that commit messages can be modified without redoing everything or creating a new PR.)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
@RobertRoeb pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.
@RobertRoeb pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.
@RobertRoeb pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.
Hi @RobertRoeb ! I'm unsure segmented buttons should be implemented as wxChoice. This does not look like wxChoice is supposed to look in general. I believe segmented buttons should be rather implemented as some new control with some future general implementation added later for other platforms. I would rather add this as separate PR since this is new feature rather than simple improvement. Regards, ABX
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
@RobertRoeb pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.
@vadz requested changes on this pull request.
Sorry, I ran out of steam before the end but it's clear that while there are a lot of potentially useful things here, there are also potentially quite a few things to change, e.g. I'm not at all convinced that we want to represent wxChoice
with segmented buttons.
It would be great to split this PR into independent changes in order to discuss them separately as discussing all of them here will probably become unmanageable pretty quickly.
TIA!
> @@ -437,7 +437,7 @@ typedef void (wxEvtHandler::*wxBookCtrlEventFunction)(wxBookCtrlEvent&); #define EVT_BOOKCTRL_PAGE_CHANGING(id, fn) EVT_NOTEBOOK_PAGE_CHANGING(id, fn) #else // dedicated to Smartphones - #include "wx/choicebk.h" + // #include "wx/choicebk.h"
This doesn't look intentional.
In configure.ac:
> @@ -425,6 +425,7 @@ WX_ARG_ONLY_WITH(directfb, [ --with-directfb use DirectFB], [wxUSE WX_ARG_ONLY_WITH(x11, [ --with-x11 use X11], [wxUSE_X11="$withval" wxUSE_UNIVERSAL="yes" CACHE_X11=1 TOOLKIT_GIVEN=1]) WX_ARG_ONLY_WITH(qt, [ --with-qt use Qt], [wxUSE_QT="$withval" CACHE_QT=1 TOOLKIT_GIVEN=1]) WX_ARG_ENABLE(nanox, [ --enable-nanox use NanoX], wxUSE_NANOX) +WX_ARG_ENABLE(iphonesimulator, [ --enable-iphonesimulator commpile for iPhone simulator], wxUSE_IPHONESIMULATOR)
Could we avoid using this option and just check if host
matches *apple-darwin_sim
instead? This would seem to be a simpler and more natural way to handle this than using artificially different (IIUC) host
and build
triplets in this case by specifying the OS version for only one but not the other.
In include/wx/osx/iphone/chkconf.h:
> @@ -58,11 +58,6 @@ #define wxUSE_TOOLTIPS 0 #endif -#if wxUSE_DATAVIEWCTRL
Does it actually work there? It really doesn't look so... And in this case this fragment should remain.
In include/wx/osx/iphone/private.h:
> @@ -38,7 +38,7 @@ wxBitmapBundle WXDLLIMPEXP_CORE wxOSXCreateSystemBitmapBundle(const wxString& id class WXDLLIMPEXP_CORE wxWidgetIPhoneImpl : public wxWidgetImpl { public : - wxWidgetIPhoneImpl( wxWindowMac* peer , WXWidget w, int flags = 0 ) ; + wxWidgetIPhoneImpl( wxWindowMac* peer , WXWidget w, int flags = 0, void *c = NULL ) ;
A comment explaining what c
would be welcome but if not then at least let's give an actual name, e.g.
- wxWidgetIPhoneImpl( wxWindowMac* peer , WXWidget w, int flags = 0, void *c = NULL ) ; + wxWidgetIPhoneImpl( wxWindowMac* peer , WXWidget w, int flags = 0, void* controller = nullptr ) ;
Using some type different from void*
would be great too...
In include/wx/osx/iphone/private.h:
> @@ -124,8 +126,11 @@ public : virtual void controlAction(void* sender, wxUint32 controlEvent, WX_UIEvent rawEvent); virtual void controlTextDidChange(); + + void* GetController() { return m_controller; }⬇️ Suggested change
- void* GetController() { return m_controller; } + void* GetController() const { return m_controller; }
In include/wx/osx/iphone/private.h:
> @@ -225,13 +230,12 @@ protected : @end - @interface wxUIView : UIView + @interface wxUIView : UIScrollView
I'm not sure what is wxUIView
used exactly for, but it looks weird to make all views scrollable. Are you sure we need to do it?
In include/wx/osx/iphone/private.h:
> { } @end // wxUIView -
It would be great to avoid whitespace-only changed intermingled with significant ones please.
> + wxSYS_DEVICE_AREA_TOP, + wxSYS_DEVICE_AREA_BOTTOM, + wxSYS_DEVICE_AREA_LEFT, + wxSYS_DEVICE_AREA_RIGHT
We really should add this to wxDisplay
if it's not already covered by its GetClientArea()
and not here, this is basically a legacy interface.
> @@ -11,6 +11,7 @@ #define _WX_SIMPLEBOOK_H_ #include "wx/compositebookctrl.h" +#include "wx/choicebk.h"
This definitely doesn't seem right.
We typically use PNGs or SVGs for new images, not XPM.
> @@ -212,6 +214,7 @@ const char* wxART_WX_LOGO; @li @c wxART_CDROM @li @c wxART_REMOVABLE @li @c wxART_WX_LOGO (since 3.1.6) + @li @c wxART_PREV_SCREEN (since 3.1.6)⬇️ Suggested change
- @li @c wxART_PREV_SCREEN (since 3.1.6) + @li @c wxART_PREV_SCREEN (since 3.3.2)
> @@ -15,6 +15,8 @@ @beginStyleTable @style{wxCB_SORT} Sorts the entries alphabetically. + @style{wxCH_BUTTONS}
Shouldn't this be a style of wxToolBar
? wxChoice
really isn't supposed to look like this IMO.
> @@ -60,6 +66,20 @@ bool wxFrame::Create(wxWindow *parent, if ( !wxTopLevelWindow::Create(parent, id, title, pos, size, style, name) ) return false; +#ifdef __WXOSX_IPHONE__ + if (parent != NULL) {⬇️ Suggested change
- if (parent != NULL) { + if (parent != nullptr) + {
> @@ -60,6 +66,20 @@ bool wxFrame::Create(wxWindow *parent, if ( !wxTopLevelWindow::Create(parent, id, title, pos, size, style, name) ) return false; +#ifdef __WXOSX_IPHONE__ + if (parent != NULL) { + // We are on the next screen, provide a back button and title + wxToolBar *tb = CreateToolBar(); + // tb->AddTool( wxID_CLOSE, wxEmptyString, wxArtProvider::GetBitmap(wxART_PREV_SCREEN) ); doesn't work for some reason + tb->AddTool( wxID_CLOSE, wxEmptyString, wxBitmap( prev_screen_xpm ) ); + tb->AddStretchableSpace(); // doesn't yet stretch on iOS, so at least at two⬇️ Suggested change
- tb->AddStretchableSpace(); // doesn't yet stretch on iOS, so at least at two + tb->AddStretchableSpace(); // doesn't yet stretch on iOS, so at least add two
In src/osx/iphone/checkbox.mm:
> { [m_control setOn:v != 0 animated:NO]; } + + void Move(int x, int y, int width, int height) override + { + wxWidgetIPhoneImpl::Move( x, y, width, height ); + m_label->SetPosition( wxPoint(x + 65, y+5) ); // TODO: align properly
It's not just alignment, it's the horizontal offset too. We really should at least use GetChar{Width,Height}()
here instead of hardcoding these values.
> + wxSegmentedChoiceIPhoneImpl(wxWindowMac *wxpeer, wxUISegmentedControl *v) + : wxWidgetIPhoneImpl(wxpeer, v) + { + } + + void InsertItem( size_t pos, int itemid, const wxString& text) override + { + wxCFStringRef cftext(text); + [((wxUISegmentedControl*)m_osxView) insertSegmentWithTitle:cftext.AsNSString() atIndex:pos animated:NO]; + [((wxUISegmentedControl*)m_osxView) setEnabled: YES forSegmentAtIndex: pos ]; + } + + size_t GetNumberOfItems() const override + { + int value = [((wxUISegmentedControl*)m_osxView) numberOfSegments]; + wxLogMessage( "GetNumberOfItems()", value );⬇️ Suggested change
- wxLogMessage( "GetNumberOfItems()", value );
> - wxChoiceIPhoneImpl* c = new wxChoiceIPhoneImpl( wxpeer, v ); + wxWidgetImplType *c = NULL; + + if ((style & wxCH_BUTTONS) != 0) {⬇️ Suggested change
- if ((style & wxCH_BUTTONS) != 0) { + if ((style & wxCH_BUTTONS) != 0) + {
> - wxChoiceIPhoneImpl* c = new wxChoiceIPhoneImpl( wxpeer, v ); + wxWidgetImplType *c = NULL; + + if ((style & wxCH_BUTTONS) != 0) { + wxUISegmentedControl* v = [[wxUISegmentedControl alloc] initWithFrame:r]; + // [v setMomentary: NO]; + c = new wxSegmentedChoiceIPhoneImpl( wxpeer, v ); + } else {⬇️ Suggested change
- } else { + } + else + {
> @@ -19,6 +19,7 @@ #endif // WX_PRECOMP #include "wx/osx/private.h" +#include "wx/log.h"⬇️ Suggested change
-#include "wx/log.h"
> @@ -32,6 +32,7 @@ #endif #include "wx/osx/private.h" +#include "wx/log.h"⬇️ Suggested change
-#include "wx/log.h"
In src/osx/iphone/nonownedwnd.mm:
> @@ -13,6 +13,8 @@ #include "wx/nonownedwnd.h" #include "wx/frame.h" +#include "wx/settings.h" +#include "wx/log.h"⬇️ Suggested change
-#include "wx/log.h"
and remove wxLogMessage()
calls below.
> @@ -212,6 +214,7 @@ const char* wxART_WX_LOGO; @li @c wxART_CDROM @li @c wxART_REMOVABLE @li @c wxART_WX_LOGO (since 3.1.6) + @li @c wxART_PREV_SCREEN (since 3.1.6)
Also, it would be nice to explain how is this one different from wxART_GO_BACK
.
> @@ -60,6 +66,20 @@ bool wxFrame::Create(wxWindow *parent, if ( !wxTopLevelWindow::Create(parent, id, title, pos, size, style, name) ) return false; +#ifdef __WXOSX_IPHONE__ + if (parent != NULL) { + // We are on the next screen, provide a back button and title + wxToolBar *tb = CreateToolBar(); + // tb->AddTool( wxID_CLOSE, wxEmptyString, wxArtProvider::GetBitmap(wxART_PREV_SCREEN) ); doesn't work for some reason + tb->AddTool( wxID_CLOSE, wxEmptyString, wxBitmap( prev_screen_xpm ) ); + tb->AddStretchableSpace(); // doesn't yet stretch on iOS, so at least at two
Also, maybe we should modify the function itself to make the stretchable spaces twice as wide?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
@RobertRoeb pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.
@RobertRoeb pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.
@RobertRoeb pushed 3 commits.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.
Screenshots from major progress on drawing and scrolling support
wxVListBox.png (view on web) wxDataViewCtrl.png (view on web) SetTargetWindow.png (view on web) wxHtmlWindow.png (view on web)—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
. I'm not at all convinced that we want to represent
wxChoice
with segmented buttons.
The current wxChoice uses the picker control, which surely does not look like a MSW choice either. I can create a new wxSegmentedButton control with no implementation elsewhere. Then how should I implement wxBookCtrl? This control needs a segmented button on top, wxChoiceBook uses wxChoice, so this was an easy solution. Anyways, to get this further - shall I
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
@RobertRoeb commented on this pull request.
In configure.ac:
> @@ -425,6 +425,7 @@ WX_ARG_ONLY_WITH(directfb, [ --with-directfb use DirectFB], [wxUSE WX_ARG_ONLY_WITH(x11, [ --with-x11 use X11], [wxUSE_X11="$withval" wxUSE_UNIVERSAL="yes" CACHE_X11=1 TOOLKIT_GIVEN=1]) WX_ARG_ONLY_WITH(qt, [ --with-qt use Qt], [wxUSE_QT="$withval" CACHE_QT=1 TOOLKIT_GIVEN=1]) WX_ARG_ENABLE(nanox, [ --enable-nanox use NanoX], wxUSE_NANOX) +WX_ARG_ENABLE(iphonesimulator, [ --enable-iphonesimulator commpile for iPhone simulator], wxUSE_IPHONESIMULATOR)
I tried that but it failed in configure - I forgot in which step, possibly not recognising as cross-compilation, so this was the only way.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
@RobertRoeb commented on this pull request.
In include/wx/osx/iphone/chkconf.h:
> @@ -58,11 +58,6 @@ #define wxUSE_TOOLTIPS 0 #endif -#if wxUSE_DATAVIEWCTRL
Yes, wxDataViewCtrl works now.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
@RobertRoeb commented on this pull request.
In include/wx/osx/iphone/private.h:
> @@ -38,7 +38,7 @@ wxBitmapBundle WXDLLIMPEXP_CORE wxOSXCreateSystemBitmapBundle(const wxString& id class WXDLLIMPEXP_CORE wxWidgetIPhoneImpl : public wxWidgetImpl { public : - wxWidgetIPhoneImpl( wxWindowMac* peer , WXWidget w, int flags = 0 ) ; + wxWidgetIPhoneImpl( wxWindowMac* peer , WXWidget w, int flags = 0, void *c = NULL ) ;
Makes sense- will try to add this to the PR - never done that before.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
@RobertRoeb pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.
> @@ -124,8 +126,11 @@ public : virtual void controlAction(void* sender, wxUint32 controlEvent, WX_UIEvent rawEvent); virtual void controlTextDidChange(); + + void* GetController() { return m_controller; }
Need to check if that is actually possible
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
It would be great to split this PR into independent
changes in order to discuss them separately
I am not sure I know how to do that and some of the changes depend on each other. Can I create a PR out of e.g. 2 commits?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
I am not sure I know how to do that and some of the changes depend on each other. Can I create a PR out of e.g. 2 commits?
Yes, typically you would create a branch (you should remain your current master
to something else, like my-wip
, because master
should typically remain synchronized with the main repository master) and then use git cherry-pick
to apply individual commits in this branch — and then push this branch to GitHub to create a PR for it.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
The current wxChoice uses the picker control
Sorry, I have no idea what is the picker control, so I can't comment on this, but my specific concern with this implementation of wxChoice
is that this control is supposed to be good for reasonably many items, e.g. it could be used to select a US state in the address entry form, and you definitely couldn't use segmented buttons for this!
* add an iPhone specific wxSegmentedButtons * re-implement wxNotebook using it * cast wxBookCtrl to wxNotebook instead of wxChoiceBook on iPhone * implement wxNavigationCtrl using native control on iPhone and cast to wxNotebook with bar at the bottom on other platforms
I am not sure, but from the application developer point of view I think just using wxNotebook
normally would be the best.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
I am still learning git the hard way and I learnt that I need to move all my changes from master to a new branch. So I will do:
git branch iphone_updates
git checkout master
git reset --hard HEAD~24
git checkout iphone_updates
This will probably ruin this PR, but I will create new ones by cherry picking. I hope this will work....
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
The above commands will preserve exactly the same changes as are here now in iphone_updates
branch, so if this is what you want to do, they are indeed the right commands to use. Ideally, you'd do all of this except for the last command and do something like
$ git checkout -b iphone-change-1 $ git cherry-pick <some commits to go into this branch>
to create branches with more focused changes.
As for "ruining this PR": pushing your master to GitHub after these commands will indeed do it (I'm not sure if PR will get closed automatically, but in any way, it won't contain anything useful), but this is fine.
And just a small hint at the end: instead of hard-coding 24 (the number of commits) you may use @{u}
where "u" stands for "upstream" and is a shorthand for HEAD@{u}
or origin/master
.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
@RobertRoeb pushed 0 commits.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.
Closed #25688.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.