Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add SCN_MARGINRIGHTCLICK returns #251

Merged
merged 2 commits into from Nov 3, 2022
Merged

add SCN_MARGINRIGHTCLICK returns #251

merged 2 commits into from Nov 3, 2022

Conversation

vinsworldcom
Copy link
Contributor

@vinsworldcom vinsworldcom commented Nov 1, 2022

fix #250 .

Output of test script now with left-click and then right-click (with expected output):

{'code': 2010, 'idFrom': 0, 'hwndFrom': 9177554, 'margin': 2, 'position': 0, 'modifiers': 0}
{'code': 2031, 'idFrom': 0, 'hwndFrom': 9177554, 'margin': 2, 'position': 0, 'modifiers': 0}

(tested using the AppVeyor artifact : https://ci.appveyor.com/project/bruderstein/pythonscript/builds/45246939 "Release/64-bit")

Cheers.

@chcg
Copy link
Collaborator

chcg commented Nov 3, 2022

I would have expected that this is created automatically via script
https://github.com/bruderstein/PythonScript/blob/master/PythonScript/src/CreateWrapper.py
from

evt void StyleNeeded=2000(int position)
evt void CharAdded=2001(int ch, int characterSource)
evt void SavePointReached=2002(void)
evt void SavePointLeft=2003(void)
evt void ModifyAttemptRO=2004(void)
# GTK Specific to work around focus and accelerator problems:
evt void Key=2005(int ch, int modifiers)
evt void DoubleClick=2006(int modifiers, int position, int line)
evt void UpdateUI=2007(int updated)
evt void Modified=2008(int position, int modificationType, string text, int length, int linesAdded, int line, int foldLevelNow, int foldLevelPrev, int token, int annotationLinesAdded)
evt void MacroRecord=2009(int message, int wParam, int lParam)
evt void MarginClick=2010(int modifiers, int position, int margin)
evt void NeedShown=2011(int position, int length)
evt void Painted=2013(void)
evt void UserListSelection=2014(int listType, string text, int position, int ch, CompletionMethods listCompletionMethod)
evt void URIDropped=2015(string text)
evt void DwellStart=2016(int position, int x, int y)
evt void DwellEnd=2017(int position, int x, int y)
evt void Zoom=2018(void)
evt void HotSpotClick=2019(int modifiers, int position)
evt void HotSpotDoubleClick=2020(int modifiers, int position)
evt void CallTipClick=2021(int position)
evt void AutoCSelection=2022(string text, int position, int ch, CompletionMethods listCompletionMethod)
evt void IndicatorClick=2023(int modifiers, int position)
evt void IndicatorRelease=2024(int modifiers, int position)
evt void AutoCCancelled=2025(void)
evt void AutoCCharDeleted=2026(void)
evt void HotSpotReleaseClick=2027(int modifiers, int position)
evt void FocusIn=2028(void)
evt void FocusOut=2029(void)
evt void AutoCCompleted=2030(string text, int position, int ch, CompletionMethods listCompletionMethod)
evt void MarginRightClick=2031(int modifiers, int position, int margin)
evt void AutoCSelectionChange=2032(int listType, string text, int position)

but that seems to be not the case for notifications and therefore all notifications need to be checked if they are still uptodate.

@vinsworldcom
Copy link
Contributor Author

but that seems to be not the case for notifications and therefore all notifications need to be checked if they are still uptodate.

Should that be done in a separate pull request? This one addresses the open issue for SCN_MARGINRIGHTCLICK #250. A separate PR to make any necessary updates to other notifications?

Cheers.

@vinsworldcom
Copy link
Contributor Author

therefore all notifications need to be checked if they are still uptodate

A quick glance between the PythonScript 'Scintilla.h' (PythonScript\PythonScript\src\Scintilla.h), the Scintilla docs and the 'ScintillaWrapper.cpp' file yields this:

			case SCN_CHARADDED:
				params["ch"] = notifyCode->ch;
+				params["characterSource"] = notifyCode->characterSource;
				break;

			case SCN_USERLISTSELECTION:
+				params["ch"] = notifyCode->ch;
+				params["listCompletionMethod"] = notifyCode->listCompletionMethod;
				params["text"] = notifyCode->text;
				params["listType"] = notifyCode->listType;
                params["position"] = notifyCode->position;
				break;

			case SCN_AUTOCSELECTION:
+				params["ch"] = notifyCode->ch;
+				params["listCompletionMethod"] = notifyCode->listCompletionMethod;
				params["text"] = notifyCode->text;
                params["position"] = notifyCode->position;
				break;

+			case SCN_AUTOCSELECTIONCHANGE:
+				params["position"] = notifyCode->position;
+				params["text"] = notifyCode->text;
+				params["listType"] = notifyCode->listType;

+			case SCN_AUTOCCOMPLETED:
+				params["listCompletionMethod"] = notifyCode->listCompletionMethod;
+				break;

Would obviously need to update the 'PythonScript\docs\source\enums.rst' file as well for documentation.

Shall I open a separate issue / PR for these?

Cheers.

@vinsworldcom
Copy link
Contributor Author

but that seems to be not the case for notifications

Maybe this explains why?

out.write("""\n/* The following is the enum of events/notifications.
* Note that the PYSCN_XXX constants are NOT automatically generated (in ScintillaNotifications.h).
* This is very deliberate.
* An error here indicates that a new notification has been added,
* and hence handler code should be added to the ScintillaWrapper::notify() function
*/\n""")

@chcg
Copy link
Collaborator

chcg commented Nov 3, 2022

@vinsworldcom It was more a remainder to me that the check would be necessary. But if you are willing to create a new PR for that I would be happy.

@chcg chcg merged commit 6faf9aa into bruderstein:master Nov 3, 2022
@vinsworldcom vinsworldcom deleted the marginrightclick branch November 7, 2022 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SCN_MARGINRIGHTCLICK does not return margin
2 participants