StdApi.ThisMask

Post Reply
User avatar
Robert
Posts: 1024
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

StdApi.ThisMask

Post by Robert »

My memory has completely failed (too much Christmas celebration maybe?) I thought we had discussed these topics in the past, but these changes are not in 1.7.

The first issue is that when you use OpenAuxDialog or OpenToolDialog to open a Tab View an unwanted error message is posted. This is a 1 line fix I have been using since March 2009 - see the Violet code below.

The second issue is that when Form Views are loaded for use they are usually converted to Mask mode. However this does not apply to Forms on the tabs of a tab View.
The fix for this (which I have been using since January 2013) is in Magenta below.

Can anyone rememebr if this was discussed here before?

Code: Select all

	PROCEDURE ThisMask (param: ARRAY OF CHAR): Views.View;
		VAR v, tv, w: Views.View; c: Containers.Controller; rd: FormModels.Reader; k: INTEGER; label: Dialog.String;
	BEGIN
		v := ThisDialog(param);
		IF v # NIL THEN
			WITH v: Containers.View DO
				c := v.ThisController();
				IF c # NIL THEN
					c.SetOpts(c.opts - {Containers.noFocus} + {Containers.noCaret, Containers.noSelection});
					WITH c: FormControllers.Controller DO
						rd := c.form.NewReader (rd);
						LOOP
							rd.ReadView (tv);
							IF tv = NIL THEN EXIT END;
							WITH tv: StdTabViews.View DO
								FOR k := 0 TO tv.NofTabs() - 1 DO
									tv.GetItem(k, label, w);
									WITH w: Containers.View DO
										w.ThisController ().SetOpts(c.opts - {Containers.noFocus} + {Containers.noSelection,
											Containers.noCaret})
									ELSE
									END
								END
							ELSE
							END
						END
					ELSE
					END
				ELSE Dialog.ShowMsg("#System:NotEditable")
				END
			|	v: StdTabViews.View DO
			ELSE Dialog.ShowMsg("#System:ContainerExpected")
			END
		END;
		RETURN v
	END ThisMask

Code: Select all

StdCoder.Decode ..,, ..zT....3QwdONl9RhOO9vRbf9b8R7fJHPNGomCrlAyIhgs,CbKBhZ
 xi2,CoruKu4qouqm8rtuGfa4.hOO9vRb1Y66wb8RTfQ9vQRtIdvPZHWKqtCa.E.U5UAy.2U.Qk
 lbeZ3DPuP7PNNvQRtId9N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AAUidF...kd.69PM0Hk2.QcjpB.sEkyam4ak2ak2.98HbOFPM0Hk2.9
 eH7O1HM0a.g6U7U3Z7U7U3p7k2MF.HkWm2k2gcC,akWm2,7FHPMc9WqrSraCrnWGFCmdartGrm
 qKRuorGrWGqoGrk8KqKKFam4ak2AV3p7EyaEveHEC3.C566.98H....sETfP.98SVPN59R99N3
 N8PM0cHkWsCcI98JfeIR86hP1HMFRGEGJoaaBVvgV0CyIhACoruam,CbHZiYRcoJigZcZRiX3U
 lb8..umV.EWKqtCK.Q6AAsQUm,..Unp3.6F6.Z50.G,0.aU.E..k.8ssH38pumqm8rtumdcIf9
 PY62Ulb8.CLL8pumqmY62UmT.6.QJw.QI2U.sU.ktumdsIdPSNPN7ONbvM,Mw.ELMSN12Um5,2
 ..FU.I92U.E,,.RNEdHtIAKa2V.6,6..UYU.AU.U.UUQoO7.,E.SoA5UTyB4.4.0E.cUZj0E..
 UO.,.1.eWUbl,.,6Y1.0..TK....
 --- end of encoding ---
Zinn
Posts: 476
Joined: Tue Mar 25, 2014 5:56 pm
Location: Frankfurt am Main
Contact:

Re: StdApi.ThisMask

Post by Zinn »

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

Re: StdApi.ThisMask

Post by Robert »

Thanks Helmut; that makes more sense.

The second problem above has a better fix than the one I suggested, which is why I could not see my code in 1.7. I have not observed any problem here recently.

What I did observe today was the first problem above, which maybe we have not previously discussed here.

When a Tab View is loaded the Log receives the unwanted error message "container expected". The solution (I propose) is to add the single line

Code: Select all

			|	v: StdTabViews.View DO
to

