1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112 | % /\ ) ( | |\/| /\ |\ | /\ /¯_ |_¯ |¯\
%\ W X /¯¯\ \_/ | | | /¯¯\ | \| /¯¯\ \_/ |__ |¯\ . E R L
%%———————————————————————————————————————————————————————————
%%
%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
%%
%%——————————————————————————————————————————————
%% Whitespace Beautified by ScriptCulture © 2018
%% Sit Back · Feet Up · Learn wxErlang
%% For use as a reference only
%% www.scriptculture.com
%% Not check-summed
%% wx 1.8 ——————————————————————————————————————
%%
%% Licensed under the Apache License,
%% Version 2.0 (the "License"); you may
%% not use this file except in compliance
%% with the License. You may obtain a copy
%% of the License at:
%%
%% http://www.apache.org/licenses/LICENSE-2.0
%%
%% Unless required by
%% applicable law or agreed to in writing, software
%% distributed under the License is distributed
%% on an "AS IS" BASIS, WITHOUT WARRANTIES
%% OR CONDITIONS OF ANY KIND, either
%% express or implied. See the
%% License for the specific
%% language governing
%% permissions and
%% limitations
%% under the
%% License.
%%%%%%%
%%%%
%%%%%
%% @doc See external documentation: <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxauimanager.html">wxAuiManager</a>.
%% <p>This class is derived (and can use functions) from:
%% <br />{@link wxEvtHandler}
%% </p>
%% @type wxAuiManager().
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% |
%% wxAUI OVERVIEW | - this is an overview of the entire AUI control.
%% ————————————————————
%%
%% Class: wxAuiManager, wxAuiPaneInfo
%%
%% wxAUI stands for Advanced User Interface and the wxAUI framework aims to give
%% its user a cutting edge interface for use with the wxWidgets based applications.
%% The original wxAUI sources have kindly been made available under the
%% wxWindows licence by Kirix Corp...and they have since then been
%% integrated into wxWidgets CVS and further improved.
%%
%% wxAUI attempts to encapsulate the following aspects of the user interface:
%%
%% Frame Management:
%% Frame management provides the means to open, move and hide common
%% controls that are needed to interact with the document, and allow
%% these configurations to be saved into different
%% perspectives and loaded at a later time.
%%
%% Toolbars:
%% Toolbars are a specialized subset of the frame management system and
%% should behave similarly to other docked components.
%% However, they also require additional functionality,
%% such as "spring-loaded" rebar support,
%% "chevron" buttons and end-user customizability.
%%
%% Modeless Controls:
%% Modeless controls expose a tool palette or set of options
%% that float above the application content while
%% allowing it to be accessed. Usually accessed by the toolbar,
%% these controls disappear when an option is selected,
%% but may also be "torn off" the toolbar
%% into a floating frame of their own.
%%
%% Look and Feel: Look and feel encompasses the way controls are drawn,
%% both when shown statically as well as when they are being moved.
%% This aspect of user interface design incorporates "special effects"
%% such as transparent window dragging as well as frame animation.
%%
%% wxAUI adheres to the following principles:
%%
%% Use native floating frames to obtain a native look and
%% feel for all platforms. Use existing wxWidgets code where possible,
%% such as sizer implementation for frame management.
%% Use classes included in wxCore and wxBase only.
%% Use standard wxWidgets coding conventions.
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% OVERVIEW
%% ––––––––
%% wxAuiManager is the central class of the wxAUI class framework.
%%
%% See also wxAUI overview.
%%
%% wxAuiManager manages the panes associated with it for a particular wxFrame,
%% using a pane's wxAuiPaneInfo information to determine
%% each pane's docking and floating behavior.
%%
%% wxAuiManager uses wxWidgets' sizer mechanism to plan the layout of each frame.
%% It uses a replaceable dock art class to do all drawing, so all drawing is
%% localized in one area, and may be customized depending on an
%% application's specific needs.
%%
%% wxAuiManager works as follows:
%% ·the programmer adds panes to the class,
%% or makes changes to existing pane properties
%% (dock position, floating state, show state, etc.).
%% ·To apply these changes, wxAuiManager's Update() function is called.
%% ·This batch processing can be used to avoid flicker,
%% by modifying more than one pane at a time,
%% and then "committing" all of the changes at once by calling Update().
%%
%% Panes can be added quite easily:
%%
%% wxTextCtrl* text1 = new wxTextCtrl(this, -1);
%% wxTextCtrl* text2 = new wxTextCtrl(this, -1);
%% m_mgr.AddPane(text1, wxLEFT, wxT("Pane Caption"));
%% m_mgr.AddPane(text2, wxBOTTOM, wxT("Pane Caption"));
%% m_mgr.Update();
%%
%% Later on, the positions can be modified easily.
%% The following will float an existing pane in a tool window:
%%
%% m_mgr.GetPane(text1).Float();
%%
%%
%% LAYERS, ROWS AND DIRECTIONS, POSITIONS
%%
%% Inside wxAUI, the docking layout is figured out by
%% checking several pane parameters.
%% Four of these are important for
%% determining where a pane will end up:
%%
%% Direction: Each docked pane has a direction,
%% Top, Bottom, Left, Right, or Center.
%% This is fairly self-explanatory. The pane will be placed in the
%% location specified by this variable.
%%
%% Position: More than one pane can be placed inside of a dock.
%% Imagine two panes being docked on the left side of a window.
%% One pane can be placed over another.
%% In proportionally managed docks,
%% the pane position indicates its sequential position,
%% starting with zero. So, in our scenario with two panes docked
%% on the left side, the top pane in the dock would
%% have position 0, and the second one would occupy position 1.
%%
%% Row: A row can allow for two docks to be placed next to each other.
%% One of the most common places for this to happen is in the toolbar.
%% Multiple toolbar rows are allowed, the first row being row 0,
%% and the second row 1. Rows can also be used on vertically docked panes.
%%
%% Layer: A layer is akin to an onion. Layer 0 is the very center of the
%% managed pane. Thus, if a pane is in layer 0, it will be closest to
%% the center window (also sometimes known as the "content window").
%% Increasing layers "swallow up" all layers of a lower value.
%% This can look very similar to multiple rows, but is different because
%% all panes in a lower level yield to panes in higher levels.
%% The best way to understand layers is by running the wxAUI sample.
%%
%%
%% See Also:
%% —————————
%% wxAuiPaneInfo,
%% wxAuiDockArt
%%
%%
%% DATA STRUCTURES - FLAGS AND SUCH
%%
%% enum wxAuiManagerDock
%% {
%% wxAUI_DOCK_NONE = 0 ,
%% wxAUI_DOCK_TOP = 1 ,
%% wxAUI_DOCK_RIGHT = 2 ,
%% wxAUI_DOCK_BOTTOM = 3 ,
%% wxAUI_DOCK_LEFT = 4 ,
%% wxAUI_DOCK_CENTER = 5 ,
%% wxAUI_DOCK_CENTRE = wxAUI_DOCK_CENTER
%% }
%%
%%
%% ENUM WXAUIMANAGEROPTION - STYLES
%%______________________________________
%%
%% wxAUI_MGR_ALLOW_FLOATING = 1 << 0,
%% Allow a pane to be undocked to take the form of a wxMiniFrame.
%%
%% wxAUI_MGR_ALLOW_ACTIVE_PANE = 1 << 1,
%% Change the color of the title bar of the pane when it is activated.
%%
%% wxAUI_MGR_TRANSPARENT_DRAG = 1 << 2,
%% Make the pane transparent during its movement.
%%
%% wxAUI_MGR_TRANSPARENT_HINT = 1 << 3,
%% The possible location for docking is indicated by a translucent area.
%%
%% wxAUI_MGR_VENETIAN_BLINDS_HINT = 1 << 4,
%% The possible location for docking is indicated by
%% gradually appearing partially transparent hint.
%%
%% wxAUI_MGR_RECTANGLE_HINT = 1 << 5,
%% The possible location for docking is indicated by a rectangular outline.
%%
%% wxAUI_MGR_HINT_FADE = 1 << 6,
%% The translucent area where the pane could be docked appears gradually.
%%
%% wxAUI_MGR_NO_VENETIAN_BLINDS_FADE = 1 << 7,
%% Used in complement of wxAUI_MGR_VENETIAN_BLINDS_HINT to show
%% the docking hint immediately.
%%
%% wxAUI_MGR_LIVE_RESIZE = 1 << 8,
%% When a docked pane is resized, its content is refreshed in live (instead of moving the border alone and refreshing the content at the end).
%%
%% wxAUI_MGR_DEFAULT
%% Default behavior, combines: wxAUI_MGR_ALLOW_FLOATING
%% | wxAUI_MGR_TRANSPARENT_HINT
%% | wxAUI_MGR_HINT_FADE
%% | wxAUI_MGR_NO_VENETIAN_BLINDS_FADE.
%%
%%
%% EVENTS EMITTED BY THIS CLASS
%%
%% The following event handler macros redirect the events to member
%% function handlers 'func' with prototypes like:
%% void handlerFuncName(wxAuiManagerEvent& event)
%%
%% Event macros for events emitted by this class:
%%
%% EVT_AUI_PANE_BUTTON(func):
%% Triggered when any button is pressed for any docked panes.
%%
%% EVT_AUI_PANE_CLOSE(func):
%% Triggered when a docked or floating pane is closed.
%%
%% EVT_AUI_PANE_MAXIMIZE(func):
%% Triggered when a pane is maximized.
%%
%% EVT_AUI_PANE_RESTORE(func):
%% Triggered when a pane is restored.
%%
%% EVT_AUI_PANE_ACTIVATED(func):
%% Triggered when a pane is made 'active'. This event is new since wxWidgets 2.9.4.
%%
%% EVT_AUI_RENDER(func):
%% This event can be caught to override the default renderer in order to
%% custom draw your wxAuiManager window (not recommended).
-module(wxAuiManager).
-include("wxe.hrl").
-export([
new/0,
new/1,
destroy/1,
addPane/2,
addPane/3,
addPane/4,
detachPane/2,
getAllPanes/1,
getArtProvider/1,
getDockSizeConstraint/1,
getFlags/1,
getManagedWindow/1,
getManager/1,
getPane/2,
hideHint/1,
insertPane/3,
insertPane/4,
loadPaneInfo/3,
loadPerspective/2,
loadPerspective/3,
savePaneInfo/2,
savePerspective/1,
setArtProvider/2,
setDockSizeConstraint/3,
setFlags/2,
setManagedWindow/2,
showHint/2,
unInit/1,
update/1
]).
%% inherited exports
-export([connect/2,connect/3,disconnect/1,disconnect/2,disconnect/3,parent_class/1]).
-export_type([wxAuiManager/0]).
%% @hidden
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-type wxAuiManager() :: wx:wx_object().
%·%% NEW %%·%
%% Constructor.
%%
%% See below...
%% @equiv new([])
-spec new() -> wxAuiManager().
new() ->
new([]).
%% Constructor.
%%
%% managed_wnd specifies the wxFrame which should be managed.
%%
%% flags specifies options which allow the frame management
%% behavior to be modified.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec new([Option]) -> wxAuiManager()
when
Option :: {managed_wnd, wxWindow:wxWindow()}
| {flags, integer()}.
new(Options)
when
is_list(Options) ->
MOpts = fun({managed_wnd, #wx_ref{type=Managed_wndT,ref=Managed_wndRef}}, Acc) -> ?CLASS(Managed_wndT,wxWindow),[<<1:32/?UI,Managed_wndRef:32/?UI>>|Acc];
({flags, Flags}, Acc) -> [<<2: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(?wxAuiManager_new,
<<BinOpt/binary>>).
%·%% ADD PANE / 2 %%·%
%%
%% AddPane() tells the frame manager to start managing a child window.
%% There are several versions of this function.
%%
%% The first version is used for simpler user interfaces
%% which do not require as much configuration.
%%
%% See below...
%% @equiv addPane(This,Window, [])
-spec addPane(This, Window) -> boolean()
when
This :: wxAuiManager(),
Window :: wxWindow:wxWindow().
addPane(This,Window)
when
is_record(This, wx_ref),
is_record(Window, wx_ref) -> addPane(This,Window, []).
%·%% ADD PANE / 3 %%·%
%%
%% The second version allows the full spectrum of pane parameter possibilities.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec addPane(This, Window, [Option]) -> boolean()
when
This :: wxAuiManager(),
Window :: wxWindow:wxWindow(),
Option :: {direction, integer()}
| {caption, unicode:chardata()};
(This, Window, Pane_info) -> boolean()
when
This :: wxAuiManager(),
Window :: wxWindow:wxWindow(),
Pane_info :: wxAuiPaneInfo:wxAuiPaneInfo().
addPane(#wx_ref{type=ThisT,ref=ThisRef},
#wx_ref{type=WindowT,ref=WindowRef},
Options)
when
is_list(Options) ->
?CLASS(ThisT,wxAuiManager),
?CLASS(WindowT,wxWindow),
MOpts = fun({direction, Direction}, Acc) -> [<<1:32/?UI,Direction:32/?UI>>|Acc];
({caption, Caption}, Acc) -> Caption_UC = unicode:characters_to_binary([Caption,0]),[<<2:32/?UI,(byte_size(Caption_UC)):32/?UI,(Caption_UC)/binary,
0:(((8- ((0+byte_size(Caption_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(?wxAuiManager_AddPane_2_0,
<<ThisRef:32/?UI,WindowRef:32/?UI, BinOpt/binary>>);
addPane(#wx_ref{type=ThisT,ref=ThisRef},
#wx_ref{type=WindowT,ref=WindowRef},
#wx_ref{type=Pane_infoT,ref=Pane_infoRef}) ->
?CLASS(ThisT,wxAuiManager),
?CLASS(WindowT,wxWindow),
?CLASS(Pane_infoT,wxAuiPaneInfo),
wxe_util:call(?wxAuiManager_AddPane_2_1,
<<ThisRef:32/?UI,WindowRef:32/?UI,Pane_infoRef:32/?UI>>).
%·%% ADD PANE / 4 %%·%
%%
%% The last version allows a drop position to be specified,
%% which will determine where the pane will be added.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec addPane(This, Window, Pane_info, Drop_pos) -> boolean()
when
This :: wxAuiManager(),
Window :: wxWindow:wxWindow(),
Pane_info :: wxAuiPaneInfo:wxAuiPaneInfo(),
Drop_pos :: {X :: integer(),
Y :: integer()}.
addPane(#wx_ref{type=ThisT,ref=ThisRef},
#wx_ref{type=WindowT,ref=WindowRef},
#wx_ref{type=Pane_infoT,ref=Pane_infoRef},
{Drop_posX, Drop_posY})
when
is_integer(Drop_posX),
is_integer(Drop_posY) ->
?CLASS(ThisT,wxAuiManager),
?CLASS(WindowT,wxWindow),
?CLASS(Pane_infoT,wxAuiPaneInfo),
wxe_util:call(?wxAuiManager_AddPane_3,
<<ThisRef:32/?UI,WindowRef:32/?UI,Pane_infoRef:32/?UI,Drop_posX:32/?UI,Drop_posY:32/?UI>>).
%·%% DETACH PANE %%·%
%%
%% Tells the wxAuiManager to stop managing the pane specified by window.
%% The window, if in a floated frame,
%% is reparented to the frame managed by wxAuiManager.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec detachPane(This, Window) -> boolean()
when
This :: wxAuiManager(),
Window :: wxWindow:wxWindow().
detachPane(#wx_ref{type=ThisT,ref=ThisRef},
#wx_ref{type=WindowT,ref=WindowRef}) ->
?CLASS(ThisT,wxAuiManager),
?CLASS(WindowT,wxWindow),
wxe_util:call(?wxAuiManager_DetachPane,
<<ThisRef:32/?UI,WindowRef:32/?UI>>).
%·%% GET ALL PANES %%·%
%%
%% Returns an array of all panes managed by the frame manager.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec getAllPanes(This) -> [wxAuiPaneInfo:wxAuiPaneInfo()] when
This :: wxAuiManager().
getAllPanes(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiManager),
wxe_util:call(?wxAuiManager_GetAllPanes,
<<ThisRef:32/?UI>>).
%·%% GET ART PROVIDER %%·%
%%
%% Returns the current art provider being used.
%%
%% Return Value:
%% See Also: wxAuiDockArt.
%%*%%*%%
-spec getArtProvider(This) -> wxAuiDockArt:wxAuiDockArt()
when
This :: wxAuiManager().
getArtProvider(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiManager),
wxe_util:call(?wxAuiManager_GetArtProvider,
<<ThisRef:32/?UI>>).
%·%% GET DOCK SIZE CONSTRAINT %%·%
%%
%% Returns the current dock constraint values.
%% See SetDockSizeConstraint() for more information.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec getDockSizeConstraint(This) -> {Width_pct :: number(), Height_pct :: number()}
when
This :: wxAuiManager().
getDockSizeConstraint(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiManager),
wxe_util:call(?wxAuiManager_GetDockSizeConstraint,
<<ThisRef:32/?UI>>).
%·%% GET FLAGS %%·%
%%
%% Returns the current manager's flags.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec getFlags(This) -> integer()
when
This :: wxAuiManager().
getFlags(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiManager),
wxe_util:call(?wxAuiManager_GetFlags,
<<ThisRef:32/?UI>>).
%·%% GET MANAGED WINDOW %%·%
%%
%% Returns the frame currently being managed by wxAuiManager.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec getManagedWindow(This) -> wxWindow:wxWindow()
when
This :: wxAuiManager().
getManagedWindow(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiManager),
wxe_util:call(?wxAuiManager_GetManagedWindow,
<<ThisRef:32/?UI>>).
%·%% GET MANAGER %%·%
%%
%% Calling this method will return the wxAuiManager for a given window.
%% The window parameter should specify any child window or
%% sub-child window of the frame or window managed by wxAuiManager.
%% The window parameter need not be managed by the manager itself,
%% nor does it even need to be a child or sub-child of a managed window.
%% It must however be inside the window hierarchy underneath the managed window.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec getManager(Window) -> wxAuiManager()
when
Window :: wxWindow:wxWindow().
getManager(#wx_ref{type=WindowT,ref=WindowRef}) ->
?CLASS(WindowT,wxWindow),
wxe_util:call(?wxAuiManager_GetManager,
<<WindowRef:32/?UI>>).
%·%% GET PANE %%·%
%%
%% GetPane is used to lookup a wxAuiPaneInfo object either by
%% window pointer or by pane name, which acts as a unique id
%% for a window pane. The returned wxAuiPaneInfo object may
%% then be modified to change a pane's look, state or position.
%% After one or more modifications to wxAuiPaneInfo, wxAuiManager::Update()
%% should be called to commit the changes to the user interface.
%% If the lookup failed (meaning the pane could not be found in the manager),
%% a call to the returned wxAuiPaneInfo's IsOk() method will return false.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec getPane(This, Name) -> wxAuiPaneInfo:wxAuiPaneInfo()
when
This :: wxAuiManager(),
Name :: unicode:chardata();
(This, Window) -> wxAuiPaneInfo:wxAuiPaneInfo()
when
This :: wxAuiManager(),
Window :: wxWindow:wxWindow().
getPane(#wx_ref{type=ThisT,ref=ThisRef}, Name)
when
is_list(Name) ->
?CLASS(ThisT,wxAuiManager),
Name_UC = unicode:characters_to_binary([Name,0]),
wxe_util:call(?wxAuiManager_GetPane_1_0,
<<ThisRef:32/?UI,(byte_size(Name_UC)):32/?UI,(Name_UC)/binary,
0:(((8- ((0+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8>>);
getPane(#wx_ref{type=ThisT,ref=ThisRef},
#wx_ref{type=WindowT,ref=WindowRef}) ->
?CLASS(ThisT,wxAuiManager),
?CLASS(WindowT,wxWindow),
wxe_util:call(?wxAuiManager_GetPane_1_1,
<<ThisRef:32/?UI,WindowRef:32/?UI>>).
%·%% HIDE HINT %%·%
%%
%% HideHint() hides any docking hint that may be visible.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec hideHint(This) -> ok
when
This :: wxAuiManager().
hideHint(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiManager),
wxe_util:cast(?wxAuiManager_HideHint,
<<ThisRef:32/?UI>>).
%·%% INSERT PANE / 3 %%·%
%%
%% See below...
%% @equiv insertPane(This,Window,Insert_location, [])
-spec insertPane(This, Window, Insert_location) -> boolean()
when
This :: wxAuiManager(),
Window :: wxWindow:wxWindow(),
Insert_location :: wxAuiPaneInfo:wxAuiPaneInfo().
insertPane(This,Window,Insert_location)
when
is_record(This, wx_ref),
is_record(Window, wx_ref),
is_record(Insert_location, wx_ref) -> insertPane(This,Window,Insert_location, []).
%·%% INSERT PANE %%·%
%%
%% This method is used to insert either a previously unmanaged pane
%% window into the frame manager, or to insert a currently managed
%% pane somewhere else. InsertPane will push all panes, rows, or
%% docks aside and insert the window into the position specified by
%% insert_location. Because insert_location can specify either a pane,
%% dock row, or dock layer, the insert_level parameter is used to
%% disambiguate this. The parameter insert_level can take a value
%% of wxAUI_INSERT_PANE, wxAUI_INSERT_ROW or wxAUI_INSERT_DOCK.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec insertPane(This, Window, Insert_location, [Option]) -> boolean()
when
This :: wxAuiManager(),
Window :: wxWindow:wxWindow(),
Insert_location :: wxAuiPaneInfo:wxAuiPaneInfo(),
Option :: {insert_level, integer()}.
insertPane(#wx_ref{type=ThisT,ref=ThisRef},
#wx_ref{type=WindowT,ref=WindowRef},
#wx_ref{type=Insert_locationT,ref=Insert_locationRef},
Options)
when
is_list(Options) ->
?CLASS(ThisT,wxAuiManager),
?CLASS(WindowT,wxWindow),
?CLASS(Insert_locationT,wxAuiPaneInfo),
MOpts = fun({insert_level, Insert_level}, Acc) -> [<<1:32/?UI,Insert_level:32/?UI>>|Acc];
(BadOpt, _) -> erlang:error({badoption, BadOpt})
end,
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
wxe_util:call(?wxAuiManager_InsertPane,
<<ThisRef:32/?UI,WindowRef:32/?UI,Insert_locationRef:32/?UI, 0:32,BinOpt/binary>>).
%·%% LOAD PANE INFO %%·%
%%
%% LoadPaneInfo() is similar to to LoadPerspective, with the exception
%% that it only loads information about a single pane.
%% It is used in combination with SavePaneInfo().
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec loadPaneInfo(This, Pane_part, Pane) -> ok
when
This :: wxAuiManager(),
Pane_part :: unicode:chardata(),
Pane :: wxAuiPaneInfo:wxAuiPaneInfo().
loadPaneInfo(#wx_ref{type=ThisT,ref=ThisRef},
Pane_part,
#wx_ref{type=PaneT,ref=PaneRef})
when
is_list(Pane_part) ->
?CLASS(ThisT,wxAuiManager),
Pane_part_UC = unicode:characters_to_binary([Pane_part,0]),
?CLASS(PaneT,wxAuiPaneInfo),
wxe_util:cast(?wxAuiManager_LoadPaneInfo,
<<ThisRef:32/?UI,(byte_size(Pane_part_UC)):32/?UI,(Pane_part_UC)/binary,
0:(((8- ((0+byte_size(Pane_part_UC)) band 16#7)) band 16#7))/unit:8,PaneRef:32/?UI>>).
%·%% LOAD PERSPECTIVE / 2 %%·%
%%
%% See below...
%% @equiv loadPerspective(This,Perspective, [])
-spec loadPerspective(This, Perspective) -> boolean()
when
This :: wxAuiManager(),
Perspective :: unicode:chardata().
loadPerspective(This,Perspective)
when
is_record(This, wx_ref),
is_list(Perspective) -> loadPerspective(This,Perspective, []).
%·%% LOAD PERSPECTIVE / 3 %%·%
%%
%% Loads a saved perspective.
%% If update is true, wxAuiManager::Update() is automatically invoked,
%% thus realizing the saved perspective on screen.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec loadPerspective(This, Perspective, [Option]) -> boolean()
when
This :: wxAuiManager(),
Perspective :: unicode:chardata(),
Option :: {update, boolean()}.
loadPerspective(#wx_ref{type=ThisT,ref=ThisRef}, Perspective, Options)
when
is_list(Perspective),
is_list(Options) ->
?CLASS(ThisT,wxAuiManager),
Perspective_UC = unicode:characters_to_binary([Perspective,0]),
MOpts = fun({update, Update}, Acc) -> [<<1:32/?UI,(wxe_util:from_bool(Update)):32/?UI>>|Acc];
(BadOpt, _) -> erlang:error({badoption, BadOpt})
end,
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
wxe_util:call(?wxAuiManager_LoadPerspective,
<<ThisRef:32/?UI,(byte_size(Perspective_UC)):32/?UI,(Perspective_UC)/binary,
0:(((8- ((0+byte_size(Perspective_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
%·%% SAVE PANE INFO %%·%
%%
%% SavePaneInfo() is similar to SavePerspective,
%% with the exception that it only saves information about a single pane.
%% It is used in combination with LoadPaneInfo().
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec savePaneInfo(This, Pane) -> unicode:charlist()
when
This :: wxAuiManager(),
Pane :: wxAuiPaneInfo:wxAuiPaneInfo().
savePaneInfo(#wx_ref{type=ThisT,ref=ThisRef},
#wx_ref{type=PaneT,ref=PaneRef}) ->
?CLASS(ThisT,wxAuiManager),
?CLASS(PaneT,wxAuiPaneInfo),
wxe_util:call(?wxAuiManager_SavePaneInfo,
<<ThisRef:32/?UI,PaneRef:32/?UI>>).
%·%% SAVE PERSPECTIVE %%·%
%%
%% Saves the entire user interface layout into an encoded wxString,
%% which can then be stored by the application (probably using wxConfig).
%% When a perspective is restored using LoadPerspective(),
%% the entire user interface will return to the state it
%% was when the perspective was saved.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec savePerspective(This) -> unicode:charlist()
when
This :: wxAuiManager().
savePerspective(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiManager),
wxe_util:call(?wxAuiManager_SavePerspective,
<<ThisRef:32/?UI>>).
%·%% SET ART PROVIDER %%·%
%%
%% Instructs wxAuiManager to use art provider specified by
%% parameter art_provider for all drawing calls.
%% This allows plugable look-and-feel features.
%% The previous art provider object, if any,
%% will be deleted by wxAuiManager.
%%
%% Return Value:
%% See Also: See also: wxAuiDockArt.
%%*%%*%%
-spec setArtProvider(This, Art_provider) -> ok
when
This :: wxAuiManager(),
Art_provider :: wxAuiDockArt:wxAuiDockArt().
setArtProvider(#wx_ref{type=ThisT,ref=ThisRef},
#wx_ref{type=Art_providerT,ref=Art_providerRef}) ->
?CLASS(ThisT,wxAuiManager),
?CLASS(Art_providerT,wxAuiDockArt),
wxe_util:cast(?wxAuiManager_SetArtProvider,
<<ThisRef:32/?UI,Art_providerRef:32/?UI>>).
%·%% SET DOCK SIZE CONSTRAINT %%·%
%%
%% When a user creates a new dock by dragging a window into a
%% docked position, often times the large size of the window will
%% create a dock that is unwieldly large.
%%
%% wxAuiManager by default limits the size of any
%% new dock to 1/3 of the window size. For horizontal docks,
%% this would be 1/3 of the window height.
%% For vertical docks, 1/3 of the width.
%%
%% Calling this function will adjust this constraint value.
%% The numbers must be between 0.0 and 1.0.
%% For instance, calling SetDockSizeContraint with 0.5, 0.5 will
%% cause new docks to be limited to half of the size of the entire
%% managed window.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec setDockSizeConstraint(This, Width_pct, Height_pct) -> ok
when
This :: wxAuiManager(),
Width_pct :: number(),
Height_pct :: number().
setDockSizeConstraint(#wx_ref{type=ThisT,ref=ThisRef}, Width_pct, Height_pct)
when
is_number(Width_pct),
is_number(Height_pct) ->
?CLASS(ThisT,wxAuiManager),
wxe_util:cast(?wxAuiManager_SetDockSizeConstraint,
<<ThisRef:32/?UI,0:32,Width_pct:64/?F,Height_pct:64/?F>>).
%·%% SET FLAGS %%·%
%%
%% This method is used to specify wxAuiManager's settings flags.
%% flags specifies options which allow the frame management
%% behavior to be modified.
%%
%% Return Value:
%% See Also:
%%*%%*%%
"http://www.wxwidgets.org/manuals/2.8.12/wx_wxauimanager.html#wxauimanagersetflags">external documentation</a>.
-spec setFlags(This, Flags) -> ok
when
This :: wxAuiManager(),
Flags :: integer().
setFlags(#wx_ref{type=ThisT,ref=ThisRef}, Flags)
when
is_integer(Flags) ->
?CLASS(ThisT,wxAuiManager),
wxe_util:cast(?wxAuiManager_SetFlags,
<<ThisRef:32/?UI,Flags:32/?UI>>).
%·%% SET MANAGED WINDOW %%·%
%%
%% Called to specify the frame or window which is to be
%% managed by wxAuiManager. Frame management is not restricted
%% to just frames. Child windows or custom controls are also allowed.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec setManagedWindow(This, Managed_wnd) -> ok
when
This :: wxAuiManager(),
Managed_wnd :: wxWindow:wxWindow().
setManagedWindow(#wx_ref{type=ThisT,ref=ThisRef},
#wx_ref{type=Managed_wndT,ref=Managed_wndRef}) ->
?CLASS(ThisT,wxAuiManager),
?CLASS(Managed_wndT,wxWindow),
wxe_util:cast(?wxAuiManager_SetManagedWindow,
<<ThisRef:32/?UI,Managed_wndRef:32/?UI>>).
%·%% SHOW HINT %%·%
%%
%% This function is used by controls to explicitly show a
%% hint window at the specified rectangle.
%%
%% It is rarely called, and is mostly
%% used by controls implementing custom pane drag/drop behaviour.
%% The specified rectangle should be in screen coordinates.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec showHint(This, Rect) -> ok
when
This :: wxAuiManager(),
Rect :: {X :: integer(),
Y :: integer(),
W :: integer(),
H :: integer()}.
showHint(#wx_ref{type=ThisT,ref=ThisRef},
{RectX, RectY, RectW, RectH})
when
is_integer(RectX),
is_integer(RectY),
is_integer(RectW),
is_integer(RectH) ->
?CLASS(ThisT,wxAuiManager),
wxe_util:cast(?wxAuiManager_ShowHint,
<<ThisRef:32/?UI,RectX:32/?UI,RectY:32/?UI,RectW:32/?UI,RectH:32/?UI>>).
%·%% UN INIT %%·%
%%
%% Uninitializes the framework and should be called
%% before a managed frame or window is destroyed.
%%
%% UnInit() is usually called in the managed
%% wxFrame's destructor. It is necessary to call this function before
%% the managed frame or window is destroyed, otherwise the manager
%% cannot remove its custom event handlers from a window.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec unInit(This) -> ok
when
This :: wxAuiManager().
unInit(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiManager),
wxe_util:cast(?wxAuiManager_UnInit,
<<ThisRef:32/?UI>>).
%·%% UPDATE %%·%
%%
%% This method is called after any number of changes are made to any
%% of the managed panes.
%%
%% Update() must be invoked after AddPane() or
%% InsertPane() are called in order to "realize" or "commit" the changes.
%% In addition, any number of changes may be made to wxAuiPaneInfo
%% structures (retrieved with wxAuiManager::GetPane), but to realize
%% the changes, Update() must be called. This construction allows
%% pane flicker to be avoided by updating the whole layout at one time.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec update(This) -> ok
when
This :: wxAuiManager().
update(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiManager),
wxe_util:cast(?wxAuiManager_Update,
<<ThisRef:32/?UI>>).
%·%% DESTROY %%·%
%%
%%
%% @doc Destroys this object, do not use object again
-spec destroy(This :: wxAuiManager()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxAuiManager),
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).
|