Hook Requests - Wiki

This forum is for programmers who have questions about the source code.
Post Reply
User avatar
jsalmon
Posts: 1553
Joined: Tue Nov 30, 2010 12:33 pm
Contact:

Hook Requests - Wiki

Post by jsalmon » Thu Apr 02, 2015 12:03 pm

Add FormOpenDental.menuItemWiki_Click to FormOpenDental

Code: Select all

private void menuItemWiki_Click(object sender,EventArgs e) {
	if(Plugins.HookMethod(this,"FormOpenDental.menuItemWiki_Click")) {
		return;
	}
	if(FormMyWiki==null || FormMyWiki.IsDisposed) {
		FormMyWiki=new FormWiki();
	}
	FormMyWiki.Show();
	if(FormMyWiki.WindowState==FormWindowState.Minimized) {
		FormMyWiki.WindowState=FormWindowState.Normal;
	}
	FormMyWiki.BringToFront();
}
Add a hook skip and an add code towards the end of FormWiki_Load:

Code: Select all

private void FormWiki_Load(object sender,EventArgs e) {
	//disable the annoying clicking sound when the browser navigates
	CoInternetSetFeatureEnabled(FEATURE_DISABLE_NAVIGATION_SOUNDS,SET_FEATURE_ON_PROCESS,true);
	webBrowserWiki.StatusTextChanged += new EventHandler(WebBrowserWiki_StatusTextChanged);
	Rectangle rectWorkingArea=System.Windows.Forms.Screen.GetWorkingArea(this);
	Top=0;
	Left=Math.Max(0,((rectWorkingArea.Width-960)/2)+rectWorkingArea.Left);
	Width=Math.Min(rectWorkingArea.Width,960);
	Height=rectWorkingArea.Height;
	LayoutToolBar();
	historyNav=new List<string>();
	historyNavBack=0;//This is the pointer that keeps track of our position in historyNav.  0 means this is the newest page in history, a positive number is the number of pages before the newest page.
	if(Plugins.HookMethod(this,"FormWiki.FormWiki_Load_beforeHomePageLoad")) {
		goto HookSkipHomePageLoad;
	}
	LoadWikiPage("Home");
	HookSkipHomePageLoad: {}
	Plugins.HookAddCode(this,"FormWiki.FormWiki_Load_end");
}
The best thing about a boolean is even if you are wrong, you are only off by a bit.

Jason Salmon
Open Dental Software
http://www.opendental.com

allends
Posts: 235
Joined: Fri Aug 23, 2013 11:29 am

Re: Hook Requests - Wiki

Post by allends » Thu Apr 02, 2015 2:05 pm

Hooks added to 15.1.18
Allen
Open Dental Software
http://www.opendental.com

Post Reply