LLScriptEdCore Class Reference

#include <llpreviewscript.h>

Inheritance diagram for LLScriptEdCore:

Inheritance graph
[legend]
Collaboration diagram for LLScriptEdCore:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 LLScriptEdCore (const std::string &name, const LLRect &rect, const std::string &sample, const std::string &help, const LLViewHandle &floater_handle, void(*load_callback)(void *userdata), void(*save_callback)(void *userdata, BOOL close_after_save), void(*search_replace_callback)(void *userdata), void *userdata, S32 bottom_pad=0)
 ~LLScriptEdCore ()
void initMenu ()
virtual void draw ()
BOOL canClose ()
void selectFirstError ()
virtual BOOL handleKeyHere (KEY key, MASK mask, BOOL called_from_parent)

Static Public Member Functions

static void handleSaveChangesDialog (S32 option, void *userdata)
static void handleReloadFromServerDialog (S32 option, void *userdata)
static void onHelpWebDialog (S32 option, void *userdata)
static void onBtnHelp (void *userdata)
static void onBtnDynamicHelp (void *userdata)
static void onCheckLock (LLUICtrl *, void *)
static void onHelpComboCommit (LLUICtrl *ctrl, void *userdata)
static void onClickBack (void *userdata)
static void onClickForward (void *userdata)
static void onBtnInsertSample (void *)
static void onBtnInsertFunction (LLUICtrl *, void *)
static void doSave (void *userdata, BOOL close_after_save)
static void onBtnSave (void *)
static void onBtnUndoChanges (void *)
static void onSearchMenu (void *userdata)
static void onUndoMenu (void *userdata)
static void onRedoMenu (void *userdata)
static void onCutMenu (void *userdata)
static void onCopyMenu (void *userdata)
static void onPasteMenu (void *userdata)
static void onSelectAllMenu (void *userdata)
static void onDeselectMenu (void *userdata)
static BOOL enableUndoMenu (void *userdata)
static BOOL enableRedoMenu (void *userdata)
static BOOL enableCutMenu (void *userdata)
static BOOL enableCopyMenu (void *userdata)
static BOOL enablePasteMenu (void *userdata)
static BOOL enableSelectAllMenu (void *userdata)
static BOOL enableDeselectMenu (void *userdata)
static BOOL hasChanged (void *userdata)

Protected Member Functions

void deleteBridges ()
void setHelpPage (const LLString &help_string)
void updateDynamicHelp (BOOL immediate=FALSE)
void addHelpItemToHistory (const LLString &help_string)

Static Protected Member Functions

static void onErrorList (LLUICtrl *, void *user_data)

Private Attributes

LLString mSampleText
std::string mHelpFile
LLTextEditormEditor
void(* mLoadCallback )(void *userdata)
void(* mSaveCallback )(void *userdata, BOOL close_after_save)
void(* mSearchReplaceCallback )(void *userdata)
voidmUserdata
LLComboBoxmFunctions
BOOL mForceClose
LLPanelmCodePanel
LLScrollListCtrlmErrorList
LLDynamicArray< LLEntryAndEdCore * > mBridges
LLViewHandle mLiveHelpHandle
LLKeywordTokenmLastHelpToken
LLFrameTimer mLiveHelpTimer
S32 mLiveHelpHistorySize

Friends

class LLPreviewScript
class LLPreviewLSL
class LLLiveScriptEditor
class LLLiveLSLEditor
class LLFloaterScriptSearch

Detailed Description

Definition at line 56 of file llpreviewscript.h.


Constructor & Destructor Documentation

LLScriptEdCore::LLScriptEdCore ( const std::string &  name,
const LLRect rect,
const std::string &  sample,
const std::string &  help,
const LLViewHandle floater_handle,
void(*)(void *userdata)  load_callback,
void(*)(void *userdata, BOOL close_after_save)  save_callback,
void(*)(void *userdata)  search_replace_callback,
void userdata,
S32  bottom_pad = 0 
)

LLScriptEdCore::~LLScriptEdCore (  ) 

Definition at line 376 of file llpreviewscript.cpp.

References LLFloater::close(), deleteBridges(), LLFloaterScriptSearch::getEditorCore(), and LLFloaterScriptSearch::getInstance().


Member Function Documentation

void LLScriptEdCore::addHelpItemToHistory ( const LLString help_string  )  [protected]

