Compatibility with 1.7

Folding menus: http://zinnamturm.eu/downloadsAC.htm#CpcDropDown
Post Reply
User avatar
Ivan Denisov
Posts: 362
Joined: Tue Sep 17, 2013 12:21 am
Location: Krasnoyarsk, Russia

Compatibility with 1.7

Post by Ivan Denisov »

Robert wrote:I am porting some of my files to 1.7, which is quite a big job. It is surprising how often I made the "IN" to "VAR" error, which is now being detected!

One immediate problem is I can't get CpcDropDown to work. Am I missing something obvious, or is there a problem here? It compiles fine.
Zinn
Posts: 123
Joined: Mon Nov 24, 2014 10:47 am
Location: Frankfurt am Main
Contact:

Re: Compatibility with 1.7

Post by Zinn »

here is the solution about CpcDropDown:

Add two times the line
Dialog.Call("CpcDropDown.MakeDropDowns", "", res);

1. Module Std/Mod/MenuTool.odc in the procedure UdateAllMenu

Code: Select all

	PROCEDURE UpdateAllMenus*;
		VAR view: Views.View; t: TextModels.Model; s: TextMappers.Scanner;
			loc: Files.Locator; res: INTEGER;
	BEGIN
		InitNotifier;
		loc := Files.dir.This(sysDir); IF loc = NIL THEN RETURN END;
		loc := loc.This(rsrcDir); IF loc = NIL THEN RETURN END;
		view := Views.OldView(loc, menuFile);
		IF (view # NIL) & (view IS TextViews.View) THEN
			t := view(TextViews.View).ThisModel();
			IF t # NIL THEN
				s.ConnectTo(t); Scan(s);
				noerr := TRUE; showerr := TRUE; gen := FALSE; ParseMenus(s, view, loc, menuFile);
				IF noerr THEN
					s.SetPos(0); Scan(s); gen := TRUE;
					HostMenus.DeleteAll; ParseMenus(s, NIL, NIL, ""); HostMenus.InitMenus;
					Dialog.Call("CpcDropDown.MakeDropDowns", "", res);
				ELSE
					Dialog.ShowMsg("errors detected in menu file");
				END
			END
		ELSE Dialog.ShowMsg("cannot open menu file")
		END;
		includes := NIL
	END UpdateAllMenus;
2. Module System/Mod/Config.odc in the procedure Setup

Code: Select all

		...
		OleData.Register("", "OleData.ExportPicture", "METAFILEPICT", "", {});

		Dialog.Call("CpcDropDown.MakeDropDowns", "", res);
		Dialog.Call("ToolbarStd.PutToolbar", "", res);
		Dialog.Call("StdLog.Open", "", res)
	END Setup;
and it works.

- Helmut
User avatar
Robert
Posts: 177
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Re: Compatibility with 1.7

Post by Robert »

Zinn wrote:Here is the solution about CpcDropDown:

Add two times the line Dialog.Call("CpcDropDown.MakeDropDowns", "", res);
...
and it works.
Thanks. It works for me too.

I should have read the Quick-Start! The last time I read it was probably 2004.

Actually I am not very happy about your suggested change to the Module StdMenuTool; the suggestion in the Quick-Start that this line is added to the Dev Menu item seems to be better than altering a standard source code (Mod) file. (Except for System/Mod/Config, which one expects to customise to suit your own configuration). Is there a reason to alter this Mod file?
Zinn
Posts: 123
Joined: Mon Nov 24, 2014 10:47 am
Location: Frankfurt am Main
Contact:

Re: Compatibility with 1.7

Post by Zinn »

Robert wrote:Actually I am not very happy about your suggested change to the Module StdMenuTool ...
… but you prefer to search the whole day, why the menu is not working.
Robert wrote: Is there a reason to alter this Mod file?
Yes, to make it more user friendly. How to explain novice user the menu is not working after “Info -> Update Menus”. You have to execute an additional command (which one?) or leave BlackBox and restart it for using the menus again. Even expert user may not remember this.

When my proposal has not been discarded this discussion would not exist.
- Helmut
User avatar
Ivan Denisov
Posts: 362
Joined: Tue Sep 17, 2013 12:21 am
Location: Krasnoyarsk, Russia

Re: Compatibility with 1.7

Post by Ivan Denisov »

Zinn wrote:When my proposal has not been discarded this discussion would not exist.
It is strange to assume the existence of any concrete extensions in the universal framework. It is not good design idea.
Zinn
Posts: 123
Joined: Mon Nov 24, 2014 10:47 am
Location: Frankfurt am Main
Contact:

Re: Compatibility with 1.7

Post by Zinn »

Somebody would like to have this kind of extension to the menu and somebody not. So what? You haven't to install CpcDropDown if you don't like it. When it isn't allow to do such kind of extension then I have to withdraw also this subsystem.
- Helmut
User avatar
Ivan Denisov
Posts: 362
Joined: Tue Sep 17, 2013 12:21 am
Location: Krasnoyarsk, Russia

Re: Compatibility with 1.7

Post by Ivan Denisov »

Zinn wrote:Somebody would like to have this kind of extension to the menu and somebody not. So what? You haven't to install CpcDropDown if you don't like it. When it isn't allow to do such kind of extension then I have to withdraw also this subsystem.
Strange logic. We can think about some hook for menus update. But it should not be related to any specific extension.
Josef Templ
Posts: 262
Joined: Tue Sep 17, 2013 6:50 am

Re: Compatibility with 1.7

Post by Josef Templ »

Can somebody summarize what the problem with CpcDropDown is?
I mean, "explain" the problem, not repeating the required source changes.

I am also using CpcDropDown but did not experience any problems when migrating to 1.7.

- Josef
User avatar
Robert
Posts: 177
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Re: Compatibility with 1.7

Post by Robert »

Josef Templ wrote:Can somebody summarize what the problem with CpcDropDown is?
There is no problem with CpcDropDown.

I had a problem because I had not installed it properly (as described in its "Quick-Start"). I was in the process of copying my files into 1.7, and in the intermediate state that some updated Menus wanted to use it, but I had not yet updated the Menu that enabled it, there was an apparent problem.
Post Reply