Skip to content

Instantly share code, notes, and snippets.

@40
40 / revLine.txt
Created September 22, 2012 03:20
Reverse Line Order of Code in Notepad++
INSTRUCTIONS
Edit > Select All
TextFX > TextFX Tools > Insert Line Numbers
If TextFX > TextFX Tools > +Sort ascending is checked, uncheck it
TextFX > TextFX Tools > Sort lines case sensitive (at column)
TextFX > TextFX Tools > Delete Line Numbers or First Word
@40
40 / occ.qml
Created September 23, 2012 22:16
onCreationCompleted
import bb.cascades 1.0
TabbedPane {
activePane: Page {
content: Container {
layout: DockLayout {}
}
} // Ends the root Container
@40
40 / tumblr.html
Created September 24, 2012 04:42
Getting Tumblr Post Count
<div class="counter">Unknown</div>​
@40
40 / cascades-foreign-window.qml
Created September 28, 2012 21:31
Creating Cascades Foreign Window Control
ForeignWindowControl{
id: videoSurface
windowId: "myVideoSurface"
updatedProperties: WindowProperty.Size | WindowProperty.Position | WindowProperty.Visible
visible: boundToWindow
preferredWidth: 640
preferredHeight: 480
}
@40
40 / invoke-media-previewer.c
Created September 28, 2012 22:28
Unbound Invocation of the Media Previewer in BB10 Cascades
// Invocation Framework decides which app to use to open file based on type of file
void App::invokeUnbound(){
InvokeRequest cardRequest;
cardRequest.setUri("file:///accounts/1000/shares/videos/video.mp4");
InvokeManager invokeManager;
invokemanager.invoke(cardRequest);
}
@40
40 / bound-invoke-media-previewer.c++
Created September 28, 2012 22:34
Bound Invocation of the Media Previewer in BlackBerry 10 Cascades
// You are telling the Invocation Framework to use Media Previewer to open the file
void App::invokeBound(){
InvokeRequest cardRequest;
cardRequest.setTarget("sys.mediaplayer.previewer");
cardRequest.setUri("file:///accounts/1000/shares/videos/video.mp4");
InvokeManager invokeManager;
invokemanager.invoke(cardRequest);
}
@40
40 / bound-invoke-sample.cpp
Created September 28, 2012 23:19
Bound Invocation Sample PDF File BB10 Cascades
InvokaManager *iManager = new InvokeManager(this);
InvokeRequest iRequest;
iRequest.setTarget("com.example.MYTARGET");
iRequest.setAction("bb.action.OPEN");
iRequest.setMimeType("application/pdf");
iRequest.setUri("file:///.../..../sample.pdf");
InvokeTargetReply *iReply = iManager->invoke(iRequest);
// connect signals and slots
@40
40 / form.html
Created September 30, 2012 04:55
ohm calculator
<form name="f1">
<table cellpadding="5" cellspacing="0" border="0" bgcolor="#ffedcf">
<tr>
<td colspan="4" align="center">Enter two known values and press <b>Solve</b> to
calculate unknowns.</td>
</tr><tr>
<td align="center" width="90"><input type="Text" name="volts" size=5><br>Volts<br>
(Volts)</td>
<td align="center" width="90"><input type="Text" name="ohms" size=5 ><br>
@40
40 / justmenu.qml
Created September 30, 2012 19:20
QML Menu in BB10
Menu.definition: MenuDefinition {
// Add a Help action
helpAction: HelpActionItem {
// do something there
onTriggered: {
}
}
// Add a Settings action
@40
40 / moreactions.qml
Created September 30, 2012 20:24
More Actions in MenuDefinition BB10 Cascades
actions: [
ActionItem {
...
},
ActionItem {
...
}
]