Definition at line 554 of file llpreviewscript.cpp.

References LLComboBox::add(), ADD_TOP, LLComboBox::addElement(), LLUICtrlFactory::getComboBoxByName(), LLComboBox::getCurrentIndex(), LLFloater::getFloaterByHandle(), gUICtrlFactory, MAX_HISTORY_COUNT, mLiveHelpHandle, mLiveHelpHistorySize, LLComboBox::remove(), S32, LLComboBox::selectFirstItem(), and LLComboBox::setSimple().

Referenced by onHelpComboCommit(), and setHelpPage().

BOOL LLScriptEdCore::canClose (  ) 

Definition at line 597 of file llpreviewscript.cpp.

References LLViewerWindow::alertXml(), FALSE, gViewerWindow, handleSaveChangesDialog(), LLTextEditor::isPristine(), mEditor, mForceClose, and TRUE.

Referenced by LLLiveLSLEditor::canClose(), and LLPreviewLSL::canClose().

void LLScriptEdCore::deleteBridges (  )  [protected]

Definition at line 1014 of file llpreviewscript.cpp.

References LLDynamicArray< Type, BlockSize >::count(), count, LLDynamicArray< Type, BlockSize >::get(), i, mBridges, NULL, LLDynamicArray< Type, BlockSize >::reset(), and S32.

Referenced by ~LLScriptEdCore().

void LLScriptEdCore::doSave ( void userdata,
BOOL  close_after_save 
) [static]

Definition at line 800 of file llpreviewscript.cpp.

References gViewerStats, LLViewerStats::incStat(), and LLViewerStats::ST_LSL_SAVE_COUNT.

Referenced by handleSaveChangesDialog(), and onBtnSave().

void LLScriptEdCore::draw (  )  [virtual]

Reimplemented from LLPanel.

Definition at line 445 of file llpreviewscript.cpp.

References LLPanel::childSetEnabled(), LLPanel::childSetText(), LLPanel::draw(), FALSE, LLTextEditor::getCurrentLineAndColumn(), LLUICtrl::hasFocus(), LLTextEditor::isPristine(), llformat(), mEditor, LLStringBase< char >::null, S32, and updateDynamicHelp().

BOOL LLScriptEdCore::enableCopyMenu ( void userdata  )  [static]

Definition at line 920 of file llpreviewscript.cpp.

References FALSE.

Referenced by initMenu().

BOOL LLScriptEdCore::enableCutMenu ( void userdata  )  [static]

Definition at line 912 of file llpreviewscript.cpp.

References FALSE.

Referenced by initMenu().

BOOL LLScriptEdCore::enableDeselectMenu ( void userdata  )  [static]

Definition at line 944 of file llpreviewscript.cpp.

References FALSE.

BOOL LLScriptEdCore::enablePasteMenu ( void userdata  )  [static]

Definition at line 928 of file llpreviewscript.cpp.

References FALSE.

Referenced by initMenu().

BOOL LLScriptEdCore::enableRedoMenu ( void userdata  )  [static]

Definition at line 904 of file llpreviewscript.cpp.

References FALSE.

Referenced by initMenu().

BOOL LLScriptEdCore::enableSelectAllMenu ( void userdata  )  [static]

Definition at line 936 of file llpreviewscript.cpp.

References FALSE.

Referenced by initMenu().

BOOL LLScriptEdCore::enableUndoMenu ( void userdata  )  [static]

Definition at line 896 of file llpreviewscript.cpp.

References FALSE.

Referenced by initMenu().

BOOL LLScriptEdCore::handleKeyHere ( KEY  key,
MASK  mask,
BOOL  called_from_parent 
) [virtual]

Reimplemented from LLPanel.

Definition at line 1028 of file llpreviewscript.cpp.

References FALSE, LLView::getEnabled(), LLView::getVisible(), MASK_CONTROL, MASK_MODIFIERS, mSaveCallback, mSearchReplaceCallback, mUserdata, and TRUE.

void LLScriptEdCore::handleReloadFromServerDialog ( S32  option,
void userdata 
) [static]

Definition at line 976 of file llpreviewscript.cpp.

References llassert.

Referenced by onBtnUndoChanges().

void LLScriptEdCore::handleSaveChangesDialog ( S32  option,
void userdata 
) [static]

Definition at line 612 of file llpreviewscript.cpp.

References app_abort_quit(), doSave(), and TRUE.

