00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "pent_include.h"
00020 #include "ModalGump.h"
00021
00022 #include "Kernel.h"
00023 #include "GUIApp.h"
00024
00025 #include "IDataSource.h"
00026 #include "ODataSource.h"
00027 #include "AudioProcess.h"
00028
00029 DEFINE_RUNTIME_CLASSTYPE_CODE(ModalGump,Gump);
00030
00031 ModalGump::ModalGump() : Gump()
00032 {
00033
00034 }
00035
00036
00037 ModalGump::ModalGump(int x, int y, int width, int height, uint16 owner,
00038 uint32 _Flags, sint32 layer)
00039 : Gump(x, y, width, height, owner, _Flags, layer)
00040 {
00041
00042 }
00043
00044 ModalGump::~ModalGump()
00045 {
00046 }
00047
00048 void ModalGump::InitGump(Gump* newparent, bool take_focus)
00049 {
00050 Gump::InitGump(newparent, take_focus);
00051
00052
00053 GUIApp::get_instance()->enterTextMode(this);
00054
00055 Kernel::get_instance()->pause();
00056
00057 AudioProcess *ap = AudioProcess::get_instance();
00058 if (ap) ap->pauseAllSamples();
00059 }
00060
00061 Gump* ModalGump::FindGump(int mx, int my)
00062 {
00063 Gump* ret = Gump::FindGump(mx, my);
00064 if (!ret) ret = this;
00065
00066 return ret;
00067 }
00068
00069 bool ModalGump::PointOnGump(int mx, int my)
00070 {
00071 return true;
00072 }
00073
00074 uint16 ModalGump::TraceObjId(int mx, int my)
00075 {
00076 uint16 objid = Gump::TraceObjId(mx, my);
00077 if (!objid) objid = getObjId();
00078
00079 return objid;
00080 }
00081
00082 void ModalGump::Close(bool no_del)
00083 {
00084
00085 GUIApp::get_instance()->leaveTextMode(this);
00086
00087 Kernel::get_instance()->unpause();
00088
00089 AudioProcess *ap = AudioProcess::get_instance();
00090 if (ap) ap->unpauseAllSamples();
00091
00092 Gump::Close(no_del);
00093 }
00094
00095 Gump* ModalGump::OnMouseDown(int button, int mx, int my)
00096 {
00097 Gump* handled = Gump::OnMouseDown(button, mx, my);
00098 if (!handled) handled = this;
00099 return handled;
00100 }
00101
00102
00103 void ModalGump::saveData(ODataSource* ods)
00104 {
00105 CANT_HAPPEN_MSG("Trying to save ModalGump");
00106 }
00107
00108 bool ModalGump::loadData(IDataSource* ids, uint32 version)
00109 {
00110 CANT_HAPPEN_MSG("Trying to load ModalGump");
00111 return false;
00112 }