From e28f2b94964c75eaea74e860a413532ebdcacc4b Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Fri, 24 Feb 2012 12:25:19 +0100 Subject: [wx] Add wxTaskBarIcon class --- lib/wx/src/gen/wxTaskBarIcon.erl | 102 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 lib/wx/src/gen/wxTaskBarIcon.erl (limited to 'lib/wx/src/gen/wxTaskBarIcon.erl') diff --git a/lib/wx/src/gen/wxTaskBarIcon.erl b/lib/wx/src/gen/wxTaskBarIcon.erl new file mode 100644 index 0000000000..5ca2c91b16 --- /dev/null +++ b/lib/wx/src/gen/wxTaskBarIcon.erl @@ -0,0 +1,102 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2008-2012. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% This file is generated DO NOT EDIT + +%% @doc See external documentation: wxTaskBarIcon. +%%

This class is derived (and can use functions) from: +%%
{@link wxEvtHandler} +%%

+%% @type wxTaskBarIcon(). An object reference, The representation is internal +%% and can be changed without notice. It can't be used for comparsion +%% stored on disc or distributed for use on other nodes. + +-module(wxTaskBarIcon). +-include("wxe.hrl"). +-export([destroy/1,new/0,popupMenu/2,removeIcon/1,setIcon/2,setIcon/3]). + +%% inherited exports +-export([connect/2,connect/3,disconnect/1,disconnect/2,disconnect/3,parent_class/1]). + +-export_type([wxTaskBarIcon/0]). +%% @hidden +parent_class(wxEvtHandler) -> true; +parent_class(_Class) -> erlang:error({badtype, ?MODULE}). + +-type wxTaskBarIcon() :: wx:wx_object(). +%% @doc See external documentation. +-spec new() -> wxTaskBarIcon(). +new() -> + wxe_util:construct(?wxTaskBarIcon_new, + <<>>). + +%% @doc See external documentation. +-spec popupMenu(This, Menu) -> boolean() when + This::wxTaskBarIcon(), Menu::wxMenu:wxMenu(). +popupMenu(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=MenuT,ref=MenuRef}) -> + ?CLASS(ThisT,wxTaskBarIcon), + ?CLASS(MenuT,wxMenu), + wxe_util:call(?wxTaskBarIcon_PopupMenu, + <>). + +%% @doc See external documentation. +-spec removeIcon(This) -> boolean() when + This::wxTaskBarIcon(). +removeIcon(#wx_ref{type=ThisT,ref=ThisRef}) -> + ?CLASS(ThisT,wxTaskBarIcon), + wxe_util:call(?wxTaskBarIcon_RemoveIcon, + <>). + +%% @equiv setIcon(This,Icon, []) +-spec setIcon(This, Icon) -> boolean() when + This::wxTaskBarIcon(), Icon::wxIcon:wxIcon(). + +setIcon(This,Icon) + when is_record(This, wx_ref),is_record(Icon, wx_ref) -> + setIcon(This,Icon, []). + +%% @doc See external documentation. +-spec setIcon(This, Icon, [Option]) -> boolean() when + This::wxTaskBarIcon(), Icon::wxIcon:wxIcon(), + Option :: {tooltip, unicode:chardata()}. +setIcon(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=IconT,ref=IconRef}, Options) + when is_list(Options) -> + ?CLASS(ThisT,wxTaskBarIcon), + ?CLASS(IconT,wxIcon), + MOpts = fun({tooltip, Tooltip}, Acc) -> Tooltip_UC = unicode:characters_to_binary([Tooltip,0]),[<<1:32/?UI,(byte_size(Tooltip_UC)):32/?UI,(Tooltip_UC)/binary, 0:(((8- ((0+byte_size(Tooltip_UC)) band 16#7)) band 16#7))/unit:8>>|Acc]; + (BadOpt, _) -> erlang:error({badoption, BadOpt}) end, + BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)), + wxe_util:call(?wxTaskBarIcon_SetIcon, + <>). + +%% @doc Destroys this object, do not use object again +-spec destroy(This::wxTaskBarIcon()) -> ok. +destroy(Obj=#wx_ref{type=Type}) -> + ?CLASS(Type,wxTaskBarIcon), + wxe_util:destroy(?DESTROY_OBJECT,Obj), + ok. + %% From wxEvtHandler +%% @hidden +disconnect(This,EventType, Options) -> wxEvtHandler:disconnect(This,EventType, Options). +%% @hidden +disconnect(This,EventType) -> wxEvtHandler:disconnect(This,EventType). +%% @hidden +disconnect(This) -> wxEvtHandler:disconnect(This). +%% @hidden +connect(This,EventType, Options) -> wxEvtHandler:connect(This,EventType, Options). +%% @hidden +connect(This,EventType) -> wxEvtHandler:connect(This,EventType). -- cgit v1.2.3