Referenced by canClose().

BOOL LLScriptEdCore::hasChanged ( void userdata  )  [static]

Definition at line 437 of file llpreviewscript.cpp.

References FALSE.

Referenced by initMenu().

void LLScriptEdCore::initMenu (  ) 

Definition at line 389 of file llpreviewscript.cpp.

References enableCopyMenu(), enableCutMenu(), enablePasteMenu(), enableRedoMenu(), enableSelectAllMenu(), enableUndoMenu(), LLUICtrlFactory::getMenuItemCallByName(), hasChanged(), NULL, onBtnDynamicHelp(), onBtnHelp(), onBtnSave(), onBtnUndoChanges(), onCopyMenu(), onCutMenu(), onPasteMenu(), onRedoMenu(), onSearchMenu(), onSelectAllMenu(), onUndoMenu(), LLMenuItemCallGL::setEnabledCallback(), and LLMenuItemCallGL::setMenuCallback().

void LLScriptEdCore::onBtnDynamicHelp ( void userdata  )  [static]

Definition at line 661 of file llpreviewscript.cpp.

References LLComboBox::add(), LLUICtrlFactory::buildFloater(), LLPanel::childSetAction(), LLPanel::childSetCommitCallback(), LLPanel::childSetValue(), LLControlGroup::getBOOL(), LLUICtrlFactory::getComboBoxByName(), LLFloater::getFloaterByHandle(), LLPanel::getHandle(), LLView::getParent(), LLUICtrlFactory::getWebBrowserCtrlByName(), gSavedSettings, gUICtrlFactory, mEditor, LLTextEditor::mKeywords, mLastHelpToken, mLiveHelpHandle, mLiveHelpHistorySize, LLKeywordToken::mToken, LLKeywords::mWordTokenMap, NULL, onCheckLock(), onClickBack(), onClickForward(), onHelpComboCommit(), LLFloater::setFocus(), LLComboBox::sortByName(), TRUE, updateDynamicHelp(), and wstring_to_utf8str().

Referenced by initMenu().

void LLScriptEdCore::onBtnHelp ( void userdata  )  [static]

Definition at line 653 of file llpreviewscript.cpp.

References LLViewerWindow::alertXml(), gViewerWindow, and onHelpWebDialog().

Referenced by initMenu().

void LLScriptEdCore::onBtnInsertFunction ( LLUICtrl ,
void  
) [static]

Definition at line 786 of file llpreviewscript.cpp.

References TRUE.

void LLScriptEdCore::onBtnInsertSample ( void  )  [static]

Definition at line 753 of file llpreviewscript.cpp.

void LLScriptEdCore::onBtnSave ( void  )  [static]

Definition at line 816 of file llpreviewscript.cpp.

References doSave(), and FALSE.

Referenced by initMenu().

void LLScriptEdCore::onBtnUndoChanges ( void  )  [static]

Definition at line 823 of file llpreviewscript.cpp.

References LLViewerWindow::alertXml(), gViewerWindow, and handleReloadFromServerDialog().

Referenced by initMenu().

void LLScriptEdCore::onCheckLock ( LLUICtrl ,
void  
) [static]

Definition at line 742 of file llpreviewscript.cpp.

References LLSD::asBoolean(), LLUICtrl::getValue(), gSavedSettings, mLastHelpToken, NULL, and LLControlGroup::setBOOL().

Referenced by onBtnDynamicHelp().

void LLScriptEdCore::onClickBack ( void userdata  )  [static]

Definition at line 708 of file llpreviewscript.cpp.

References LLFloater::getFloaterByHandle(), LLUICtrlFactory::getWebBrowserCtrlByName(), and mLiveHelpHandle.

Referenced by onBtnDynamicHelp().

void LLScriptEdCore::onClickForward ( void userdata  )  [static]

Definition at line 725 of file llpreviewscript.cpp.

References LLFloater::getFloaterByHandle(), LLUICtrlFactory::getWebBrowserCtrlByName(), and mLiveHelpHandle.

Referenced by onBtnDynamicHelp().

void LLScriptEdCore::onCopyMenu ( void userdata  )  [static]

Definition at line 864 of file llpreviewscript.cpp.

Referenced by initMenu().

void LLScriptEdCore::onCutMenu ( void userdata  )  [static]

Definition at line 856 of file llpreviewscript.cpp.

