Posts

c# smartphone-like scrolling windows forms panel movement -

i try explain it: i'm making touch app in windows forms. have panels buttons inside. move ( right or left ) panel when click in control inside panel , move mouse left or right. movement smartphone scrolling. i thought make drag&drop , when drag control inside panel, move panel right or left. don't know how make , don't want lose button's click because every button have own functionality. you have idea? thanks lot

javascript - How to reorder form fields using jquery -

i have php page form this: <form class="form3"> <label class="form3"><input type="checkbox"> item-1</label> <label class="form3"><input type="checkbox"> item-2</label> <label class="form3"><input type="checkbox"> item-3</label> <label class="form3"><input type="checkbox"> item-4</label> <label class="form3"><input type="checkbox"> item-5</label> </form> i have javascript variables set this: var checked = ["", "yes", "", "yes", ""]; now when page loaded, want check if the checked value "yes" want put input items first in teh list , remaining ones later, this: <form class="form3"> <label class="form3"><input type="checkbox" checked="checked"> item-2...

android - How to align header with its underlying data? -

i have implemented list view static header (the header not scrolling listview), using "linearlayout + listview" approach. in general, list view works table, header linearlayout , table body listview. can insert new column , corresponding data list view. reason implement way need let user share data throught context menu of listview. both header name , data has various length, how align header name underlying data? any thought appreciated. check link.. article in blog..hope can you.. http://cap-cay.blogspot.com/2011/09/android-programming-listview.html

JQuery offset() return negative value with CSS3 column? -

i newbie of jquery. want top offset of particular element. use following method: var top = $("img").offset().top; however, returns negative value. can't understand why return negative value? smallest value should zero, or wrong? p.s. use css3 column break in html file. thanks lot!!! edit: body of html file: <div id="chapter-0"> <div> <h1 xml:lang="en-us" id="toc-anchor">main title</h1> <h2 xml:lang="en-us" id="toc-anchor-1">subtitle 1</h2> <p xml:lang="zh-hk"> text</p> <p xml:lang="zh-hk"> text</p> <h2 xml:lang="en-us" id="toc-anchor-2">subtitle2</h2> <p xml:lang="zh-hk"> text</p> <p xml:lang="zh-hk"> text</p> <h2 xml:lang="en-us" id="toc-anchor-3">subtitle3<...

c++ - How to attach a signal to qPixmap? -

i'm creating application using c++ qt , want load multiple images. attach signal each image can enable or disable them afterwards. any help? edit 1: imagedlg = new qfiledialog(); imagelist = imagedlg->getopenfilenames(this, tr("open document"), qdir::currentpath(), tr("image files (*.png *.jpg);;all files (*.*)")); qstring imagename; int x = -50; int y = -50; int n = 1; double size = imagelist.size(); if(imagelist.isempty()) return; scene->clear(); setcursor(qt::waitcursor); foreach(imagename,imagelist) { double val = (n/size)*100; ui->progressbar->setvalue((int)val); image.load(imagename,"4",qt::autocolor); image = image.scaled(100,100,qt::keepaspectratio,qt::fasttransformation); imagenames.push_back(imagename.tostdstring()); // scene->setscenerect(x,y,100,100); item = scene->addpixmap(image); item->se...

c++ - Why does cin cause this program to hang? -

i have posted relevant code below. when compile program, runs , reaches point waits input. type in integer , press enter, code never continues. how go correcting this? int i; cout << "please input column sort by: "; cin >> i; well, first of all, posted above won't compile. try instead: #include <iostream> int main(int argc, char *argv[]) { int i; std::cout << "please input column sort by: "; std::cin >> i; std::cout << "you entered: " << << "\n"; return 0; } compile g++ -o3 thefile.cpp , assuming file called "thefile.cpp". if doesn't work there serious issue going on. if should able diagnose issue further.

filter a list of strings in C# -

i'm learning c# reading books , other online tutorials (homeandlearn.co.uk) i've managed fizzbuzz excercise struggling below excercise. much appreciated. please explain in detail can learn aswell. excercise filter list of strings should pass 6 letter strings composed of 2 concatenated smaller strings in list. for example, given list acks, top, cat, gr, by, bar,lap, st, ely, ades the list should return stacks, laptop, grades, barely because these concatenation of 2 other strings: st + acks = stacks lap + top = laptop gr + ades = grades bar + ely = barely there lot of ways this. here's 1 uses pairing: //grab possible pairings in 1 data structure list<keyvaluepair<string, string>> pairs = new list<keyvaluepair<string, string>>(); string[] list = { "acks", "top", "cat", "gr", "by", "bar", "lap", ...