Custom Activity Designer(like FlowChart activity) in WF4.0 - workflow-foundation-4

Is it possible to create a Custom activity, same as Flow Chart Activity?
As Flow Chart activity is a sealed class, we can not use it directly, so is it possible to place a Panel(for holding other activity) and the re-sizable grip in the expand view of the Custom activity, so that user can increase and decrease the size of the activity by dragging the corners of the activity.
Thanks in advance.

Yes, you can create any activity, or ActivityDesigner as you need, yourself. However the FlowChartDesigner is one of the more complex designers. As you noticed most WF4 classes are sealed so it would be quite a bit of work as you would have to rebuild it from the ground up.

Related

How to pass custom listener from Fragment to VM in MVVM?

My app has a bottom nav with 3 Fragments where first one has a ViewPager with tablayout each having their own Fragments.
What I want to do is change the content of fragments of viewpager fragments depending on the selection of Spinner selected.
How do i implement a listener to listen for change in Spinner to change the data calls to repo in each of the ViewModels.
Any other solutions are also welcome.
This may not be ideal solution, but I was able to work it out using SharedPreference and SharedPreference Listener. I also came across LiveData to observe SharedPreference, but this was easier and much simpler. Also see this answer

Qt model for chat widget

I need to create a chat widget for communication with toy satellite. The satellite can send a child text or a picture, while a child can send only text.
I am programming this app on Qt, but stuck with proper model creation. Sure it have to be a list model, but in my case I've got two types of messages (picture or text) and also some additional data, like date and location (last only in messages from satellite).
What class I better to subclass or use as is for my task? Is standard model?enough or I need to subclass list abstract model?
Also I red, that some customization can be done even inside a model, like font color and so on. I am just wondering, is it a right place for it, or I better set background color of messages in delegate?
Just to mention, this class will be then used in a qml.
I think the easiest way for you is to go with QTreeWidget()

JavaFX nodes - How to make them resizable by the end user?

I am developing a JavaFX application where a class I have developed (extended from javafx.scene.Parent) is created on-the-fly based on what entry the user has clicked in a ListView control.
Just to be clear about this node, it is not created using a layout tool like SceneBuilder, it is created at runtime based on the user's actions.
The constructor for my custom node class creates a VBox and a Label and uses passed coordinates (X,Y) in the constructor method to set its own Layout coords. I then use a custom utility class to make the node draggable. This new node is then added to the main application Pane.
However, I have failed to find out how I can make these nodes resizable by the user. That is, allow the user to mouse over the corner of the node, hold and drag to resize. An operation that all users are used to, no matter what the OS.
Has anyone done anything like this in JavaFX? (My searches on the subject only seem to pull up subjects on the automatic resizing that a parent node does with its child nodes.)
Many thanks,
Ian.
As you can see on the documentation of VBox you can only define minimum, prefered and maximum range, there's not really a way to make it manually resizable.
The only proper solution to solve your problem is to develop your own class to do it, because what you want seems very specific, with your problem description, I don't think use some layouts or panels will do what you exactly want.
I found something that you can use : Dragging to resize a JavaFX Region
This allows you to resize a region, all you have to do after is to put you VBox in this region, but notice in this article that :
Only height resizing is currently implemented.
This code won't work in JavaFX8, you'll have to check the comment to see how it worls in JavaFX8
Hope this helps.

Downsides of using UINavigationController only for the UINavigationBar?

I have a UITabBarController with four view controllers. Two of those need to be UINavigationControllers the other two don’t. However, I want to show the same UINavigationBar layout on each of these controllers. I could of course add a UINavigationBar to the two normal view controllers, however, I would prefer to have one UIViewController base class which creates the bar items and subclass all four view controllers from this base class.
The simplest way to make this work is to wrap all four view controllers in a UINavigationController, even though in two case the navigational aspect won't actually be used. Are there any downsides to this approach and/or are there better simple alternatives?
The only downside I could see are possibly a (VERY marginally) slower load time of the view and the lack of space for uibuttons (if you need more than just 2 buttons, then you're very nearly out of luck) . Uinavigationcontroller instantiation is usually done in the viewDidLoad method or in the application delegate. What I would recommend is simply making the uitoolbar's height rect 44.0 (or I've heard 45 being tossed around) and setting it's background color to that of a navigationbar.
Overall, unless every nanosecond counts in app loading (LOL) I would see no huge issues when using only uinavigationbars.
Cheers (apologies for how long your question went unanswered).

Start Activity in a Fragment

I want to start an activity in a fragment and the activity is just like any other installed applications. eg. Email.
I get the intent of that application from PackageManager, now I want to start that activity in my seperate Fragment. Whenever I use startActivityFromFragment is starts the application in whole screen, but I want to start that activity limited in only that fragment.
What should I do?
Drop the idea as it doesn't really make sense and I can't see that it can be done anyway.
For example if you have a dual-pane layout and want to invoke the contacts app into the right fragment which itself uses a dual-pane layout along with making use of the application bar how would you expect it to look? It's the contacts app that is making the call to setContentView and deciding how to layout itself out, not your app. If I'm mistaken in what you mean and it's your activity then of course you can create a fragment from it and load into your required view.

Resources