Referenced by initMenu().

void LLScriptEdCore::onDeselectMenu ( void userdata  )  [static]

Definition at line 888 of file llpreviewscript.cpp.

void LLScriptEdCore::onErrorList ( LLUICtrl ,
void user_data 
) [static, protected]

Definition at line 952 of file llpreviewscript.cpp.

References LLScrollListItem::getColumn(), LLScrollListCell::getText(), LLStringBase< char >::replaceChar(), S32, and TRUE.

Referenced by selectFirstError().

void LLScriptEdCore::onHelpComboCommit ( LLUICtrl ctrl,
void userdata 
) [static]

Definition at line 764 of file llpreviewscript.cpp.

References addHelpItemToHistory(), LLSD::asString(), gDirUtilp, LLFloater::getFloaterByHandle(), LLControlGroup::getString(), LLUICtrl::getValue(), LLUICtrlFactory::getWebBrowserCtrlByName(), LLDir::getWorkingDir(), gSavedSettings, gUICtrlFactory, mLiveHelpHandle, and LLUIString::setArg().

Referenced by onBtnDynamicHelp().

void LLScriptEdCore::onHelpWebDialog ( S32  option,
void userdata 
) [static]

Definition at line 638 of file llpreviewscript.cpp.

References load_url_local_file(), and mHelpFile.

Referenced by onBtnHelp().

void LLScriptEdCore::onPasteMenu ( void userdata  )  [static]

Definition at line 872 of file llpreviewscript.cpp.

Referenced by initMenu().

void LLScriptEdCore::onRedoMenu ( void userdata  )  [static]

Definition at line 848 of file llpreviewscript.cpp.

Referenced by initMenu().

void LLScriptEdCore::onSearchMenu ( void userdata  )  [static]

Definition at line 833 of file llpreviewscript.cpp.

References LLFloaterScriptSearch::show().

Referenced by initMenu().

void LLScriptEdCore::onSelectAllMenu ( void userdata  )  [static]

Definition at line 880 of file llpreviewscript.cpp.

Referenced by initMenu().

void LLScriptEdCore::onUndoMenu ( void userdata  )  [static]

Definition at line 840 of file llpreviewscript.cpp.

Referenced by initMenu().

void LLScriptEdCore::selectFirstError (  ) 

Definition at line 998 of file llpreviewscript.cpp.

References mErrorList, onErrorList(), and LLScrollListCtrl::selectFirstItem().

Referenced by LLLiveLSLEditor::callbackLSLCompileFailed(), LLPreviewLSL::callbackLSLCompileFailed(), LLLiveLSLEditor::uploadAssetLegacy(), and LLPreviewLSL::uploadAssetLegacy().

void LLScriptEdCore::setHelpPage ( const LLString help_string  )  [protected]

Definition at line 533 of file llpreviewscript.cpp.

References addHelpItemToHistory(), gDirUtilp, LLUICtrlFactory::getComboBoxByName(), LLFloater::getFloaterByHandle(), LLControlGroup::getString(), LLUICtrlFactory::getWebBrowserCtrlByName(), LLDir::getWorkingDir(), gSavedSettings, gUICtrlFactory, mLiveHelpHandle, and LLUIString::setArg().

Referenced by updateDynamicHelp().

void LLScriptEdCore::updateDynamicHelp ( BOOL  immediate = FALSE  )  [protected]

Definition at line 469 of file llpreviewscript.cpp.

References LLControlGroup::getBOOL(), LLUICtrlFactory::getButtonByName(), LLFrameTimer::getElapsedTimeF32(), LLFloater::getFloaterByHandle(), LLTextEditor::getPreviousSegment(), LLTextEditor::getSelectedSegments(), LLFrameTimer::getStarted(), LLTextEditor::getText(), LLTextSegment::getToken(), LLKeywordToken::getType(), LLUICtrlFactory::getWebBrowserCtrlByName(), gSavedSettings, LIVE_HELP_REFRESH_TIME, mEditor, mLastHelpToken, mLiveHelpHandle, mLiveHelpTimer, NULL, LLView::setEnabled(), setHelpPage(), LLFrameTimer::start(), LLFrameTimer::stop(), and LLKeywordToken::WORD.

Referenced by draw(), and onBtnDynamicHelp().


Friends And Related Function Documentation

friend class LLFloaterScriptSearch [friend]

