From 097cc3f6679a7c3769111cdb15a630186218d015 Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Wed, 5 Oct 2016 16:25:59 +0200 Subject: Fix guard test for chardata Previously only accepted lists tough a call is made to unicode:characters_to_binary/1, and the functions where specified to handle chardata. --- lib/wx/src/gen/wxComboBox.erl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/wx/src/gen/wxComboBox.erl') diff --git a/lib/wx/src/gen/wxComboBox.erl b/lib/wx/src/gen/wxComboBox.erl index 1f6e975cd7..3de2721f38 100644 --- a/lib/wx/src/gen/wxComboBox.erl +++ b/lib/wx/src/gen/wxComboBox.erl @@ -130,7 +130,7 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id, Options) This::wxComboBox(), Parent::wxWindow:wxWindow(), Id::integer(), Value::unicode:chardata(), Pos::{X::integer(), Y::integer()}, Size::{W::integer(), H::integer()}, Choices::[unicode:chardata()]. create(This,Parent,Id,Value,Pos={PosX,PosY},Size={SizeW,SizeH},Choices) - when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id),is_list(Value),is_integer(PosX),is_integer(PosY),is_integer(SizeW),is_integer(SizeH),is_list(Choices) -> + when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id),?is_chardata(Value),is_integer(PosX),is_integer(PosY),is_integer(SizeW),is_integer(SizeH),is_list(Choices) -> create(This,Parent,Id,Value,Pos,Size,Choices, []). %% @doc See external documentation. @@ -139,7 +139,7 @@ create(This,Parent,Id,Value,Pos={PosX,PosY},Size={SizeW,SizeH},Choices) Option :: {'style', integer()} | {'validator', wx:wx_object()}. create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,Value,{PosX,PosY},{SizeW,SizeH},Choices, Options) - when is_integer(Id),is_list(Value),is_integer(PosX),is_integer(PosY),is_integer(SizeW),is_integer(SizeH),is_list(Choices),is_list(Options) -> + when is_integer(Id),?is_chardata(Value),is_integer(PosX),is_integer(PosY),is_integer(SizeW),is_integer(SizeH),is_list(Choices),is_list(Options) -> ?CLASS(ThisT,wxComboBox), ?CLASS(ParentT,wxWindow), Value_UC = unicode:characters_to_binary([Value,0]), @@ -252,7 +252,7 @@ redo(#wx_ref{type=ThisT,ref=ThisRef}) -> -spec replace(This, From, To, Value) -> 'ok' when This::wxComboBox(), From::integer(), To::integer(), Value::unicode:chardata(). replace(#wx_ref{type=ThisT,ref=ThisRef},From,To,Value) - when is_integer(From),is_integer(To),is_list(Value) -> + when is_integer(From),is_integer(To),?is_chardata(Value) -> ?CLASS(ThisT,wxComboBox), Value_UC = unicode:characters_to_binary([Value,0]), wxe_util:cast(?wxComboBox_Replace, @@ -306,7 +306,7 @@ setSelection(#wx_ref{type=ThisT,ref=ThisRef},From,To) -spec setValue(This, Value) -> 'ok' when This::wxComboBox(), Value::unicode:chardata(). setValue(#wx_ref{type=ThisT,ref=ThisRef},Value) - when is_list(Value) -> + when ?is_chardata(Value) -> ?CLASS(ThisT,wxComboBox), Value_UC = unicode:characters_to_binary([Value,0]), wxe_util:cast(?wxComboBox_SetValue, -- cgit v1.2.3