Browse Source

Renamed RCLICK -> SHOW_POPUP

Ivan Savenko 2 years ago
parent
commit
563d7dd41f

+ 1 - 1
client/adventureMap/CInfoBar.cpp

@@ -298,7 +298,7 @@ void CInfoBar::hover(bool on)
 }
 
 CInfoBar::CInfoBar(const Rect & position)
-	: CIntObject(LCLICK | RCLICK | HOVER, position.topLeft()),
+	: CIntObject(LCLICK | SHOW_POPUP | HOVER, position.topLeft()),
 	timerCounter(0),
 	state(EMPTY)
 {

+ 1 - 1
client/adventureMap/CList.cpp

@@ -31,7 +31,7 @@
 #include "../../lib/mapObjects/CGTownInstance.h"
 
 CList::CListItem::CListItem(CList * Parent)
-	: CIntObject(LCLICK | RCLICK | HOVER),
+	: CIntObject(LCLICK | SHOW_POPUP | HOVER),
 	parent(Parent),
 	selection()
 {

+ 1 - 1
client/adventureMap/CMinimap.cpp

@@ -88,7 +88,7 @@ void CMinimapInstance::showAll(Canvas & to)
 }
 
 CMinimap::CMinimap(const Rect & position)
-	: CIntObject(LCLICK | RCLICK | HOVER | MOVE | GESTURE_PANNING, position.topLeft()),
+	: CIntObject(LCLICK | SHOW_POPUP | HOVER | MOVE | GESTURE_PANNING, position.topLeft()),
 	level(0)
 {
 	OBJECT_CONSTRUCTION_CAPTURING(255-DISPOSE);

+ 1 - 1
client/adventureMap/CResDataBar.cpp

@@ -35,7 +35,7 @@ CResDataBar::CResDataBar(const std::string & imageName, const Point & position)
 	pos.w = background->pos.w;
 	pos.h = background->pos.h;
 
-	addUsedEvents(RCLICK);
+	addUsedEvents(SHOW_POPUP);
 }
 
 CResDataBar::CResDataBar(const std::string & defname, int x, int y, int offx, int offy, int resdist, int datedist):

+ 1 - 1
client/battle/BattleFieldController.cpp

@@ -155,7 +155,7 @@ BattleFieldController::BattleFieldController(BattleInterface & owner):
 	backgroundWithHexes = std::make_unique<Canvas>(Point(background->width(), background->height()));
 
 	updateAccessibleHexes();
-	addUsedEvents(LCLICK | RCLICK | MOVE | TIME | GESTURE_PANNING);
+	addUsedEvents(LCLICK | SHOW_POPUP | MOVE | TIME | GESTURE_PANNING);
 }
 
 void BattleFieldController::activate()

+ 1 - 1
client/battle/BattleInterfaceClasses.cpp

@@ -702,7 +702,7 @@ std::optional<uint32_t> StackQueue::getHoveredUnitIdIfAny() const
 }
 
 StackQueue::StackBox::StackBox(StackQueue * owner):
-	CIntObject(RCLICK | HOVER), owner(owner)
+	CIntObject(SHOW_POPUP | HOVER), owner(owner)
 {
 	OBJECT_CONSTRUCTION_CAPTURING(255-DISPOSE);
 	background = std::make_shared<CPicture>(owner->embedded ? "StackQueueSmall" : "StackQueueLarge");

+ 1 - 1
client/gui/CIntObject.h

@@ -102,7 +102,7 @@ public:
 	/// default behavior is to re-center, can be overriden
 	void onScreenResize() override;
 
-	/// returns true if UI elements wants to handle event of specific type (LCLICK, RCLICK ...)
+	/// returns true if UI elements wants to handle event of specific type (LCLICK, SHOW_POPUP ...)
 	/// by default, usedEvents inside UI elements are always handled
 	bool receiveEvent(const Point & position, int eventType) const override;
 

+ 1 - 1
client/gui/EventDispatcher.cpp

@@ -28,7 +28,7 @@ void EventDispatcher::processLists(ui16 activityFlag, const Functor & cb)
 	};
 
 	processList(AEventsReceiver::LCLICK, lclickable);
-	processList(AEventsReceiver::RCLICK, rclickable);
+	processList(AEventsReceiver::SHOW_POPUP, rclickable);
 	processList(AEventsReceiver::HOVER, hoverable);
 	processList(AEventsReceiver::MOVE, motioninterested);
 	processList(AEventsReceiver::KEYBOARD, keyinterested);

+ 1 - 1
client/gui/EventsReceiver.h

@@ -70,7 +70,7 @@ public:
 	virtual ~AEventsReceiver() = default;
 
 	/// These are the arguments that can be used to determine what kind of input UI element will receive
