Closed GaikwadPratik closed 2 years ago
Good stuff.
I just tested setting CanFocus = true
and it def helps with tabbing around etc... However, it also disables scrolling in the TextView.
So I need to revisit how the help text view works.
After pulling recent changes from @BDisp, I can confirm Task 2 is fixed. I can navigate between controls using tab
and Shift + Tab
buttons.
@tig,
Though I have one more question, how do I capture values of child controls when wizard.MovingNext
and wizard.Finished
are fired?
@GaikwadPratik for Task 1 see #1808
@tig, Though I have one more question, how do I capture values of child controls when
wizard.MovingNext
andwizard.Finished
are fired?
I think you have to use the available events and save to variables of your implementation class scope.
Yup, I needed up implementing custom interface, and then calling methods based on current index and collection :)
Don't forget that Wizard API
already implements some events. See the Wizard
scenario where you can get any value you want from whatever step you want.
@GaikwadPratik for Task 1 see #1808
That is what I tested locally here. Thought I was not sure if you guys would prefer to expose it or keep it hardcoded.
Don't forget that
Wizard API
already implements some events. See theWizard
scenario where you can get any value you want from whatever step you want.
Yup, I used those. I was just asking if there is any better way. I ended up using like
var eulaStep = new Eula();
var hostnameStep = new Hostname();
var passwordStep = new Password();
var lstInstance = new List<HiveView>()
{
eulaStep,
hostnameStep,
passwordStep
};
foreach (var step in lstInstance)
{
wizard.AddStep(step.LoadView());
}
var stepIndex = 0;
wizard.CurrentStepChanged += (args) =>
{
stepIndex = args.CurrentStepIndex;
};
wizard.MovingNext += (args) =>
{
var instance = lstInstance[stepIndex];
if (instance != null)
{
var result = instance.ReadValues(ref test);
if (!result)
{
args.Cancel = true;
}
}
};
wizard.Finished += (args) =>
{
var instance = lstInstance[stepIndex];
if (instance != null)
{
var result = instance.ReadValues(ref test);
if (!result)
{
args.Cancel = true;
}
}
};
hardcoded
In my pr it's hardcoded on the Wizard text help. If you mean on the TextView
itself I don't see any advantage of that.
no.. On the HelpText
only.
no.. On the
HelpText
only.
That is done if @tig merge the pr.
Yup, I used those. I was just asking if there is any better way. I ended up using like
That fine. In each step hostnameStep, passwordStep, passwordStep you must provide properties if you want to access data or pass data between them.
@BDisp , @tig ,
Can you please revert removal of CurrentStepChanged or at least return CurrentStepIndex
StepChangeEventArgs
I refactored the api to not use indexes. I’m sorry if this causes you issues but it makes for a cleaner api.
-cek Sent via mobile. Expect brevity, typos, and dangerous driving.
From: Gaikwad Pratik @.> Sent: Thursday, June 16, 2022 10:06:34 AM To: migueldeicaza/gui.cs @.> Cc: Charlie Kindel @.) @.>; Mention @.***> Subject: Re: [migueldeicaza/gui.cs] Controls in Wizard component (Issue #1794)
@BDisphttps://github.com/BDisp , @tighttps://github.com/tig ,
Can you please revert CurrentStepChangedhttps://github.com/GaikwadPratik/gui.cs/commit/2451c19d15427483401a307eb2a25adf2132ed7f#diff-80667e50af93e83ed15e0e23bc605f1e8adfee09661d6a466f2ca88827c09f52L373 or at least return CurrentStepIndex StepChangeEventArgshttps://github.com/migueldeicaza/gui.cs/blob/main/Terminal.Gui/Windows/Wizard.cs#L580
— Reply to this email directly, view it on GitHubhttps://github.com/migueldeicaza/gui.cs/issues/1794#issuecomment-1157923521, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAEO6CUQMVKB5J5RMENMPILVPNNJVANCNFSM5YUXTDRQ. You are receiving this because you were mentioned.Message ID: @.***>
Ok. Makes sense. I will manage that internally. Can please can close the ticket that I opened this morning?
On Thu, Jun 16, 2022 at 3:43 PM Tig Kindel @.***> wrote:
I refactored the api to not use indexes. I’m sorry if this causes you issues but it makes for a cleaner api.
-cek Sent via mobile. Expect brevity, typos, and dangerous driving.
From: Gaikwad Pratik @.> Sent: Thursday, June 16, 2022 10:06:34 AM To: migueldeicaza/gui.cs @.> Cc: Charlie Kindel @.) @.>; Mention @.***> Subject: Re: [migueldeicaza/gui.cs] Controls in Wizard component (Issue
1794)
@BDisphttps://github.com/BDisp , @tighttps://github.com/tig ,
Can you please revert CurrentStepChanged< https://github.com/GaikwadPratik/gui.cs/commit/2451c19d15427483401a307eb2a25adf2132ed7f#diff-80667e50af93e83ed15e0e23bc605f1e8adfee09661d6a466f2ca88827c09f52L373> or at least return CurrentStepIndex StepChangeEventArgs< https://github.com/migueldeicaza/gui.cs/blob/main/Terminal.Gui/Windows/Wizard.cs#L580
— Reply to this email directly, view it on GitHub< https://github.com/migueldeicaza/gui.cs/issues/1794#issuecomment-1157923521>, or unsubscribe< https://github.com/notifications/unsubscribe-auth/AAEO6CUQMVKB5J5RMENMPILVPNNJVANCNFSM5YUXTDRQ
. You are receiving this because you were mentioned.Message ID: @.***>
— Reply to this email directly, view it on GitHub https://github.com/migueldeicaza/gui.cs/issues/1794#issuecomment-1158234428, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKWA75URK7RNN2PKMOECX3VPOUYJANCNFSM5YUXTDRQ . You are receiving this because you were mentioned.Message ID: @.***>
Describe the bug Related #124
HelpText
should not allowed to be focused, since it is just helper text to be used as guidance. So either exposeHelpTextView
as public component or change the behavior by addingCanFocus = false
.Agree with @BDisp's comment here. Focus doesn't go back to
next
if your first wizard step hasscrollbar
in it. If you add below step as first step, and scrolled through long text(not necessarily completely), you can not focus onnext
button of Wizard usingTab
key. This is not feasible if you don't have mouse to navigate, like in remote server environments where wizard will be used for installation in terminal.To Reproduce Steps to reproduce the behavior:
Expected behavior Should be able to navigate using
Tab
orShift + Tab
keysScreenshots