Definition at line 62 of file llpreviewscript.h.

friend class LLLiveLSLEditor [friend]

Definition at line 61 of file llpreviewscript.h.

friend class LLLiveScriptEditor [friend]

Definition at line 60 of file llpreviewscript.h.

friend class LLPreviewLSL [friend]

Definition at line 59 of file llpreviewscript.h.

friend class LLPreviewScript [friend]

Definition at line 58 of file llpreviewscript.h.


Member Data Documentation

LLDynamicArray<LLEntryAndEdCore*> LLScriptEdCore::mBridges [private]

Definition at line 144 of file llpreviewscript.h.

Referenced by deleteBridges().

LLPanel* LLScriptEdCore::mCodePanel [private]

Definition at line 142 of file llpreviewscript.h.

LLTextEditor* LLScriptEdCore::mEditor [private]

Definition at line 134 of file llpreviewscript.h.

Referenced by canClose(), draw(), LLFloaterScriptSearch::handleBtnReplace(), LLFloaterScriptSearch::handleBtnReplaceAll(), LLFloaterScriptSearch::handleBtnSearch(), LLLiveLSLEditor::LLLiveLSLEditor(), LLLiveLSLEditor::loadAsset(), LLPreviewLSL::loadAsset(), LLLiveLSLEditor::loadScriptText(), onBtnDynamicHelp(), LLPreviewLSL::onLoadComplete(), LLLiveLSLEditor::saveIfNeeded(), LLPreviewLSL::saveIfNeeded(), and updateDynamicHelp().

LLScrollListCtrl* LLScriptEdCore::mErrorList [private]

Definition at line 143 of file llpreviewscript.h.

Referenced by LLLiveLSLEditor::callbackLSLCompileFailed(), LLPreviewLSL::callbackLSLCompileFailed(), LLLiveLSLEditor::callbackLSLCompileSucceeded(), LLPreviewLSL::callbackLSLCompileSucceeded(), LLLiveLSLEditor::onSaveBytecodeComplete(), LLLiveLSLEditor::saveIfNeeded(), LLPreviewLSL::saveIfNeeded(), selectFirstError(), LLLiveLSLEditor::uploadAssetLegacy(), and LLPreviewLSL::uploadAssetLegacy().

BOOL LLScriptEdCore::mForceClose [private]

Definition at line 140 of file llpreviewscript.h.

Referenced by canClose().

LLComboBox* LLScriptEdCore::mFunctions [private]

Definition at line 139 of file llpreviewscript.h.

Referenced by LLPreviewLSL::loadAsset().

std::string LLScriptEdCore::mHelpFile [private]

Definition at line 133 of file llpreviewscript.h.

Referenced by onHelpWebDialog().

LLKeywordToken* LLScriptEdCore::mLastHelpToken [private]

Definition at line 146 of file llpreviewscript.h.

Referenced by onBtnDynamicHelp(), onCheckLock(), and updateDynamicHelp().

LLViewHandle LLScriptEdCore::mLiveHelpHandle [private]

Definition at line 145 of file llpreviewscript.h.

Referenced by addHelpItemToHistory(), onBtnDynamicHelp(), onClickBack(), onClickForward(), onHelpComboCommit(), setHelpPage(), and updateDynamicHelp().

S32 LLScriptEdCore::mLiveHelpHistorySize [private]

Definition at line 148 of file llpreviewscript.h.

Referenced by addHelpItemToHistory(), and onBtnDynamicHelp().

LLFrameTimer LLScriptEdCore::mLiveHelpTimer [private]

Definition at line 147 of file llpreviewscript.h.

Referenced by updateDynamicHelp().

void(* LLScriptEdCore::mLoadCallback)(void *userdata) [private]

LLString LLScriptEdCore::mSampleText [private]

Definition at line 132 of file llpreviewscript.h.

void(* LLScriptEdCore::mSaveCallback)(void *userdata, BOOL close_after_save) [private]

Referenced by handleKeyHere().

void(* LLScriptEdCore::mSearchReplaceCallback)(void *userdata) [private]

Referenced by handleKeyHere().

void* LLScriptEdCore::mUserdata [private]

Definition at line 138 of file llpreviewscript.h.

Referenced by handleKeyHere().


The documentation for this class was generated from the following files:
Generated on Thu Jul 1 06:11:43 2010 for Second Life Viewer by  doxygen 1.4.7