-	enum {LCLICK=1, RCLICK=2, HOVER=4, MOVE=8, KEYBOARD=16, TIME=32, GENERAL=64, WHEEL=128, DOUBLECLICK=256, TEXTINPUT=512, GESTURE_PANNING=1024, ALL=0xffff};
+	enum {LCLICK=1, SHOW_POPUP=2, HOVER=4, MOVE=8, KEYBOARD=16, TIME=32, GENERAL=64, WHEEL=128, DOUBLECLICK=256, TEXTINPUT=512, GESTURE_PANNING=1024, ALL=0xffff};
 
 	/// Returns true if element is currently hovered by mouse
 	bool isHovered() const;

+ 1 - 1
client/lobby/CBonusSelection.cpp

@@ -447,7 +447,7 @@ void CBonusSelection::decreaseDifficulty()
 }
 
 CBonusSelection::CRegion::CRegion(int id, bool accessible, bool selectable, const CampaignRegions & campDsc)
-	: CIntObject(LCLICK | RCLICK), idOfMapAndRegion(id), accessible(accessible), selectable(selectable)
+	: CIntObject(LCLICK | SHOW_POPUP), idOfMapAndRegion(id), accessible(accessible), selectable(selectable)
 {
 	OBJ_CONSTRUCTION;
 	static const std::string colors[2][8] =

+ 1 - 1
client/lobby/CSelectionBase.cpp

@@ -341,7 +341,7 @@ void CChatBox::addNewMessage(const std::string & text)
 }
 
 CFlagBox::CFlagBox(const Rect & rect)
-	: CIntObject(RCLICK)
+	: CIntObject(SHOW_POPUP)
 {
 	pos += rect.topLeft();
 	pos.w = rect.w;

+ 1 - 1
client/lobby/OptionsTab.cpp

@@ -413,7 +413,7 @@ void OptionsTab::CPlayerOptionTooltipBox::genBonusWindow()
 }
 
 OptionsTab::SelectedBox::SelectedBox(Point position, PlayerSettings & settings, SelType type)
