Example for custom Range in Gtkmm - gtkmm

I am working on a Potentiometer style widget in Gtkmm and I'd like to use Range as the baseclass.
Does anyone know of a proper example for doing this?

I'm not sure exactly what you're asking for. I know that there is a simple example of using the range widget here. It does handle the creation of the Adjustment object that you'll need. You'll need to define an abstract potentiometer class, then create your vertical and/or horizontal potentiometers separately for flexibility.
The closest thing that I could find to an example of what you'd need to override in order to make your own custom range-like widget is on Old Nabble.
I wish that I could give you more help with this, but I'm rather new to Gtkmm.

Related

Button object in Qlik Sense

How can I use a button object in Qlik sense the same way it is in Qlikview? Qlik Sense has no button object in the default objects as it is in Qlikview.
Thanks in advance!
Ziad
This is not currently within QlikSense, however extensions can be used to add more functionality.
How to add extensions
https://community.qlik.com/docs/DOC-7033
Where to find extensions
http://branch.qlik.com/
This extension may be what you are looking for
http://branch.qlik.com/#/project/570663af9a200590510ae281
there is a link for extension which enables you the option of downloading the extensions for qliksense. There by u can create the buttons like qlik view. Follow the steps as the link tells you.
http://branch.qlik.com/?&_ga=1.205648019.1497078496.1393695932#!/project/56728f52d1e497241ae698a0
have a look at https://github.com/stefanwalther/sense-navigation
This solution not only allows you to add a button to your sheet, but also to selection from a variety of actions like:
gotoNextSheet
gotoPrevSheet
Set variable value
open website
...
Although the question is quite old, it is worth noting that buttons are now part of standard Qlik Sense charts.

Mapkit Searchbar Autocomplete Ios8

I'm trying to implement an Autocomplete on a search bar on a map using Mapkit. I found this :
https://github.com/chenyuan/SPGooglePlacesAutocomplete
Works and is totally perfect except that it uses UISearchDisplayViewController which has been deprecated in ios8 and replaced by UISearchViewController. Is there a way around it or a simpler way than the one mentioned above?
Thanks in Advance
Please try this new repo: https://github.com/hkellaway/HNKGooglePlacesAutocomplete, which is being actively maintained.
Apple provides a full autocomplete for the entire English language (and others) but if you want to implement your own autocomplete it's not too difficult, you simply need the range of words or phrases that you want to suggest and a way of ranking them in order of frequency used.
I've implemented a simple autocomplete in one of my projects that centers around a PredictionString class and an AutopredictCoordinator class.
The PredictionString has a NSString property and a float property which relates to the strings frequency of use by the user. The AutopredictCoordinator then holds an array of prediction strings and responds to requests for the most likely completion of any given string.

ZoomedOutView with disabled keys

Does anybody know how to reproduce the ZoomedOutView like in the following picture:
Picture http://img690.imageshack.us/img690/2981/84364982.png
I have a solution that probably works but I think we can do that differently.
My solution :
Add all the keys in the binded and grouped collection
Create a converter Int32 to Booleab
Bind the enabled property to Group.Values.Count and apply the converter
Modify the GridViewItem style to change the Background property
Is there an easier way to do that ?
Thanks in advance
Those steps sound about right and should be the most straightforward way to get to what you want.
One place you might run into trouble is with getting the Group counts. Depending on what you're using for grouping you may get an IEnumerable with only the Count() extension method available and not a real Count property that would be bindable. This would be the case if you were using LINQ's GroupBy for example.

Simplest possible way to show two items NSTableView from code?

How I can create a code in XCode 4.2.1 what will create NSTableView and add just couple of items to it?
All what I wanted to do is:
1) Window where is NSTableView
2) I have an array of strings in NSArray which I like to show in that NSTableView
3) All of this should be done in code. So I don't want to learn how to add this action happen when you press button (I know already how to do actions when user click buttons etc), I just want that application launch -> draws the table where is those items from my array. That's it, nothing more.
And yeah I have understood that I do not add items to NSTableView directly. That is not the point in this question. I just mean that I want to show couple of items in that table but I have no and kind of clue WHERE I should add my data from my array.
I have tried to google for example pages for hours (just too many and have not find help) but I will always be stucked in the part when
a) I must do something in the Interface Builder and the images of the interface builder are from version 2.x or 3.x and I have 4.2.1 and it is totally different (new to XCode...). Surely I have drawn my TableView element to UI but I mean delegations etc. Are those necessary at all? Can those be made from source code?
b) Code just does not work anymore because language (Cocoa or Objective-C, I don't know) has changed and I don't know how and what I have to do to make it work on newest version of XCode.
c) There is too much different ways told: "use binding", "you must create new class what is NSTableViewDataSource" etc. I have no any kind of clue what is preferred way, is another way optional or it is "you should use this because another is going deprecated soon" or something.
So please, can somebody give help in step-by-step what I exactly have to do? Should I create some bindings? If so, how and where? Do I have to create DataSource component myself? Are those ways valid any more? If I have to, how I can create it? Create a new class and implement it as a NSTableViewDataSource and then use it? Is that way valid any more and if it is, can sombody show code what is as simple as possible?
I have also checked Apple Documentation page many many times, checked those example codes but there is just too much totally unrelated stuff that I just don't understand at this point so they are totally useless (I mean, I don't know what is required for this task, what are not etc.
I would be very happy if somebody can help short tutorial step-by-step what to do. I mean "step-by-step" like:
1) Create new project
2) Draw NSTableView in project
3) Create new class with this name
4) Write this code: blah blah blah
5) Create another class with this name
6) Write this code
7) Run and see those items from array in NSTableView using (bindings/datasource/whatever is preferred).
Thanks :)
Your tableview needs a datasource. Your datasource is a custom class, it implements the "NSTableViewDataSource" protocol. This protocol contains a few methods that you can use to tell the tableview what data you got.
this includes the objectValue ( the value of the NSCell that is displaying your data on the specified row, and a method that returns the amount of rows the tableview has ( the amount of items in your array ).
Here a tutorial I found by googling:
CocoaDev.com NSTableView tutorial
You can also implement the NSTableViewDelegate protocol which allows some greater control. Like what rows you can select, or some extra configuring of a custom tableview cell.
I must say that back in the day when I started developing desktop applications ( only had experience with web technologies ) that this design pattern confused me as well. Hope you will get your mind round it soon.

NSTableView, multiple cells and bindings

I'm trying to create a view that's similar to Motion's properties views.
Each of my property objects contains a definition of the kind of cell it wants to display as. But at the same time, I'd like to use bindings so that values are automatically updated as they can be changed elsewhere.
I've tried a few different approaches to the problem.
Multiple cells and dataCellForTableColumn: while this allows rendering to happen properly for all cell types, I lose bindings.
NSProxy: I've also tried using a proxy object that I thought would forward all methods to the selected cell type behind it, but again, bindings don't seem to work here.
Has anybody had any experience with this kind of problem before? Or is this one of the cases where bindings isn't going to cut it, and I'll need to do the heavy lifting myself?
Cheers!
I haven't actually tested it, but you shouldn't be losing bindings when you use dataCellForTableColumn:row: ? Can you describe in a bit more detail what you've tried with respect to bindings?
You should be able to set the column's value binding to the "value" property of your object. Then if you return the correct type of cell in dataCellForTableColumn:row: it should display correctly.
Edit: --- deleted gratuitous incorrect advice about cells vs views :)