diff options
author | Dan Gudmundsson <dgud@Dan.localdomain> | 2020-08-26 10:16:52 +0200 |
---|---|---|
committer | Dan Gudmundsson <dgud@erlang.org> | 2020-12-21 11:51:41 +0100 |
commit | 2d41154f6b2cd7413c97af69a45862b472625d5f (patch) | |
tree | 5564d4c151d5ad1280d2a0d97c14bdb9551ade7a /lib/wx/src/gen/wxPopupWindow.erl | |
parent | 31c707f5e8345a0dfb9fa677c76177e8308fcf60 (diff) | |
download | erlang-2d41154f6b2cd7413c97af69a45862b472625d5f.tar.gz |
Rewrite wx, use wxWidgets 3 as base and use nif interface
Complete overhaul of wx.
Use nif interface instead of erlang driver interface.
Use wxWidgets interface files as base for doxygen and code generation.
This upgrades the base to 3.1.4.
Change the interface files so we can generate code that is backward
as compatible as possible.
Compatibility with the old 2.8 API
Reduce incompatibility with the old API as much as possible.
Changes to the old API include:
wxNotebookEvent have been replaced by the wxBookctrlEvent (NOTE)
wxWindowDC default creators have been removed
wxClientDC default creators have been removed
wxPaintDC default creators have been removed
wxWindow:setVirtualSizeHints(..) have been deprecated
wxWindow:makeModal(..) have been deprecated
wxWindow:makeModal(..) have been deprecated
wxToolBar add/insertTool without label have been deprecated
wxStyledTextCtrl some functions have changed args from boolean to int
wxSizerItem:new() Some args have become options
Removed depr wxSizerItem:setWindow() use assignWindow
Removed depr wxSizerItem:setSpacer() use assignSpacer
Removed depr wxSizerItem:setSpacer() use assignSpacer
Removed depr wxSizerItem:setSizer() use assignSizer
wxMenu append/insert/prepend have changed return value and lost IsCheckable argument
wxListCtrl:setItem/4 changed return value
wxListCtrl:setItem/4 changed return value
wxImage::convertToGreyscale opts incompatible
wxGridSizer::wxGridSizer opts incompatible
wxGrid API have many changes
wxGraphicsRenderer:create*GradientBrush(..) uses GradientStops now
wxGraphicsRenderer:createPen(..) have been removed
wxGraphicsRenderer:create*GradientBrush(..) uses GradientStops now
wxGLCanvas API is incompatible
wxFlexGridSizer::wxFlexGridSizer opts incompatible
wxDisplay::wxDisplay opts incompatible
wxCalendarDateAttr:new(ColText [,OptList]) have been removed
wxBitmapButton:[g|s]etBitmapSelected have been removed
Diffstat (limited to 'lib/wx/src/gen/wxPopupWindow.erl')
-rw-r--r-- | lib/wx/src/gen/wxPopupWindow.erl | 133 |
1 files changed, 59 insertions, 74 deletions
diff --git a/lib/wx/src/gen/wxPopupWindow.erl b/lib/wx/src/gen/wxPopupWindow.erl index 142a4ff17c..16c9f99c9b 100644 --- a/lib/wx/src/gen/wxPopupWindow.erl +++ b/lib/wx/src/gen/wxPopupWindow.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2019. All Rights Reserved. +%% Copyright Ericsson AB 2008-2020. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. @@ -38,7 +38,7 @@ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2, destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3, dragAcceptFiles/2,enable/1,enable/2,findWindow/2,fit/1,fitInside/1, - freeze/1,fromDIP/2,getAcceleratorTable/1,getBackgroundColour/1,getBackgroundStyle/1, + freeze/1,getAcceleratorTable/1,getBackgroundColour/1,getBackgroundStyle/1, getBestSize/1,getCaret/1,getCharHeight/1,getCharWidth/1,getChildren/1, getClientSize/1,getContainingSizer/1,getContentScaleFactor/1,getCursor/1, getDPI/1,getDropTarget/1,getEventHandler/1,getExtraStyle/1,getFont/1, @@ -51,25 +51,25 @@ hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isDoubleBuffered/1, isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1, isShownOnScreen/1,isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1, - makeModal/1,makeModal/2,move/2,move/3,move/4,moveAfterInTabOrder/2, - moveBeforeInTabOrder/2,navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1, - popEventHandler/1,popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4, - raise/1,refresh/1,refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1, - removeChild/2,reparent/2,screenToClient/1,screenToClient/2,scrollLines/2, - scrollPages/2,scrollWindow/3,scrollWindow/4,setAcceleratorTable/2, - setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,setCaret/2, - setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2, - setDoubleBuffered/2,setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1, - setFont/2,setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2, + move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2, + navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1, + popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1, + refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2, + reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2, + scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,setAutoLayout/2, + setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2, + setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2, + setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2, + setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2, setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2, setPalette/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6, setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3, setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3, setThemeEnabled/2,setToolTip/2,setTransparent/2,setVirtualSize/2, - setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4, - setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1, - show/1,show/2,thaw/1,toDIP/2,transferDataFromWindow/1,transferDataToWindow/1, - update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]). + setVirtualSize/3,setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2, + shouldInheritColours/1,show/1,show/2,thaw/1,transferDataFromWindow/1, + transferDataToWindow/1,update/1,updateWindowUI/1,updateWindowUI/2, + validate/1,warpPointer/3]). -export_type([wxPopupWindow/0]). %% @hidden @@ -81,8 +81,8 @@ parent_class(_Class) -> erlang:error({badtype, ?MODULE}). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxpopupwindow.html#wxpopupwindowwxpopupwindow">external documentation</a>. -spec new() -> wxPopupWindow(). new() -> - wxe_util:construct(?wxPopupWindow_new_0, - <<>>). + wxe_util:queue_cmd(?get_env(), ?wxPopupWindow_new_0), + wxe_util:rec(?wxPopupWindow_new_0). %% @equiv new(Parent, []) -spec new(Parent) -> wxPopupWindow() when @@ -96,14 +96,14 @@ new(Parent) -spec new(Parent, [Option]) -> wxPopupWindow() when Parent::wxWindow:wxWindow(), Option :: {'flags', integer()}. -new(#wx_ref{type=ParentT,ref=ParentRef}, Options) +new(#wx_ref{type=ParentT}=Parent, Options) when is_list(Options) -> ?CLASS(ParentT,wxWindow), - MOpts = fun({flags, Flags}, Acc) -> [<<1:32/?UI,Flags:32/?UI>>|Acc]; - (BadOpt, _) -> erlang:error({badoption, BadOpt}) end, - BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)), - wxe_util:construct(?wxPopupWindow_new_2, - <<ParentRef:32/?UI, 0:32,BinOpt/binary>>). + MOpts = fun({flags, _flags} = Arg) -> Arg; + (BadOpt) -> erlang:error({badoption, BadOpt}) end, + Opts = lists:map(MOpts, Options), + wxe_util:queue_cmd(Parent, Opts,?get_env(),?wxPopupWindow_new_2), + wxe_util:rec(?wxPopupWindow_new_2). %% @equiv create(This,Parent, []) -spec create(This, Parent) -> boolean() when @@ -117,37 +117,32 @@ create(This,Parent) -spec create(This, Parent, [Option]) -> boolean() when This::wxPopupWindow(), Parent::wxWindow:wxWindow(), Option :: {'flags', integer()}. -create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef}, Options) +create(#wx_ref{type=ThisT}=This,#wx_ref{type=ParentT}=Parent, Options) when is_list(Options) -> ?CLASS(ThisT,wxPopupWindow), ?CLASS(ParentT,wxWindow), - MOpts = fun({flags, Flags}, Acc) -> [<<1:32/?UI,Flags:32/?UI>>|Acc]; - (BadOpt, _) -> erlang:error({badoption, BadOpt}) end, - BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)), - wxe_util:call(?wxPopupWindow_Create, - <<ThisRef:32/?UI,ParentRef:32/?UI, BinOpt/binary>>). + MOpts = fun({flags, _flags} = Arg) -> Arg; + (BadOpt) -> erlang:error({badoption, BadOpt}) end, + Opts = lists:map(MOpts, Options), + wxe_util:queue_cmd(This,Parent, Opts,?get_env(),?wxPopupWindow_Create), + wxe_util:rec(?wxPopupWindow_Create). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxpopupwindow.html#wxpopupwindowposition">external documentation</a>. --spec position(This, PtOrigin, Size) -> 'ok' when - This::wxPopupWindow(), PtOrigin::{X::integer(), Y::integer()}, Size::{W::integer(), H::integer()}. -position(#wx_ref{type=ThisT,ref=ThisRef},{PtOriginX,PtOriginY},{SizeW,SizeH}) - when is_integer(PtOriginX),is_integer(PtOriginY),is_integer(SizeW),is_integer(SizeH) -> +-spec position(This, PtOrigin, SizePopup) -> 'ok' when + This::wxPopupWindow(), PtOrigin::{X::integer(), Y::integer()}, SizePopup::{W::integer(), H::integer()}. +position(#wx_ref{type=ThisT}=This,{PtOriginX,PtOriginY} = PtOrigin,{SizePopupW,SizePopupH} = SizePopup) + when is_integer(PtOriginX),is_integer(PtOriginY),is_integer(SizePopupW),is_integer(SizePopupH) -> ?CLASS(ThisT,wxPopupWindow), - wxe_util:cast(?wxPopupWindow_Position, - <<ThisRef:32/?UI,PtOriginX:32/?UI,PtOriginY:32/?UI,SizeW:32/?UI,SizeH:32/?UI>>). + wxe_util:queue_cmd(This,PtOrigin,SizePopup,?get_env(),?wxPopupWindow_Position). %% @doc Destroys this object, do not use object again -spec destroy(This::wxPopupWindow()) -> 'ok'. destroy(Obj=#wx_ref{type=Type}) -> ?CLASS(Type,wxPopupWindow), - wxe_util:destroy(?DESTROY_OBJECT,Obj), + wxe_util:queue_cmd(Obj, ?get_env(), ?DESTROY_OBJECT), ok. %% From wxWindow %% @hidden -toDIP(This,Sz) -> wxWindow:toDIP(This,Sz). -%% @hidden -fromDIP(This,Sz) -> wxWindow:fromDIP(This,Sz). -%% @hidden getDPI(This) -> wxWindow:getDPI(This). %% @hidden getContentScaleFactor(This) -> wxWindow:getContentScaleFactor(This). @@ -188,19 +183,13 @@ setWindowStyleFlag(This,Style) -> wxWindow:setWindowStyleFlag(This,Style). %% @hidden setWindowStyle(This,Style) -> wxWindow:setWindowStyle(This,Style). %% @hidden -setVirtualSizeHints(This,MinW,MinH, Options) -> wxWindow:setVirtualSizeHints(This,MinW,MinH, Options). -%% @hidden -setVirtualSizeHints(This,MinW,MinH) -> wxWindow:setVirtualSizeHints(This,MinW,MinH). -%% @hidden -setVirtualSizeHints(This,MinSize) -> wxWindow:setVirtualSizeHints(This,MinSize). -%% @hidden -setVirtualSize(This,X,Y) -> wxWindow:setVirtualSize(This,X,Y). +setVirtualSize(This,Width,Height) -> wxWindow:setVirtualSize(This,Width,Height). %% @hidden setVirtualSize(This,Size) -> wxWindow:setVirtualSize(This,Size). %% @hidden -setToolTip(This,Tip) -> wxWindow:setToolTip(This,Tip). +setToolTip(This,TipString) -> wxWindow:setToolTip(This,TipString). %% @hidden -setThemeEnabled(This,EnableTheme) -> wxWindow:setThemeEnabled(This,EnableTheme). +setThemeEnabled(This,Enable) -> wxWindow:setThemeEnabled(This,Enable). %% @hidden setSizerAndFit(This,Sizer, Options) -> wxWindow:setSizerAndFit(This,Sizer, Options). %% @hidden @@ -224,13 +213,13 @@ setSize(This,Width,Height) -> wxWindow:setSize(This,Width,Height). %% @hidden setSize(This,Rect) -> wxWindow:setSize(This,Rect). %% @hidden -setScrollPos(This,Orient,Pos, Options) -> wxWindow:setScrollPos(This,Orient,Pos, Options). +setScrollPos(This,Orientation,Pos, Options) -> wxWindow:setScrollPos(This,Orientation,Pos, Options). %% @hidden -setScrollPos(This,Orient,Pos) -> wxWindow:setScrollPos(This,Orient,Pos). +setScrollPos(This,Orientation,Pos) -> wxWindow:setScrollPos(This,Orientation,Pos). %% @hidden -setScrollbar(This,Orient,Pos,ThumbVisible,Range, Options) -> wxWindow:setScrollbar(This,Orient,Pos,ThumbVisible,Range, Options). +setScrollbar(This,Orientation,Position,ThumbSize,Range, Options) -> wxWindow:setScrollbar(This,Orientation,Position,ThumbSize,Range, Options). %% @hidden -setScrollbar(This,Orient,Pos,ThumbVisible,Range) -> wxWindow:setScrollbar(This,Orient,Pos,ThumbVisible,Range). +setScrollbar(This,Orientation,Position,ThumbSize,Range) -> wxWindow:setScrollbar(This,Orientation,Position,ThumbSize,Range). %% @hidden setPalette(This,Pal) -> wxWindow:setPalette(This,Pal). %% @hidden @@ -240,7 +229,7 @@ setLabel(This,Label) -> wxWindow:setLabel(This,Label). %% @hidden setId(This,Winid) -> wxWindow:setId(This,Winid). %% @hidden -setHelpText(This,Text) -> wxWindow:setHelpText(This,Text). +setHelpText(This,HelpText) -> wxWindow:setHelpText(This,HelpText). %% @hidden setForegroundColour(This,Colour) -> wxWindow:setForegroundColour(This,Colour). %% @hidden @@ -252,7 +241,7 @@ setFocus(This) -> wxWindow:setFocus(This). %% @hidden setExtraStyle(This,ExStyle) -> wxWindow:setExtraStyle(This,ExStyle). %% @hidden -setDropTarget(This,DropTarget) -> wxWindow:setDropTarget(This,DropTarget). +setDropTarget(This,Target) -> wxWindow:setDropTarget(This,Target). %% @hidden setOwnForegroundColour(This,Colour) -> wxWindow:setOwnForegroundColour(This,Colour). %% @hidden @@ -260,9 +249,9 @@ setOwnFont(This,Font) -> wxWindow:setOwnFont(This,Font). %% @hidden setOwnBackgroundColour(This,Colour) -> wxWindow:setOwnBackgroundColour(This,Colour). %% @hidden -setMinSize(This,MinSize) -> wxWindow:setMinSize(This,MinSize). +setMinSize(This,Size) -> wxWindow:setMinSize(This,Size). %% @hidden -setMaxSize(This,MaxSize) -> wxWindow:setMaxSize(This,MaxSize). +setMaxSize(This,Size) -> wxWindow:setMaxSize(This,Size). %% @hidden setCursor(This,Cursor) -> wxWindow:setCursor(This,Cursor). %% @hidden @@ -338,10 +327,6 @@ move(This,X,Y) -> wxWindow:move(This,X,Y). %% @hidden move(This,Pt) -> wxWindow:move(This,Pt). %% @hidden -makeModal(This, Options) -> wxWindow:makeModal(This, Options). -%% @hidden -makeModal(This) -> wxWindow:makeModal(This). -%% @hidden lower(This) -> wxWindow:lower(This). %% @hidden lineUp(This) -> wxWindow:lineUp(This). @@ -398,11 +383,11 @@ getSizer(This) -> wxWindow:getSizer(This). %% @hidden getSize(This) -> wxWindow:getSize(This). %% @hidden -getScrollThumb(This,Orient) -> wxWindow:getScrollThumb(This,Orient). +getScrollThumb(This,Orientation) -> wxWindow:getScrollThumb(This,Orientation). %% @hidden -getScrollRange(This,Orient) -> wxWindow:getScrollRange(This,Orient). +getScrollRange(This,Orientation) -> wxWindow:getScrollRange(This,Orientation). %% @hidden -getScrollPos(This,Orient) -> wxWindow:getScrollPos(This,Orient). +getScrollPos(This,Orientation) -> wxWindow:getScrollPos(This,Orientation). %% @hidden getScreenRect(This) -> wxWindow:getScreenRect(This). %% @hidden @@ -468,7 +453,7 @@ fitInside(This) -> wxWindow:fitInside(This). %% @hidden fit(This) -> wxWindow:fit(This). %% @hidden -findWindow(This,Winid) -> wxWindow:findWindow(This,Winid). +findWindow(This,Id) -> wxWindow:findWindow(This,Id). %% @hidden enable(This, Options) -> wxWindow:enable(This, Options). %% @hidden @@ -494,22 +479,22 @@ clientToScreen(This,Pt) -> wxWindow:clientToScreen(This,Pt). %% @hidden clearBackground(This) -> wxWindow:clearBackground(This). %% @hidden -centreOnParent(This, Options) -> wxWindow:centreOnParent(This, Options). -%% @hidden -centreOnParent(This) -> wxWindow:centreOnParent(This). -%% @hidden -centre(This, Options) -> wxWindow:centre(This, Options). -%% @hidden -centre(This) -> wxWindow:centre(This). -%% @hidden centerOnParent(This, Options) -> wxWindow:centerOnParent(This, Options). %% @hidden +centreOnParent(This, Options) -> wxWindow:centreOnParent(This, Options). +%% @hidden centerOnParent(This) -> wxWindow:centerOnParent(This). %% @hidden +centreOnParent(This) -> wxWindow:centreOnParent(This). +%% @hidden center(This, Options) -> wxWindow:center(This, Options). %% @hidden +centre(This, Options) -> wxWindow:centre(This, Options). +%% @hidden center(This) -> wxWindow:center(This). %% @hidden +centre(This) -> wxWindow:centre(This). +%% @hidden captureMouse(This) -> wxWindow:captureMouse(This). %% @hidden cacheBestSize(This,Size) -> wxWindow:cacheBestSize(This,Size). |