• R/O
  • SSH
  • HTTPS

gdx64: コミット


コミットメタ情報

リビジョン282 (tree)
日時2020-03-20 02:41:41
作者hgtterry

ログメッセージ

19/03/20

変更サマリ

差分

--- GD19_OSDN/GD19_FileView_V2.cpp (revision 281)
+++ GD19_OSDN/GD19_FileView_V2.cpp (revision 282)
@@ -19,6 +19,7 @@
1919 OpenObjects = 0;
2020 SelectObject = 0;
2121 Chosen_Object_Index = 0;
22+ RightMouseDown = 0;
2223 }
2324
2425
@@ -135,6 +136,27 @@
135136
136137 }
137138
139+ // ImGui::Text("(You can also right-click me to open the same popup as above.)");
140+ // ImGui::OpenPopupOnItemClick("item context menu", 1);
141+
142+ // When used after an item that has an ID (here the Button), we can skip providing an ID to BeginPopupContextItem().
143+ // BeginPopupContextItem() will use the last item ID as the popup ID.
144+ // In addition here, we want to include your editable label inside the button label. We use the ### operator to override the ID (read FAQ about ID for details)
145+ //static char name[32] = "Label1";
146+ //char buf[64]; sprintf(buf, "Button: %s###Button", name); // ### operator override ID ignoring the preceding label
147+ //ImGui::Selectable(buf);
148+ //if (RightMouseDown == 1 && ImGui::BeginPopupContextItem(buf, 0))
149+ //{
150+ // ImGui::Text("Edit name:");
151+ // ImGui::InputText("##edit", name, IM_ARRAYSIZE(name));
152+ // if (ImGui::Button("Close"))
153+ // {
154+ // ImGui::CloseCurrentPopup();
155+ // }
156+
157+ // ImGui::EndPopup();
158+ //}
159+
138160 // --------------------------------------------- Objects
139161 ImGui::Spacing();
140162 if (SelectObject == 1)
@@ -144,11 +166,7 @@
144166
145167 if (ImGui::CollapsingHeader("Objects"))
146168 {
147- if (ImGui::Button(" Action "))
148- {
149- ImGui::OpenPopup("my_select_popup");
150- }
151-
169+
152170 ImGui::Indent();
153171 int Count = 0;
154172 while (Count < Object_Names_Count)
@@ -168,12 +186,35 @@
168186 }
169187
170188 ImGui::Bullet();
189+
171190 if (ImGui::Selectable(Object_Names_Vec[Count].c_str(), selected_Object == Count))
172191 {
192+
173193 if (SelectObject == 0)
174194 {
175195 selected_Object = Count;
176196 }
197+
198+ char buff[255];
199+ _itoa(Count,buff,10);
200+
201+ static char name[32] = "Label1";
202+ char buf[64]; sprintf(buf, "Button: %s###Button", name);
203+
204+ if (ImGui::BeginPopupContextItem())
205+ {
206+
207+ ImGui::Text("Edit name:");
208+ ImGui::InputText("##edit", buff, IM_ARRAYSIZE(buff));
209+ if (ImGui::Button("Close"))
210+ {
211+ ImGui::CloseCurrentPopup();
212+ }
213+
214+ ImGui::EndPopup();
215+ }
216+
217+
177218 strcpy(Selected_Object_Name, Object_Names_Vec[Count].c_str());
178219 selected_Sounds = -1;
179220 selected_Messages = -1;
@@ -190,25 +231,12 @@
190231
191232 if (Block == 1)
192233 {
234+ App->Cl_FileView_V2->RightMouseDown = 0;
193235 Update_Properties_Objects(Selected_Object_Name);
194236 }
195237
196238 // ------------------------------------------------- PoP Up
197- if (ImGui::BeginPopup("my_select_popup"))
198- {
199- if (ImGui::Selectable("Add"))
200- {
201- PopUp_AddObject();
202- }
203-
204- if (ImGui::Selectable("Rename"))
205- {
206- PopUp_Rename(selected_Object);
207- }
208-
209- ImGui::EndPopup();
210- }
211-
239+
212240 SelectObject = 0;
213241 ImGui::Unindent();
214242 }
--- GD19_OSDN/GD19_FileView_V2.h (revision 281)
+++ GD19_OSDN/GD19_FileView_V2.h (revision 282)
@@ -25,6 +25,7 @@
2525
2626 bool OpenObjects;
2727 bool SelectObject;
28+ bool RightMouseDown;
2829 int Chosen_Object_Index;
2930
3031 protected:
--- GD19_OSDN/GD19_OSDN.cpp (revision 281)
+++ GD19_OSDN/GD19_OSDN.cpp (revision 282)
@@ -783,6 +783,11 @@
783783 {
784784 App->Cl19_Ogre->m_imgui.mousePressed();
785785
786+ if (ImGui::GetIO().WantCaptureMouse)
787+ {
788+ App->Cl_FileView_V2->RightMouseDown = 1;
789+ }
790+
786791 if (!ImGui::GetIO().WantCaptureMouse)
787792 {
788793 if (App->OgreStarted == 1)
@@ -805,7 +810,7 @@
805810 case WM_RBUTTONUP:
806811 {
807812 App->Cl19_Ogre->m_imgui.mouseReleased();
808-
813+
809814 if (App->OgreStarted == 1)
810815 {
811816 /*if (App->GDCL_Scene_Data->S_Flags[0]->GameMode == 1)
@@ -819,6 +824,8 @@
819824 //}
820825 return 1;
821826 }
827+
828+ return 1;
822829 }
823830 // Left Mouse Button
824831 case WM_LBUTTONDOWN: // BERNIE_HEAR_FIRE
@@ -865,8 +872,11 @@
865872 return 1;
866873 }
867874 }
868- }break;
875+ }
876+
877+ return 1;
869878 }
879+
870880 case WM_LBUTTONUP:
871881 {
872882 App->Cl19_Ogre->m_imgui.mouseReleased();
@@ -881,6 +891,8 @@
881891 return 1;
882892 }
883893 }
894+
895+ return 1;
884896 }
885897 case WM_KEYDOWN:
886898 switch (wParam)
旧リポジトリブラウザで表示