mirror of https://github.com/axmolengine/axmol.git
Merge pull request #14760 from mogemimi/fix-doc-typo
Fix typos in documentation, comments and strings
This commit is contained in:
commit
727480e44f
|
@ -43,8 +43,8 @@ namespace ui {
|
||||||
class EditBoxImpl;
|
class EditBoxImpl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*@brief Editbox delgate class.
|
*@brief Editbox delegate class.
|
||||||
* It's useful when you want to do some customization duing Editbox input event
|
* It's useful when you want to do some customization during Editbox input event
|
||||||
*
|
*
|
||||||
* @js NA
|
* @js NA
|
||||||
* @lua NA
|
* @lua NA
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
#include "base/ccUTF8.h"
|
#include "base/ccUTF8.h"
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
// desoty dialog when lost focus
|
// destroy dialog when lost focus
|
||||||
static void dialogFocusOutCallback(GtkWidget* widget, gpointer user_data)
|
static void dialogFocusOutCallback(GtkWidget* widget, gpointer user_data)
|
||||||
{
|
{
|
||||||
gtk_widget_destroy(widget);
|
gtk_widget_destroy(widget);
|
||||||
|
|
|
@ -537,7 +537,7 @@ NSPoint EditBoxImplMac::convertDesignCoordToScreenCoord(const Vec2& designCoord,
|
||||||
Vec2 visiblePos = Vec2(designCoord.x * eglView->getScaleX(), designCoord.y * eglView->getScaleY());
|
Vec2 visiblePos = Vec2(designCoord.x * eglView->getScaleX(), designCoord.y * eglView->getScaleY());
|
||||||
Vec2 screenGLPos = visiblePos + eglView->getViewPortRect().origin;
|
Vec2 screenGLPos = visiblePos + eglView->getViewPortRect().origin;
|
||||||
|
|
||||||
//TODO: I don't know why here needs to substract `height`.
|
//TODO: I don't know why here needs to subtract `height`.
|
||||||
NSPoint screenPos = NSMakePoint(screenGLPos.x, screenGLPos.y-height);
|
NSPoint screenPos = NSMakePoint(screenGLPos.x, screenGLPos.y-height);
|
||||||
|
|
||||||
if (bInRetinaMode) {
|
if (bInRetinaMode) {
|
||||||
|
|
|
@ -49,8 +49,8 @@ class CC_GUI_DLL Helper
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* Find a widget with a specific tag from root widget.
|
* Find a widget with a specific tag from root widget.
|
||||||
* This search will be recursive throught all child widgets.
|
* This search will be recursive through all child widgets.
|
||||||
* @param root The be seached root widget.
|
* @param root The be searched root widget.
|
||||||
* @param tag The widget tag.
|
* @param tag The widget tag.
|
||||||
* @return Widget instance pointer.
|
* @return Widget instance pointer.
|
||||||
*/
|
*/
|
||||||
|
@ -58,7 +58,7 @@ public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find a widget with a specific name from root widget.
|
* Find a widget with a specific name from root widget.
|
||||||
* This search will be recursive throught all child widgets.
|
* This search will be recursive through all child widgets.
|
||||||
*
|
*
|
||||||
* @param root The be searched root widget.
|
* @param root The be searched root widget.
|
||||||
* @param name The widget name.
|
* @param name The widget name.
|
||||||
|
@ -68,7 +68,7 @@ public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find a widget with a specific action tag from root widget
|
* Find a widget with a specific action tag from root widget
|
||||||
* This search will be recursive throught all child widgets.
|
* This search will be recursive through all child widgets.
|
||||||
*@param root The be searched root widget.
|
*@param root The be searched root widget.
|
||||||
*@param tag The widget action's tag.
|
*@param tag The widget action's tag.
|
||||||
*@return Widget instance pointer.
|
*@return Widget instance pointer.
|
||||||
|
|
|
@ -1045,7 +1045,7 @@ Size Layout::getLayoutAccumulatedSize()const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//substract extra size
|
//subtract extra size
|
||||||
Type type = this->getLayoutType();
|
Type type = this->getLayoutType();
|
||||||
if (type == Type::HORIZONTAL)
|
if (type == Type::HORIZONTAL)
|
||||||
{
|
{
|
||||||
|
@ -1063,7 +1063,7 @@ Vec2 Layout::getWorldCenterPoint(Widget* widget)const
|
||||||
Layout *layout = dynamic_cast<Layout*>(widget);
|
Layout *layout = dynamic_cast<Layout*>(widget);
|
||||||
//FIXEDME: we don't need to calculate the content size of layout anymore
|
//FIXEDME: we don't need to calculate the content size of layout anymore
|
||||||
Size widgetSize = layout ? layout->getLayoutAccumulatedSize() : widget->getContentSize();
|
Size widgetSize = layout ? layout->getLayoutAccumulatedSize() : widget->getContentSize();
|
||||||
// CCLOG("contnet size : width = %f, height = %f", widgetSize.width, widgetSize.height);
|
// CCLOG("content size : width = %f, height = %f", widgetSize.width, widgetSize.height);
|
||||||
return widget->convertToWorldSpace(Vec2(widgetSize.width/2, widgetSize.height/2));
|
return widget->convertToWorldSpace(Vec2(widgetSize.width/2, widgetSize.height/2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1153,7 +1153,7 @@ int Layout::findFirstFocusEnabledWidgetIndex()
|
||||||
}
|
}
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
CCASSERT(0, "invalide operation");
|
CCASSERT(0, "invalid operation");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1467,7 +1467,7 @@ Widget* Layout::getPreviousFocusedWidget(FocusDirection direction, Widget *curre
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//handling the disabled widget, there is no actual focus lose or get, so we don't need any envet
|
//handling the disabled widget, there is no actual focus lose or get, so we don't need any event
|
||||||
return this->getPreviousFocusedWidget(direction, nextWidget);
|
return this->getPreviousFocusedWidget(direction, nextWidget);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -116,7 +116,7 @@ namespace ui {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Query the percent content size value.
|
* Query the percent content size value.
|
||||||
*@return Percet (x,y) in Vec2.
|
*@return Percent (x,y) in Vec2.
|
||||||
*/
|
*/
|
||||||
Vec2 getPercentContentSize()const;
|
Vec2 getPercentContentSize()const;
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ class RelativeLayoutParameter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*@brief Base class for managing layout.
|
*@brief Base class for managing layout.
|
||||||
* All the concret layout manager should inherit from this class.
|
* All the concrete layout manager should inherit from this class.
|
||||||
*/
|
*/
|
||||||
class CC_GUI_DLL LayoutManager : public Ref
|
class CC_GUI_DLL LayoutManager : public Ref
|
||||||
{
|
{
|
||||||
|
|
|
@ -337,7 +337,7 @@ public:
|
||||||
void scrollToItem(ssize_t itemIndex, const Vec2& positionRatioInView, const Vec2& itemAnchorPoint, float timeInSec);
|
void scrollToItem(ssize_t itemIndex, const Vec2& positionRatioInView, const Vec2& itemAnchorPoint, float timeInSec);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Query current selected widget's idnex.
|
* @brief Query current selected widget's index.
|
||||||
*
|
*
|
||||||
|
|
||||||
* @return A index of a selected item.
|
* @return A index of a selected item.
|
||||||
|
|
|
@ -65,7 +65,7 @@ class CC_GUI_DLL PageView : public ListView
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* Page turn event tpye.
|
* Page turn event type.
|
||||||
*/
|
*/
|
||||||
enum class EventType
|
enum class EventType
|
||||||
{
|
{
|
||||||
|
|
|
@ -117,7 +117,7 @@ public:
|
||||||
* @param text Content string.
|
* @param text Content string.
|
||||||
* @param fontName Content font name.
|
* @param fontName Content font name.
|
||||||
* @param fontSize Content font size.
|
* @param fontSize Content font size.
|
||||||
* @return True if initialize scucess, false otherwise.
|
* @return True if initialize success, false otherwise.
|
||||||
*/
|
*/
|
||||||
bool init(int tag, const Color3B& color, GLubyte opacity, const std::string& text, const std::string& fontName, float fontSize);
|
bool init(int tag, const Color3B& color, GLubyte opacity, const std::string& text, const std::string& fontName, float fontSize);
|
||||||
|
|
||||||
|
|
|
@ -613,7 +613,7 @@ namespace ui {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** sets the opacity.
|
/** sets the opacity.
|
||||||
@warning If the texture has premultiplied alpha then, the R, G and B channels will be modifed.
|
@warning If the texture has premultiplied alpha then, the R, G and B channels will be modified.
|
||||||
Values goes from 0 to 255, where 255 means fully opaque.
|
Values goes from 0 to 255, where 255 means fully opaque.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -857,7 +857,7 @@ namespace ui {
|
||||||
|
|
||||||
this->cleanupSlicedSprites();
|
this->cleanupSlicedSprites();
|
||||||
|
|
||||||
//we must invalide the transform when toggling scale9enabled
|
//we must invalid the transform when toggling scale9enabled
|
||||||
_transformUpdated = _transformDirty = _inverseDirty = true;
|
_transformUpdated = _transformDirty = _inverseDirty = true;
|
||||||
|
|
||||||
if (_scale9Enabled)
|
if (_scale9Enabled)
|
||||||
|
@ -1094,7 +1094,7 @@ namespace ui {
|
||||||
auto atlasWidth = tex->getPixelsWide();
|
auto atlasWidth = tex->getPixelsWide();
|
||||||
auto atlasHeight = tex->getPixelsHigh();
|
auto atlasHeight = tex->getPixelsHigh();
|
||||||
|
|
||||||
//caculate texture coordinate
|
//calculate texture coordinate
|
||||||
float leftWidth = 0, centerWidth = 0, rightWidth = 0;
|
float leftWidth = 0, centerWidth = 0, rightWidth = 0;
|
||||||
float topHeight = 0, centerHeight = 0, bottomHeight = 0;
|
float topHeight = 0, centerHeight = 0, bottomHeight = 0;
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,7 @@ namespace ui {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Builtin shader state.
|
* Builtin shader state.
|
||||||
* Currenly support Normal and Gray state.
|
* Currently support Normal and Gray state.
|
||||||
*/
|
*/
|
||||||
enum class State
|
enum class State
|
||||||
{
|
{
|
||||||
|
@ -427,7 +427,7 @@ namespace ui {
|
||||||
* @param rect A delimitation zone.
|
* @param rect A delimitation zone.
|
||||||
* @param rotated Whether the sprite is rotated or not.
|
* @param rotated Whether the sprite is rotated or not.
|
||||||
* @param offset The offset when slice the sprite.
|
* @param offset The offset when slice the sprite.
|
||||||
* @param originalSize The origial size of the sprite.
|
* @param originalSize The original size of the sprite.
|
||||||
* @param capInsets The Values to use for the cap insets.
|
* @param capInsets The Values to use for the cap insets.
|
||||||
* @return True if update success, false otherwise.
|
* @return True if update success, false otherwise.
|
||||||
* @js NA
|
* @js NA
|
||||||
|
|
|
@ -455,7 +455,7 @@ void ScrollView::startAutoScroll(const Vec2& deltaMove, float timeInSec, bool at
|
||||||
_autoScrollBraking = false;
|
_autoScrollBraking = false;
|
||||||
_autoScrollBrakingStartPosition = Vec2::ZERO;
|
_autoScrollBrakingStartPosition = Vec2::ZERO;
|
||||||
|
|
||||||
// If the destination is also out of boundary of same side, start brake from beggining.
|
// If the destination is also out of boundary of same side, start brake from beginning.
|
||||||
Vec2 currentOutOfBoundary = getHowMuchOutOfBoundary();
|
Vec2 currentOutOfBoundary = getHowMuchOutOfBoundary();
|
||||||
if(currentOutOfBoundary != Vec2::ZERO)
|
if(currentOutOfBoundary != Vec2::ZERO)
|
||||||
{
|
{
|
||||||
|
|
|
@ -247,7 +247,7 @@ public:
|
||||||
//override "ignoreContentAdaptWithSize" method of widget.
|
//override "ignoreContentAdaptWithSize" method of widget.
|
||||||
virtual void ignoreContentAdaptWithSize(bool ignore) override;
|
virtual void ignoreContentAdaptWithSize(bool ignore) override;
|
||||||
|
|
||||||
//override the widget's hitTest function to perfom its own
|
//override the widget's hitTest function to perform its own
|
||||||
virtual bool hitTest(const Vec2 &pt, const Camera* camera, Vec3 *p) const override;
|
virtual bool hitTest(const Vec2 &pt, const Camera* camera, Vec3 *p) const override;
|
||||||
/**
|
/**
|
||||||
* Returns the "class name" of widget.
|
* Returns the "class name" of widget.
|
||||||
|
|
|
@ -969,14 +969,14 @@ protected:
|
||||||
bool _flippedX;
|
bool _flippedX;
|
||||||
bool _flippedY;
|
bool _flippedY;
|
||||||
|
|
||||||
//use map to enble switch back and forth for user layout parameters
|
//use map to enable switch back and forth for user layout parameters
|
||||||
Map<int,LayoutParameter*> _layoutParameterDictionary;
|
Map<int,LayoutParameter*> _layoutParameterDictionary;
|
||||||
LayoutParameter::Type _layoutParameterType;
|
LayoutParameter::Type _layoutParameterType;
|
||||||
|
|
||||||
bool _focused;
|
bool _focused;
|
||||||
bool _focusEnabled;
|
bool _focusEnabled;
|
||||||
/**
|
/**
|
||||||
* store the only one focued widget
|
* store the only one focused widget
|
||||||
*/
|
*/
|
||||||
static Widget *_focusedWidget; //both layout & widget will be stored in this variable
|
static Widget *_focusedWidget; //both layout & widget will be stored in this variable
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue