AeIconFieldUI.c++
2.17 KB
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
#include <assert.h>
#include <Vk/VkApp.h>
#include "AeTypes.h"
#include "AeAsset.h"
#include "AeAssetBase.h"
#include "AeFieldUI.h"
#include "AeAssetUI.h"
#include "AeAssetBinUI.h"
#include "AeBinEditor.h"
#include "AeBinView.h"
#include "AePlayer.h"
AeIconFieldUI::AeIconFieldUI (const char * name,
Boolean isSelectable,
Boolean isCommon,
TJustify justify) :
AeFieldUI (name, False, isSelectable, False, isCommon, justify, 0)
{
fWidth = kMinWidth; // enough room to fit a standard icon size
fNeedsWidthUpdate = False; // should never change since icons are uneditable
}
AeIconFieldUI::~AeIconFieldUI (void)
{
}
void
AeIconFieldUI::GetValueString (AeAsset * asset, String string)
{
*string = '\0';
}
void
AeIconFieldUI::HandleDoubleClick (AeBinEditor * editor,
AeAssetUI * assetUI,
XEvent * event,
TEditModifier modifier)
{
assert (editor);
assert (assetUI);
AePlayer * player = editor->GetPlayer ();
// if the asset is not the currently displayed bin in form,
// then tell the form to make it the current displayed bin.
if (assetUI->GetLevel () != 0)
editor->SelectTypedBinUI (assetUI->GetType ());
// if we can put the asset on and offline, then toggle
// its online state
if ((assetUI->GetAsset())->CanOnline ())
{
(assetUI->GetAsset())->ToggleOnline ();
(editor->GetAssetBase())->NotifySuspend ();
(editor->GetAssetBase())->NotifyOnline (assetUI->GetAsset());
(editor->GetAssetBase())->NotifyResume ();
}
#ifdef NOT_SUPPORTED
else
editor->OpenEditor (assetUI->GetAsset ());
#endif
}
Boolean
AeIconFieldUI::HandleButtonPress (AeBinEditor * editor,
AeAssetUI * assetUI,
XEvent * event,
TEditModifier modifier)
{
assert (editor);
assert (assetUI);
AePlayer * player = editor->GetPlayer ();
if (player)
{
// start the audition on a button down
if (modifier == kModDown)
player->AuditionStart (assetUI->GetAsset ());
// stop the audition if the user moves or releases the mouse
else if (modifier == kModUp || modifier == kModMotion)
player->AuditionStop ();
}
editor->SelectAssetUI (assetUI, modifier);
return True;
}