Code: Select all

	PROCEDURE ThisMask (param: ARRAY OF CHAR; useLang: BOOLEAN): Views.View;
		VAR v: Views.View; c: Containers.Controller;
	BEGIN
		v := ThisDialog(param, useLang);
		IF v # NIL THEN
			WITH v: Containers.View DO
				c := v.ThisController();
				IF c # NIL THEN
					c.SetOpts(c.opts - {Containers.noFocus} + {Containers.noCaret, Containers.noSelection});
					IF modeHook # NIL THEN modeHook(c) END
				ELSE Dialog.ShowMsg("#System:NotEditable")
				END
			|	v: StdTabViews.View DO
			ELSE Dialog.ShowMsg("#System:ContainerExpected")
			END
		END;
		RETURN v
	END ThisMask;
User avatar
Josef Templ
Posts: 2047
Joined: Tue Sep 17, 2013 6:50 am

Re: StdApi.ThisMask

Post by Josef Templ »

Robert, also the first issue has been discussed before.
See http://forum.blackboxframework.org/view ... t=10#p2885 where
you mentioned that it is not required.

"No, I guess it is not really necessary, and the error message to the Log is a very minor problem."

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

Re: StdApi.ThisMask

Post by Robert »

I am currently moving some projects from (my slightly hacked version of) 1.6 to 1.7 (dated 31-Dec-2016).

This problem, which I had forgotten about, has resurfaced; I had added this extra line to my 1.6 version of ThisMask which is why I haven't been troubled by it.

I thought that a cleaner fix would be to simply put the TabView I use onto a Form of the same size.

Issue 1 - My code that finds the TabView no longer works; it finds the enclosing Form. This issue has a simple solution, and I only have to make the change in 1 place, so no problem.

Issue 2 - On the Tabs of the TabView are other Views that need to be Focus to operate correctly. But the enclosing Form is Focus, so these Views don't work. I can't see an easy solution to this.

Having these spurious error messages is unwelcome, so I am now thinking of raising this as a bug.
User avatar
Josef Templ
Posts: 2047
Joined: Tue Sep 17, 2013 6:50 am

Re: StdApi.ThisMask

Post by Josef Templ »

If you use OpenAuxDialog or OpenToolDialog to open a view you normally
expect the view to be opened in "mask" mode.
If you do not expect it to be opened in mask mode would it be an option to open it with
OpenAux, for example?

Regarding the proposed fix:
Instead of adding special treatment for tab views for suppressing the error
message, it would be simpler and more general to remove the error message at all.
The docu allows this, I think.

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

Re: StdApi.ThisMask

Post by Robert »

Josef Templ wrote:If you do not expect it to be opened in mask mode would it be an option to open it with
OpenAux, for example?
Thanks.
As far as I can tell this seems to be a perfectly satisfactory solution.
(The behaviour is different - the Window can be maximised - but this is of no consequence.)

My next question (my first as Chairman) is: "How do I move this thread to the resolved group?"
Ivan Denisov
Posts: 1700
Joined: Tue Sep 17, 2013 12:21 am
Location: Russia

Re: StdApi.ThisMask

Post by Ivan Denisov »

Robert wrote:My next question (my first as Chairman) is: "How do I move this thread to the resolved group?"
Robert, please sorry for the delay. I did not read carefully this part of your post previous time. Usually I am moderating the board. However if you want I can add you to the administrators group and you also will be able to moderate the board. Do you want to be a moderator?
User avatar
Robert
Posts: 1024
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Re: StdApi.ThisMask

Post by Robert »

Ivan Denisov wrote:Do you want to be a moderator?
I don't think so. I asked because I am trying to do my share of the work, but recognise that since different people have different amounts of time, differerent background knowledge, and different personal motivations, we won't all do equal shares of all tasks.

In this case it is probably easier for both of us if you move it, rather than teaching me how to move it.

Regarding the vote for "Interface change" Doug has sent me the directions you sent him about updating the git unstable version (assuming the vote passes). But I don't know how to create a voting form in phpBB. Do I need to be a moderator to do that? Are the instructions already published (maybe in the Wiki)?
I will try and do this in the next couple of days.
Ivan Denisov
Posts: 1700
Joined: Tue Sep 17, 2013 12:21 am
Location: Russia

Re: StdApi.ThisMask

Post by Ivan Denisov »

You can create poll, just use the tab bellow the form of New Topic like I am showing in this picture
Attachments
poll.png
Post Reply