-	: Scrollable(RCLICK, position, Orientation::HORIZONTAL)
+	: Scrollable(SHOW_POPUP, position, Orientation::HORIZONTAL)
 	, CPlayerSettingsHelper(settings, type)
 {
 	OBJ_CONSTRUCTION_CAPTURING_ALL_NO_DISPOSE;

+ 1 - 1
client/mapView/MapViewActions.cpp

@@ -33,7 +33,7 @@ MapViewActions::MapViewActions(MapView & owner, const std::shared_ptr<MapViewMod
 	pos.w = model->getPixelsVisibleDimensions().x;
 	pos.h = model->getPixelsVisibleDimensions().y;
 
-	addUsedEvents(LCLICK | RCLICK | GESTURE_PANNING | HOVER | MOVE | WHEEL);
+	addUsedEvents(LCLICK | SHOW_POPUP | GESTURE_PANNING | HOVER | MOVE | WHEEL);
 }
 
 void MapViewActions::setContext(const std::shared_ptr<IMapRendererContext> & context)

+ 1 - 1
client/widgets/Buttons.cpp

@@ -236,7 +236,7 @@ CButton::CButton(Point position, const std::string &defName, const std::pair<std
     callback(Callback)
 {
 	defActions = 255-DISPOSE;
-	addUsedEvents(LCLICK | RCLICK | HOVER | KEYBOARD);
+	addUsedEvents(LCLICK | SHOW_POPUP | HOVER | KEYBOARD);
 
 	stateToIndex[0] = 0;
 	stateToIndex[1] = 1;

+ 1 - 1
client/widgets/CComponent.cpp

@@ -54,7 +54,7 @@ void CComponent::init(Etype Type, int Subtype, int Val, ESize imageSize, EFonts
 {
 	OBJECT_CONSTRUCTION_CAPTURING(255-DISPOSE);
 
-	addUsedEvents(RCLICK);
+	addUsedEvents(SHOW_POPUP);
 
 	compType = Type;
 	subtype = Subtype;

+ 2 - 2
client/widgets/CGarrisonInt.cpp

@@ -357,13 +357,13 @@ void CGarrisonSlot::update()
 {
 	if(getObj() != nullptr)
 	{
-		addUsedEvents(LCLICK | RCLICK | HOVER);
+		addUsedEvents(LCLICK | SHOW_POPUP | HOVER);
 		myStack = getObj()->getStackPtr(ID);
 		creature = myStack ? myStack->type : nullptr;
 	}
 	else
 	{
-		removeUsedEvents(LCLICK | RCLICK | HOVER);
+		removeUsedEvents(LCLICK | SHOW_POPUP | HOVER);
 		myStack = nullptr;
 		creature = nullptr;
 	}

+ 1 - 1
client/widgets/MiscWidgets.cpp

@@ -82,7 +82,7 @@ LRClickableAreaWText::~LRClickableAreaWText()
 
 void LRClickableAreaWText::init()
 {
-	addUsedEvents(LCLICK | RCLICK | HOVER);
+	addUsedEvents(LCLICK | SHOW_POPUP | HOVER);
 }
 
 void LRClickableAreaWTextComp::clickLeft(tribool down, bool previousState)

+ 6 - 6
client/windows/CCastleInterface.cpp

@@ -69,7 +69,7 @@ CBuildingRect::CBuildingRect(CCastleBuildings * Par, const CGTownInstance * Town
 	  area(nullptr),
 	  stateTimeCounter(BUILD_ANIMATION_FINISHED_TIMEPOINT)
 {
-	addUsedEvents(LCLICK | RCLICK | HOVER | TIME);
+	addUsedEvents(LCLICK | SHOW_POPUP | HOVER | TIME);
 	pos.x += str->pos.x;
 	pos.y += str->pos.y;
 
@@ -328,7 +328,7 @@ CHeroGSlot::CHeroGSlot(int x, int y, int updown, const CGHeroInstance * h, HeroS
 
 	set(h);
 
-	addUsedEvents(LCLICK | RCLICK | HOVER);
+	addUsedEvents(LCLICK | SHOW_POPUP | HOVER);
 }
 
 CHeroGSlot::~CHeroGSlot() = default;
@@ -1007,7 +1007,7 @@ CCreaInfo::CCreaInfo(Point position, const CGTownInstance * Town, int Level, boo
 		level = -1;
 		return;//No creature
 	}
-	addUsedEvents(LCLICK | RCLICK | HOVER);
+	addUsedEvents(LCLICK | SHOW_POPUP | HOVER);
 
 	ui32 creatureID = town->creatures[level].second.back();
 	creature = CGI->creh->objects[creatureID];
@@ -1107,7 +1107,7 @@ CTownInfo::CTownInfo(int posX, int posY, const CGTownInstance * Town, bool townH
 	building(nullptr)
 {
 	OBJECT_CONSTRUCTION_CAPTURING(255-DISPOSE);
-	addUsedEvents(RCLICK | HOVER);
+	addUsedEvents(SHOW_POPUP | HOVER);
 	pos.x += posX;
 	pos.y += posY;
 	int buildID;
@@ -1339,7 +1339,7 @@ CHallInterface::CBuildingBox::CBuildingBox(int x, int y, const CGTownInstance *
 	building(Building)
 {
 	OBJECT_CONSTRUCTION_CAPTURING(255-DISPOSE);
-	addUsedEvents(LCLICK | RCLICK | HOVER);
+	addUsedEvents(LCLICK | SHOW_POPUP | HOVER);
 	pos.x += x;
 	pos.y += y;
 	pos.w = 154;
@@ -1798,7 +1798,7 @@ CMageGuildScreen::Scroll::Scroll(Point position, const CSpell *Spell)
 {
 	OBJECT_CONSTRUCTION_CAPTURING(255-DISPOSE);
 
-	addUsedEvents(LCLICK | RCLICK | HOVER);
+	addUsedEvents(LCLICK | SHOW_POPUP | HOVER);
 	pos += position;
 	image = std::make_shared<CAnimImage>("SPELLSCR", spell->id);
 	pos = image->pos;

+ 2 - 2
client/windows/CKingdomInterface.cpp

@@ -49,7 +49,7 @@ InfoBox::InfoBox(Point position, InfoPos Pos, InfoSize Size, std::shared_ptr<IIn
 	name(nullptr)
 {
 	assert(data);
-	addUsedEvents(LCLICK | RCLICK);
+	addUsedEvents(LCLICK | SHOW_POPUP);
 	EFonts font = (size < SIZE_MEDIUM)? FONT_SMALL: FONT_MEDIUM;
 
 	OBJECT_CONSTRUCTION_CAPTURING(255-DISPOSE);
@@ -599,7 +599,7 @@ void CKingdomInterface::generateMinesList(const std::vector<const CGObjectInstan
 		std::string value = std::to_string(minesCount[i]);
 		auto data = std::make_shared<InfoBoxCustom>(value, "", "OVMINES", i, CGI->generaltexth->translate("core.minename", i));
 		minesBox[i] = std::make_shared<InfoBox>(Point(20+i*80, 31+footerPos), InfoBox::POS_INSIDE, InfoBox::SIZE_SMALL, data);
-		minesBox[i]->removeUsedEvents(LCLICK|RCLICK); //fixes #890 - mines boxes ignore clicks
+		minesBox[i]->removeUsedEvents(LCLICK|SHOW_POPUP); //fixes #890 - mines boxes ignore clicks
 	}
 	incomeArea = std::make_shared<CHoverableArea>();
 	incomeArea->pos = Rect(pos.x+580, pos.y+31+footerPos, 136, 68);

+ 2 - 2
client/windows/CSpellWindow.cpp

@@ -43,7 +43,7 @@
 
 CSpellWindow::InteractiveArea::InteractiveArea(const Rect & myRect, std::function<void()> funcL, int helpTextId, CSpellWindow * _owner)
 {
-	addUsedEvents(LCLICK | RCLICK | HOVER);
+	addUsedEvents(LCLICK | SHOW_POPUP | HOVER);
 	pos = myRect;
 	onLeft = funcL;
 	hoverText = CGI->generaltexth->zelp[helpTextId].first;
@@ -452,7 +452,7 @@ CSpellWindow::SpellArea::SpellArea(Rect pos, CSpellWindow * owner)
 {
 	this->pos = pos;
 	this->owner = owner;
-	addUsedEvents(LCLICK | RCLICK | HOVER);
+	addUsedEvents(LCLICK | SHOW_POPUP | HOVER);
 
 	schoolLevel = -1;
 	mySpell = nullptr;

+ 1 - 1
client/windows/CTradeWindow.cpp

@@ -38,7 +38,7 @@
 #include "../../lib/mapObjects/CGMarket.h"
 
 CTradeWindow::CTradeableItem::CTradeableItem(Point pos, EType Type, int ID, bool Left, int Serial)
-	: CIntObject(LCLICK | HOVER | RCLICK, pos),
+	: CIntObject(LCLICK | HOVER | SHOW_POPUP, pos),
 	type(EType(-1)),// set to invalid, will be corrected in setType
 	id(ID),
 	serial(Serial),

+ 1 - 1
client/windows/CWindowObject.cpp

@@ -110,7 +110,7 @@ void CWindowObject::setBackground(std::string filename)
 int CWindowObject::getUsedEvents(int options)
 {
 	if (options & RCLICK_POPUP)
-		return RCLICK;
+		return SHOW_POPUP;
 	return 0;
 }
 

+ 1 - 1
client/windows/CreaturePurchaseCard.cpp

@@ -114,7 +114,7 @@ void CreaturePurchaseCard::initView()
 }
 
 CreaturePurchaseCard::CCreatureClickArea::CCreatureClickArea(const Point & position, const std::shared_ptr<CCreaturePic> creaturePic, const CCreature * creatureOnTheCard)
-	: CIntObject(RCLICK),
+	: CIntObject(SHOW_POPUP),
 	creatureOnTheCard(creatureOnTheCard)
 {
 	pos.x += position.x;

+ 3 - 3
client/windows/GUIClasses.cpp

@@ -75,7 +75,7 @@
 #include "../lib/TextOperations.h"
 
 CRecruitmentWindow::CCreatureCard::CCreatureCard(CRecruitmentWindow * window, const CCreature * crea, int totalAmount)
-	: CIntObject(LCLICK | RCLICK),
+	: CIntObject(LCLICK | SHOW_POPUP),
 	parent(window),
 	selected(false),
 	creature(crea),
@@ -563,7 +563,7 @@ void CTavernWindow::HeroPortrait::showPopupWindow()
 }
 
 CTavernWindow::HeroPortrait::HeroPortrait(int & sel, int id, int x, int y, const CGHeroInstance * H)
-	: CIntObject(LCLICK | RCLICK | HOVER),
+	: CIntObject(LCLICK | SHOW_POPUP | HOVER),
 	h(H), _sel(&sel), _id(id)
 {
 	OBJECT_CONSTRUCTION_CAPTURING(255-DISPOSE);
@@ -1236,7 +1236,7 @@ CTransformerWindow::CTransformerWindow(const IMarket * _market, const CGHeroInst
 }
 
 CUniversityWindow::CItem::CItem(CUniversityWindow * _parent, int _ID, int X, int Y)
-	: CIntObject(LCLICK | RCLICK | HOVER),
+	: CIntObject(LCLICK | SHOW_POPUP | HOVER),
 	ID(_ID),
 	parent(_parent)
 {

+ 1 - 1
client/windows/InfoWindows.cpp

@@ -340,7 +340,7 @@ void CRClickPopup::createAndPush(const CGObjectInstance * obj, const Point & p,
 
 CRClickPopup::CRClickPopup()
 {
-	addUsedEvents(RCLICK);
+	addUsedEvents(SHOW_POPUP);
 }
 
 CRClickPopup::~CRClickPopup()